diff --git a/examples/2.0.x/client-android/java/account/create-anonymous-session.md b/examples/2.0.x/client-android/java/account/create-anonymous-session.md new file mode 100644 index 000000000..4d99edf85 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-anonymous-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // 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()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/create-email-password-session.md b/examples/2.0.x/client-android/java/account/create-email-password-session.md new file mode 100644 index 000000000..fa7d25235 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-email-password-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // 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()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-email-token.md b/examples/2.0.x/client-android/java/account/create-email-token.md new file mode 100644 index 000000000..b65178373 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-email-token.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createEmailToken( + "", // userId + "email@example.com", // email + false, // phrase (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-email-verification.md b/examples/2.0.x/client-android/java/account/create-email-verification.md new file mode 100644 index 000000000..c8099477f --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-email-verification.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // 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()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-jwt.md b/examples/2.0.x/client-android/java/account/create-jwt.md new file mode 100644 index 000000000..f405d3066 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-jwt.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // 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()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-magic-url-token.md b/examples/2.0.x/client-android/java/account/create-magic-url-token.md new file mode 100644 index 000000000..e087ea80c --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-magic-url-token.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createMagicURLToken( + "", // 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()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-mfa-authenticator.md b/examples/2.0.x/client-android/java/account/create-mfa-authenticator.md new file mode 100644 index 000000000..a87f0101c --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-mfa-authenticator.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // 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()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-mfa-challenge.md b/examples/2.0.x/client-android/java/account/create-mfa-challenge.md new file mode 100644 index 000000000..d0e9d5cb0 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-mfa-challenge.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // 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()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-mfa-recovery-codes.md b/examples/2.0.x/client-android/java/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..caaa86aa1 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-mfa-recovery-codes.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // 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()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/create-o-auth-2-session.md b/examples/2.0.x/client-android/java/account/create-o-auth-2-session.md new file mode 100644 index 000000000..da547421c --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-o-auth-2-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // 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()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-o-auth-2-token.md b/examples/2.0.x/client-android/java/account/create-o-auth-2-token.md new file mode 100644 index 000000000..ae685850e --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-o-auth-2-token.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createOAuth2Token( + 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()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-phone-token.md b/examples/2.0.x/client-android/java/account/create-phone-token.md new file mode 100644 index 000000000..a9568376d --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-phone-token.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createPhoneToken( + "", // userId + "+12065550100", // phone + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-phone-verification.md b/examples/2.0.x/client-android/java/account/create-phone-verification.md new file mode 100644 index 000000000..db54d3c83 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-phone-verification.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/create-push-target.md b/examples/2.0.x/client-android/java/account/create-push-target.md new file mode 100644 index 000000000..34d903c44 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-push-target.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createPushTarget( + "", // targetId + "", // identifier + "", // providerId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-recovery.md b/examples/2.0.x/client-android/java/account/create-recovery.md new file mode 100644 index 000000000..acc22302e --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-recovery.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createRecovery( + "email@example.com", // email + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-session.md b/examples/2.0.x/client-android/java/account/create-session.md new file mode 100644 index 000000000..e9ea8d702 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createSession( + "", // userId + "", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create-verification.md b/examples/2.0.x/client-android/java/account/create-verification.md new file mode 100644 index 000000000..3c80fbef8 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create-verification.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.createVerification( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/create.md b/examples/2.0.x/client-android/java/account/create.md new file mode 100644 index 000000000..6a84b3c58 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/create.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.create( + "", // userId + "email@example.com", // email + "password", // password + "", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/delete-identity.md b/examples/2.0.x/client-android/java/account/delete-identity.md new file mode 100644 index 000000000..513de6363 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/delete-identity.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.deleteIdentity( + "", // identityId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/delete-mfa-authenticator.md b/examples/2.0.x/client-android/java/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..c57eeab8f --- /dev/null +++ b/examples/2.0.x/client-android/java/account/delete-mfa-authenticator.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.deleteMFAAuthenticator( + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/delete-push-target.md b/examples/2.0.x/client-android/java/account/delete-push-target.md new file mode 100644 index 000000000..a9e6aff97 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/delete-push-target.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.deletePushTarget( + "", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/delete-session.md b/examples/2.0.x/client-android/java/account/delete-session.md new file mode 100644 index 000000000..84a735035 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/delete-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.deleteSession( + "", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/delete-sessions.md b/examples/2.0.x/client-android/java/account/delete-sessions.md new file mode 100644 index 000000000..4b93d19af --- /dev/null +++ b/examples/2.0.x/client-android/java/account/delete-sessions.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.deleteSessions(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/get-mfa-recovery-codes.md b/examples/2.0.x/client-android/java/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..36814e6cc --- /dev/null +++ b/examples/2.0.x/client-android/java/account/get-mfa-recovery-codes.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.getMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/get-prefs.md b/examples/2.0.x/client-android/java/account/get-prefs.md new file mode 100644 index 000000000..f951fe9b8 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/get-prefs.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.getPrefs(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/get-session.md b/examples/2.0.x/client-android/java/account/get-session.md new file mode 100644 index 000000000..1fb6f1baa --- /dev/null +++ b/examples/2.0.x/client-android/java/account/get-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.getSession( + "", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/get.md b/examples/2.0.x/client-android/java/account/get.md new file mode 100644 index 000000000..e452e8912 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/get.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/list-identities.md b/examples/2.0.x/client-android/java/account/list-identities.md new file mode 100644 index 000000000..1222edaae --- /dev/null +++ b/examples/2.0.x/client-android/java/account/list-identities.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.listIdentities( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/list-mfa-factors.md b/examples/2.0.x/client-android/java/account/list-mfa-factors.md new file mode 100644 index 000000000..f0c3e01a4 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/list-mfa-factors.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.listMFAFactors(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/list-sessions.md b/examples/2.0.x/client-android/java/account/list-sessions.md new file mode 100644 index 000000000..9e52ea471 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/list-sessions.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.listSessions(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/update-email-verification.md b/examples/2.0.x/client-android/java/account/update-email-verification.md new file mode 100644 index 000000000..1c9bc865e --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-email-verification.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateEmailVerification( + "", // userId + "", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-email.md b/examples/2.0.x/client-android/java/account/update-email.md new file mode 100644 index 000000000..d077f9f47 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-email.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateEmail( + "email@example.com", // email + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-magic-url-session.md b/examples/2.0.x/client-android/java/account/update-magic-url-session.md new file mode 100644 index 000000000..be3e9b0c9 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-magic-url-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateMagicURLSession( + "", // userId + "", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-mfa-authenticator.md b/examples/2.0.x/client-android/java/account/update-mfa-authenticator.md new file mode 100644 index 000000000..e2b017cf5 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-mfa-authenticator.md @@ -0,0 +1,28 @@ +```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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateMFAAuthenticator( + AuthenticatorType.TOTP, // type + "", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-mfa-challenge.md b/examples/2.0.x/client-android/java/account/update-mfa-challenge.md new file mode 100644 index 000000000..132b29948 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-mfa-challenge.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateMFAChallenge( + "", // challengeId + "", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-mfa-recovery-codes.md b/examples/2.0.x/client-android/java/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..38c2fa969 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-mfa-recovery-codes.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/update-mfa.md b/examples/2.0.x/client-android/java/account/update-mfa.md new file mode 100644 index 000000000..dc9a3d769 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-mfa.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateMFA( + false, // mfa + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-name.md b/examples/2.0.x/client-android/java/account/update-name.md new file mode 100644 index 000000000..3aca6d887 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-name.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateName( + "", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-password.md b/examples/2.0.x/client-android/java/account/update-password.md new file mode 100644 index 000000000..c491f4b91 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-password.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePassword( + "password", // password + "password", // oldPassword (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-phone-session.md b/examples/2.0.x/client-android/java/account/update-phone-session.md new file mode 100644 index 000000000..edaa99d4b --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-phone-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePhoneSession( + "", // userId + "", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-phone-verification.md b/examples/2.0.x/client-android/java/account/update-phone-verification.md new file mode 100644 index 000000000..b8f19abd0 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-phone-verification.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePhoneVerification( + "", // userId + "", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-phone.md b/examples/2.0.x/client-android/java/account/update-phone.md new file mode 100644 index 000000000..6613850b1 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-phone.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePhone( + "+12065550100", // phone + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-prefs.md b/examples/2.0.x/client-android/java/account/update-prefs.md new file mode 100644 index 000000000..819a89960 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-prefs.md @@ -0,0 +1,30 @@ +```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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePrefs( + Map.of( + "language", "en", + "timezone", "UTC", + "darkTheme", true + ), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-push-target.md b/examples/2.0.x/client-android/java/account/update-push-target.md new file mode 100644 index 000000000..197787858 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-push-target.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updatePushTarget( + "", // targetId + "", // identifier + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-recovery.md b/examples/2.0.x/client-android/java/account/update-recovery.md new file mode 100644 index 000000000..96741d0a9 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-recovery.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateRecovery( + "", // userId + "", // secret + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-session.md b/examples/2.0.x/client-android/java/account/update-session.md new file mode 100644 index 000000000..bf54de4dc --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-session.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateSession( + "", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/account/update-status.md b/examples/2.0.x/client-android/java/account/update-status.md new file mode 100644 index 000000000..a0537aeb1 --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-status.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateStatus(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/account/update-verification.md b/examples/2.0.x/client-android/java/account/update-verification.md new file mode 100644 index 000000000..2f63c5bda --- /dev/null +++ b/examples/2.0.x/client-android/java/account/update-verification.md @@ -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://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Account account = new Account(client); + +account.updateVerification( + "", // userId + "", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-browser.md b/examples/2.0.x/client-android/java/avatars/get-browser.md new file mode 100644 index 000000000..f101ad541 --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-browser.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.Browser; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getBrowser( + Browser.AVANT_BROWSER, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-credit-card.md b/examples/2.0.x/client-android/java/avatars/get-credit-card.md new file mode 100644 index 000000000..b12cebc96 --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-credit-card.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.CreditCard; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getCreditCard( + CreditCard.AMERICAN_EXPRESS, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-favicon.md b/examples/2.0.x/client-android/java/avatars/get-favicon.md new file mode 100644 index 000000000..c7bc6411f --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-favicon.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getFavicon( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-flag.md b/examples/2.0.x/client-android/java/avatars/get-flag.md new file mode 100644 index 000000000..4d808513f --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-flag.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.Flag; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getFlag( + Flag.AFGHANISTAN, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-image.md b/examples/2.0.x/client-android/java/avatars/get-image.md new file mode 100644 index 000000000..a22041f53 --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-image.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getImage( + "https://example.com", // url + 0, // width (optional) + 0, // height (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-initials.md b/examples/2.0.x/client-android/java/avatars/get-initials.md new file mode 100644 index 000000000..08f5bea98 --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-initials.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getInitials( + "", // name (optional) + 0, // width (optional) + 0, // height (optional) + "FFFFFF", // background (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-photo.md b/examples/2.0.x/client-android/java/avatars/get-photo.md new file mode 100644 index 000000000..2204db789 --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-photo.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getPhoto( + 0, // width (optional) + 0, // height (optional) + 0, // quality (optional) + "png", // output (optional) + "g", // rating (optional) + "current()", // userId (optional) + "", // emailHash (optional) + "", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-qr.md b/examples/2.0.x/client-android/java/avatars/get-qr.md new file mode 100644 index 000000000..ad08ab561 --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-qr.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getQR( + "", // text + 1, // size (optional) + 0, // margin (optional) + false, // download (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/avatars/get-screenshot.md b/examples/2.0.x/client-android/java/avatars/get-screenshot.md new file mode 100644 index 000000000..71f96c5b6 --- /dev/null +++ b/examples/2.0.x/client-android/java/avatars/get-screenshot.md @@ -0,0 +1,52 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.BrowserTheme; +import io.appwrite.enums.Timezone; +import io.appwrite.enums.BrowserPermission; +import io.appwrite.enums.ImageFormat; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getScreenshot( + "https://example.com", // url + Map.of( + "Authorization", "Bearer token123", + "X-Custom-Header", "value" + ), // headers (optional) + 1920, // viewportWidth (optional) + 1080, // viewportHeight (optional) + 2, // scale (optional) + BrowserTheme.LIGHT, // theme (optional) + "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // userAgent (optional) + true, // fullpage (optional) + "en-US", // locale (optional) + Timezone.AFRICA_ABIDJAN, // timezone (optional) + 37.7749, // latitude (optional) + -122.4194, // longitude (optional) + 100, // accuracy (optional) + true, // touch (optional) + BrowserPermission.GEOLOCATION, // permissions (optional) + 3, // sleep (optional) + 800, // width (optional) + 600, // height (optional) + 85, // quality (optional) + ImageFormat.JPG, // output (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/create-document.md b/examples/2.0.x/client-android/java/databases/create-document.md new file mode 100644 index 000000000..3c64659d5 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/create-document.md @@ -0,0 +1,39 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.createDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/create-operations.md b/examples/2.0.x/client-android/java/databases/create-operations.md new file mode 100644 index 000000000..bbef85739 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/create-operations.md @@ -0,0 +1,35 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.createOperations( + "", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "", + "collectionId", "", + "documentId", "", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/create-transaction.md b/examples/2.0.x/client-android/java/databases/create-transaction.md new file mode 100644 index 000000000..d96c27a07 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/create-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/decrement-document-attribute.md b/examples/2.0.x/client-android/java/databases/decrement-document-attribute.md new file mode 100644 index 000000000..1a2f23e22 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/decrement-document-attribute.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.decrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 1, // value (optional) + 0, // min (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/delete-document.md b/examples/2.0.x/client-android/java/databases/delete-document.md new file mode 100644 index 000000000..ef04ee69f --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/delete-document.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.deleteDocument( + "", // databaseId + "", // collectionId + "", // documentId + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/delete-transaction.md b/examples/2.0.x/client-android/java/databases/delete-transaction.md new file mode 100644 index 000000000..4a2d8f01f --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/delete-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.deleteTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/get-document.md b/examples/2.0.x/client-android/java/databases/get-document.md new file mode 100644 index 000000000..106afa2c5 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/get-document.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.getDocument( + "", // databaseId + "", // collectionId + "", // documentId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/get-transaction.md b/examples/2.0.x/client-android/java/databases/get-transaction.md new file mode 100644 index 000000000..b33a4bc87 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/get-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.getTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/increment-document-attribute.md b/examples/2.0.x/client-android/java/databases/increment-document-attribute.md new file mode 100644 index 000000000..fe3635924 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/increment-document-attribute.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.incrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 1, // value (optional) + 100, // max (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/list-documents.md b/examples/2.0.x/client-android/java/databases/list-documents.md new file mode 100644 index 000000000..8569cb60f --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/list-documents.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.listDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/list-transactions.md b/examples/2.0.x/client-android/java/databases/list-transactions.md new file mode 100644 index 000000000..ad11c7f70 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/list-transactions.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/update-document.md b/examples/2.0.x/client-android/java/databases/update-document.md new file mode 100644 index 000000000..40dc7c7be --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/update-document.md @@ -0,0 +1,39 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.updateDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 33, + "isAdmin", false + ), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/update-transaction.md b/examples/2.0.x/client-android/java/databases/update-transaction.md new file mode 100644 index 000000000..dfc4db62c --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/update-transaction.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.updateTransaction( + "", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/databases/upsert-document.md b/examples/2.0.x/client-android/java/databases/upsert-document.md new file mode 100644 index 000000000..f5976a925 --- /dev/null +++ b/examples/2.0.x/client-android/java/databases/upsert-document.md @@ -0,0 +1,39 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.upsertDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/create-document.md b/examples/2.0.x/client-android/java/documentsdb/create-document.md new file mode 100644 index 000000000..77f034d88 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/create-document.md @@ -0,0 +1,39 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/create-documents.md b/examples/2.0.x/client-android/java/documentsdb/create-documents.md new file mode 100644 index 000000000..c52433a2d --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/create-documents.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createDocuments( + "", // databaseId + "", // collectionId + List.of(), // documents + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/create-operations.md b/examples/2.0.x/client-android/java/documentsdb/create-operations.md new file mode 100644 index 000000000..961a5501d --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/create-operations.md @@ -0,0 +1,35 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createOperations( + "", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "", + "collectionId", "", + "documentId", "", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/create-transaction.md b/examples/2.0.x/client-android/java/documentsdb/create-transaction.md new file mode 100644 index 000000000..da91c5c8e --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/create-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-android/java/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..f1853ac6d --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/decrement-document-attribute.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.decrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 1, // value (optional) + 0, // min (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/delete-document.md b/examples/2.0.x/client-android/java/documentsdb/delete-document.md new file mode 100644 index 000000000..247a63aac --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/delete-document.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteDocument( + "", // databaseId + "", // collectionId + "", // documentId + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/delete-transaction.md b/examples/2.0.x/client-android/java/documentsdb/delete-transaction.md new file mode 100644 index 000000000..0b0a76161 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/delete-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/get-document.md b/examples/2.0.x/client-android/java/documentsdb/get-document.md new file mode 100644 index 000000000..7bd66e1ea --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/get-document.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getDocument( + "", // databaseId + "", // collectionId + "", // documentId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/get-transaction.md b/examples/2.0.x/client-android/java/documentsdb/get-transaction.md new file mode 100644 index 000000000..12c42243e --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/get-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-android/java/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..fab214e96 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/increment-document-attribute.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.incrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 1, // value (optional) + 100, // max (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/list-documents.md b/examples/2.0.x/client-android/java/documentsdb/list-documents.md new file mode 100644 index 000000000..0abb6734c --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/list-documents.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/list-transactions.md b/examples/2.0.x/client-android/java/documentsdb/list-transactions.md new file mode 100644 index 000000000..9b8fcd7bc --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/list-transactions.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/update-document.md b/examples/2.0.x/client-android/java/documentsdb/update-document.md new file mode 100644 index 000000000..da8475fa8 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/update-document.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/update-transaction.md b/examples/2.0.x/client-android/java/documentsdb/update-transaction.md new file mode 100644 index 000000000..9d95dfcd6 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/update-transaction.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateTransaction( + "", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/documentsdb/upsert-document.md b/examples/2.0.x/client-android/java/documentsdb/upsert-document.md new file mode 100644 index 000000000..82e90a403 --- /dev/null +++ b/examples/2.0.x/client-android/java/documentsdb/upsert-document.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.upsertDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/functions/create-execution.md b/examples/2.0.x/client-android/java/functions/create-execution.md new file mode 100644 index 000000000..1984020b5 --- /dev/null +++ b/examples/2.0.x/client-android/java/functions/create-execution.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.ExecutionMethod; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Functions functions = new Functions(client); + +functions.createExecution( + "", // functionId + "", // body (optional) + false, // async (optional) + "", // path (optional) + ExecutionMethod.GET, // method (optional) + Map.of("a", "b"), // headers (optional) + "", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/functions/get-execution.md b/examples/2.0.x/client-android/java/functions/get-execution.md new file mode 100644 index 000000000..206b407c7 --- /dev/null +++ b/examples/2.0.x/client-android/java/functions/get-execution.md @@ -0,0 +1,27 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Functions functions = new Functions(client); + +functions.getExecution( + "", // functionId + "", // executionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/functions/list-executions.md b/examples/2.0.x/client-android/java/functions/list-executions.md new file mode 100644 index 000000000..3cd974de7 --- /dev/null +++ b/examples/2.0.x/client-android/java/functions/list-executions.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Functions functions = new Functions(client); + +functions.listExecutions( + "", // functionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/graphql/mutation.md b/examples/2.0.x/client-android/java/graphql/mutation.md new file mode 100644 index 000000000..9cc7febe9 --- /dev/null +++ b/examples/2.0.x/client-android/java/graphql/mutation.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Graphql; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Graphql graphql = new Graphql(client); + +graphql.mutation( + Map.of("a", "b"), // query + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/graphql/query.md b/examples/2.0.x/client-android/java/graphql/query.md new file mode 100644 index 000000000..25704b00b --- /dev/null +++ b/examples/2.0.x/client-android/java/graphql/query.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Graphql; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Graphql graphql = new Graphql(client); + +graphql.query( + Map.of("a", "b"), // query + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/locale/get.md b/examples/2.0.x/client-android/java/locale/get.md new file mode 100644 index 000000000..d2c4e4d23 --- /dev/null +++ b/examples/2.0.x/client-android/java/locale/get.md @@ -0,0 +1,22 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Locale locale = new Locale(client); + +locale.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/locale/list-codes.md b/examples/2.0.x/client-android/java/locale/list-codes.md new file mode 100644 index 000000000..534b11995 --- /dev/null +++ b/examples/2.0.x/client-android/java/locale/list-codes.md @@ -0,0 +1,22 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Locale locale = new Locale(client); + +locale.listCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/locale/list-continents.md b/examples/2.0.x/client-android/java/locale/list-continents.md new file mode 100644 index 000000000..998a31be2 --- /dev/null +++ b/examples/2.0.x/client-android/java/locale/list-continents.md @@ -0,0 +1,22 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Locale locale = new Locale(client); + +locale.listContinents(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/locale/list-countries-eu.md b/examples/2.0.x/client-android/java/locale/list-countries-eu.md new file mode 100644 index 000000000..5950c990f --- /dev/null +++ b/examples/2.0.x/client-android/java/locale/list-countries-eu.md @@ -0,0 +1,22 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Locale locale = new Locale(client); + +locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/locale/list-countries-phones.md b/examples/2.0.x/client-android/java/locale/list-countries-phones.md new file mode 100644 index 000000000..6096758ec --- /dev/null +++ b/examples/2.0.x/client-android/java/locale/list-countries-phones.md @@ -0,0 +1,22 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Locale locale = new Locale(client); + +locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/locale/list-countries.md b/examples/2.0.x/client-android/java/locale/list-countries.md new file mode 100644 index 000000000..140fc48a0 --- /dev/null +++ b/examples/2.0.x/client-android/java/locale/list-countries.md @@ -0,0 +1,22 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Locale locale = new Locale(client); + +locale.listCountries(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/locale/list-currencies.md b/examples/2.0.x/client-android/java/locale/list-currencies.md new file mode 100644 index 000000000..0e5273d96 --- /dev/null +++ b/examples/2.0.x/client-android/java/locale/list-currencies.md @@ -0,0 +1,22 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Locale locale = new Locale(client); + +locale.listCurrencies(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/locale/list-languages.md b/examples/2.0.x/client-android/java/locale/list-languages.md new file mode 100644 index 000000000..e85bd0a11 --- /dev/null +++ b/examples/2.0.x/client-android/java/locale/list-languages.md @@ -0,0 +1,22 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Locale locale = new Locale(client); + +locale.listLanguages(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); +``` diff --git a/examples/2.0.x/client-android/java/messaging/create-subscriber.md b/examples/2.0.x/client-android/java/messaging/create-subscriber.md new file mode 100644 index 000000000..88f9260d4 --- /dev/null +++ b/examples/2.0.x/client-android/java/messaging/create-subscriber.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Messaging messaging = new Messaging(client); + +messaging.createSubscriber( + "", // topicId + "", // subscriberId + "", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/messaging/delete-subscriber.md b/examples/2.0.x/client-android/java/messaging/delete-subscriber.md new file mode 100644 index 000000000..1c012a3f9 --- /dev/null +++ b/examples/2.0.x/client-android/java/messaging/delete-subscriber.md @@ -0,0 +1,27 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Messaging messaging = new Messaging(client); + +messaging.deleteSubscriber( + "", // topicId + "", // subscriberId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/presences/delete.md b/examples/2.0.x/client-android/java/presences/delete.md new file mode 100644 index 000000000..f0f6afa26 --- /dev/null +++ b/examples/2.0.x/client-android/java/presences/delete.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Presences; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Presences presences = new Presences(client); + +presences.delete( + "", // presenceId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/presences/get.md b/examples/2.0.x/client-android/java/presences/get.md new file mode 100644 index 000000000..2d2d2cea0 --- /dev/null +++ b/examples/2.0.x/client-android/java/presences/get.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Presences; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Presences presences = new Presences(client); + +presences.get( + "", // presenceId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/presences/list.md b/examples/2.0.x/client-android/java/presences/list.md new file mode 100644 index 000000000..d66a4161b --- /dev/null +++ b/examples/2.0.x/client-android/java/presences/list.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Presences; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Presences presences = new Presences(client); + +presences.list( + List.of(), // queries (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/presences/update.md b/examples/2.0.x/client-android/java/presences/update.md new file mode 100644 index 000000000..964f3a032 --- /dev/null +++ b/examples/2.0.x/client-android/java/presences/update.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Presences; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Presences presences = new Presences(client); + +presences.update( + "", // presenceId + "", // status (optional) + "2020-10-15T06:38:00.000+00:00", // expiresAt (optional) + Map.of("a", "b"), // metadata (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + false, // purge (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/presences/upsert.md b/examples/2.0.x/client-android/java/presences/upsert.md new file mode 100644 index 000000000..2d279b3d0 --- /dev/null +++ b/examples/2.0.x/client-android/java/presences/upsert.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Presences; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Presences presences = new Presences(client); + +presences.upsert( + "", // presenceId + "", // status + List.of(Permission.read(Role.any())), // permissions (optional) + "2020-10-15T06:38:00.000+00:00", // expiresAt (optional) + Map.of("a", "b"), // metadata (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/create-file.md b/examples/2.0.x/client-android/java/storage/create-file.md new file mode 100644 index 000000000..e441255e2 --- /dev/null +++ b/examples/2.0.x/client-android/java/storage/create-file.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Storage storage = new Storage(client); + +storage.createFile( + "", // bucketId + "", // fileId + InputFile.fromPath("file.png"), // file + List.of(Permission.read(Role.any())), // permissions (optional) + "photos/2026", // folder (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/delete-file.md b/examples/2.0.x/client-android/java/storage/delete-file.md new file mode 100644 index 000000000..67212a70c --- /dev/null +++ b/examples/2.0.x/client-android/java/storage/delete-file.md @@ -0,0 +1,27 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Storage storage = new Storage(client); + +storage.deleteFile( + "", // bucketId + "", // fileId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/get-file-download.md b/examples/2.0.x/client-android/java/storage/get-file-download.md new file mode 100644 index 000000000..88e24ca73 --- /dev/null +++ b/examples/2.0.x/client-android/java/storage/get-file-download.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Storage storage = new Storage(client); + +storage.getFileDownload( + "", // bucketId + "", // fileId + "", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/get-file-preview.md b/examples/2.0.x/client-android/java/storage/get-file-preview.md new file mode 100644 index 000000000..023a76043 --- /dev/null +++ b/examples/2.0.x/client-android/java/storage/get-file-preview.md @@ -0,0 +1,41 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; +import io.appwrite.enums.ImageGravity; +import io.appwrite.enums.ImageFormat; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Storage storage = new Storage(client); + +storage.getFilePreview( + "", // bucketId + "", // fileId + 0, // width (optional) + 0, // height (optional) + ImageGravity.CENTER, // gravity (optional) + -1, // quality (optional) + 0, // borderWidth (optional) + "FFFFFF", // borderColor (optional) + 0, // borderRadius (optional) + 0, // opacity (optional) + -360, // rotation (optional) + "FFFFFF", // background (optional) + ImageFormat.JPG, // output (optional) + "", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/get-file-view.md b/examples/2.0.x/client-android/java/storage/get-file-view.md new file mode 100644 index 000000000..c9d11938b --- /dev/null +++ b/examples/2.0.x/client-android/java/storage/get-file-view.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Storage storage = new Storage(client); + +storage.getFileView( + "", // bucketId + "", // fileId + "", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/get-file.md b/examples/2.0.x/client-android/java/storage/get-file.md new file mode 100644 index 000000000..1c5cb7af3 --- /dev/null +++ b/examples/2.0.x/client-android/java/storage/get-file.md @@ -0,0 +1,27 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Storage storage = new Storage(client); + +storage.getFile( + "", // bucketId + "", // fileId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/list-files.md b/examples/2.0.x/client-android/java/storage/list-files.md new file mode 100644 index 000000000..b6737bf00 --- /dev/null +++ b/examples/2.0.x/client-android/java/storage/list-files.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Storage storage = new Storage(client); + +storage.listFiles( + "", // bucketId + List.of(), // queries (optional) + "", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/storage/update-file.md b/examples/2.0.x/client-android/java/storage/update-file.md new file mode 100644 index 000000000..225eaaac4 --- /dev/null +++ b/examples/2.0.x/client-android/java/storage/update-file.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Storage storage = new Storage(client); + +storage.updateFile( + "", // bucketId + "", // fileId + "", // name (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/create-operations.md b/examples/2.0.x/client-android/java/tablesdb/create-operations.md new file mode 100644 index 000000000..86cdfa3af --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/create-operations.md @@ -0,0 +1,35 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createOperations( + "", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "", + "tableId", "", + "rowId", "", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/create-row.md b/examples/2.0.x/client-android/java/tablesdb/create-row.md new file mode 100644 index 000000000..4244a249f --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/create-row.md @@ -0,0 +1,39 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRow( + "", // databaseId + "", // tableId + "", // rowId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/create-transaction.md b/examples/2.0.x/client-android/java/tablesdb/create-transaction.md new file mode 100644 index 000000000..8401bfec3 --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/create-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/decrement-row-column.md b/examples/2.0.x/client-android/java/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..c998b442f --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/decrement-row-column.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.decrementRowColumn( + "", // databaseId + "", // tableId + "", // rowId + "", // column + 1, // value (optional) + 0, // min (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/delete-row.md b/examples/2.0.x/client-android/java/tablesdb/delete-row.md new file mode 100644 index 000000000..d00cf595c --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/delete-row.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteRow( + "", // databaseId + "", // tableId + "", // rowId + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/delete-transaction.md b/examples/2.0.x/client-android/java/tablesdb/delete-transaction.md new file mode 100644 index 000000000..f48b50ac9 --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/delete-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/get-row.md b/examples/2.0.x/client-android/java/tablesdb/get-row.md new file mode 100644 index 000000000..1eae5257d --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/get-row.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getRow( + "", // databaseId + "", // tableId + "", // rowId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/get-transaction.md b/examples/2.0.x/client-android/java/tablesdb/get-transaction.md new file mode 100644 index 000000000..861aacb82 --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/get-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/increment-row-column.md b/examples/2.0.x/client-android/java/tablesdb/increment-row-column.md new file mode 100644 index 000000000..5fb7189e2 --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/increment-row-column.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.incrementRowColumn( + "", // databaseId + "", // tableId + "", // rowId + "", // column + 1, // value (optional) + 100, // max (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/list-rows.md b/examples/2.0.x/client-android/java/tablesdb/list-rows.md new file mode 100644 index 000000000..cbf40287b --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/list-rows.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listRows( + "", // databaseId + "", // tableId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/list-transactions.md b/examples/2.0.x/client-android/java/tablesdb/list-transactions.md new file mode 100644 index 000000000..9ebb180a8 --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/list-transactions.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/update-row.md b/examples/2.0.x/client-android/java/tablesdb/update-row.md new file mode 100644 index 000000000..bc3f84c12 --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/update-row.md @@ -0,0 +1,39 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRow( + "", // databaseId + "", // tableId + "", // rowId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 33, + "isAdmin", false + ), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/update-transaction.md b/examples/2.0.x/client-android/java/tablesdb/update-transaction.md new file mode 100644 index 000000000..8f362d038 --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/update-transaction.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateTransaction( + "", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/tablesdb/upsert-row.md b/examples/2.0.x/client-android/java/tablesdb/upsert-row.md new file mode 100644 index 000000000..4df4792a3 --- /dev/null +++ b/examples/2.0.x/client-android/java/tablesdb/upsert-row.md @@ -0,0 +1,39 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.upsertRow( + "", // databaseId + "", // tableId + "", // rowId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 33, + "isAdmin", false + ), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/create-membership.md b/examples/2.0.x/client-android/java/teams/create-membership.md new file mode 100644 index 000000000..861aeb622 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/create-membership.md @@ -0,0 +1,32 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.createMembership( + "", // teamId + List.of(), // roles + "email@example.com", // email (optional) + "", // userId (optional) + "+12065550100", // phone (optional) + "https://example.com", // url (optional) + "", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/create.md b/examples/2.0.x/client-android/java/teams/create.md new file mode 100644 index 000000000..e9a680043 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/create.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.create( + "", // teamId + "", // name + List.of(), // roles (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/delete-membership.md b/examples/2.0.x/client-android/java/teams/delete-membership.md new file mode 100644 index 000000000..3a0482db0 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/delete-membership.md @@ -0,0 +1,27 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.deleteMembership( + "", // teamId + "", // membershipId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/delete.md b/examples/2.0.x/client-android/java/teams/delete.md new file mode 100644 index 000000000..06f186730 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/delete.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.delete( + "", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/get-membership.md b/examples/2.0.x/client-android/java/teams/get-membership.md new file mode 100644 index 000000000..501849608 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/get-membership.md @@ -0,0 +1,27 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.getMembership( + "", // teamId + "", // membershipId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/get-prefs.md b/examples/2.0.x/client-android/java/teams/get-prefs.md new file mode 100644 index 000000000..c82fce982 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/get-prefs.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.getPrefs( + "", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/get.md b/examples/2.0.x/client-android/java/teams/get.md new file mode 100644 index 000000000..df348f12c --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/get.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.get( + "", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/list-memberships.md b/examples/2.0.x/client-android/java/teams/list-memberships.md new file mode 100644 index 000000000..79aad6dea --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/list-memberships.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.listMemberships( + "", // teamId + List.of(), // queries (optional) + "", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/list.md b/examples/2.0.x/client-android/java/teams/list.md new file mode 100644 index 000000000..5d2582848 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/list.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.list( + List.of(), // queries (optional) + "", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/update-membership-status.md b/examples/2.0.x/client-android/java/teams/update-membership-status.md new file mode 100644 index 000000000..a6a54df0e --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/update-membership-status.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.updateMembershipStatus( + "", // teamId + "", // membershipId + "", // userId + "", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/update-membership.md b/examples/2.0.x/client-android/java/teams/update-membership.md new file mode 100644 index 000000000..60231f2c1 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/update-membership.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.updateMembership( + "", // teamId + "", // membershipId + List.of(), // roles + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/update-name.md b/examples/2.0.x/client-android/java/teams/update-name.md new file mode 100644 index 000000000..1e104100a --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/update-name.md @@ -0,0 +1,27 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.updateName( + "", // teamId + "", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/teams/update-prefs.md b/examples/2.0.x/client-android/java/teams/update-prefs.md new file mode 100644 index 000000000..69ed22ae5 --- /dev/null +++ b/examples/2.0.x/client-android/java/teams/update-prefs.md @@ -0,0 +1,27 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Teams teams = new Teams(client); + +teams.updatePrefs( + "", // teamId + Map.of("a", "b"), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/create-document.md b/examples/2.0.x/client-android/java/vectorsdb/create-document.md new file mode 100644 index 000000000..8a3d7f9eb --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/create-document.md @@ -0,0 +1,38 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of( + "embeddings", List.of(0.12, -0.55, 0.88, 1.02), + "metadata", Map.of( + "key", "value" + ) + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/create-operations.md b/examples/2.0.x/client-android/java/vectorsdb/create-operations.md new file mode 100644 index 000000000..7e503634c --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/create-operations.md @@ -0,0 +1,35 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createOperations( + "", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "", + "collectionId", "", + "documentId", "", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/create-query.md b/examples/2.0.x/client-android/java/vectorsdb/create-query.md new file mode 100644 index 000000000..3f1cfd5cc --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/create-query.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createQuery( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/create-transaction.md b/examples/2.0.x/client-android/java/vectorsdb/create-transaction.md new file mode 100644 index 000000000..4784fc47c --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/create-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/delete-document.md b/examples/2.0.x/client-android/java/vectorsdb/delete-document.md new file mode 100644 index 000000000..d80673015 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/delete-document.md @@ -0,0 +1,29 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteDocument( + "", // databaseId + "", // collectionId + "", // documentId + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/delete-transaction.md b/examples/2.0.x/client-android/java/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..04b9c4da1 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/delete-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/get-document.md b/examples/2.0.x/client-android/java/vectorsdb/get-document.md new file mode 100644 index 000000000..15ddf82d0 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/get-document.md @@ -0,0 +1,30 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getDocument( + "", // databaseId + "", // collectionId + "", // documentId + List.of(), // queries (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/get-transaction.md b/examples/2.0.x/client-android/java/vectorsdb/get-transaction.md new file mode 100644 index 000000000..987ca6e7c --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/get-transaction.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getTransaction( + "", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/list-documents.md b/examples/2.0.x/client-android/java/vectorsdb/list-documents.md new file mode 100644 index 000000000..12ef1f0c3 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/list-documents.md @@ -0,0 +1,31 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listDocuments( + "", // databaseId + "", // collectionId + List.of(), // queries (optional) + "", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/list-transactions.md b/examples/2.0.x/client-android/java/vectorsdb/list-transactions.md new file mode 100644 index 000000000..18ef0e55d --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/list-transactions.md @@ -0,0 +1,26 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/update-document.md b/examples/2.0.x/client-android/java/vectorsdb/update-document.md new file mode 100644 index 000000000..4acb5cce0 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/update-document.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/update-transaction.md b/examples/2.0.x/client-android/java/vectorsdb/update-transaction.md new file mode 100644 index 000000000..a21aad1aa --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/update-transaction.md @@ -0,0 +1,28 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateTransaction( + "", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/java/vectorsdb/upsert-document.md b/examples/2.0.x/client-android/java/vectorsdb/upsert-document.md new file mode 100644 index 000000000..58ac9a9a9 --- /dev/null +++ b/examples/2.0.x/client-android/java/vectorsdb/upsert-document.md @@ -0,0 +1,33 @@ +```java +import android.util.Log; + +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.upsertDocument( + "", // databaseId + "", // collectionId + "", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-anonymous-session.md b/examples/2.0.x/client-android/kotlin/account/create-anonymous-session.md new file mode 100644 index 000000000..0cc36e1f6 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-anonymous-session.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.createAnonymousSession() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-email-password-session.md b/examples/2.0.x/client-android/kotlin/account/create-email-password-session.md new file mode 100644 index 000000000..6100e4834 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-email-password-session.md @@ -0,0 +1,16 @@ +```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.createEmailPasswordSession( + email = "email@example.com", + password = "password", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-email-token.md b/examples/2.0.x/client-android/kotlin/account/create-email-token.md new file mode 100644 index 000000000..01dda3d64 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-email-token.md @@ -0,0 +1,17 @@ +```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.createEmailToken( + userId = "", + email = "email@example.com", + phrase = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-email-verification.md b/examples/2.0.x/client-android/kotlin/account/create-email-verification.md new file mode 100644 index 000000000..2a0d00e97 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-email-verification.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.createEmailVerification( + url = "https://example.com", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-jwt.md b/examples/2.0.x/client-android/kotlin/account/create-jwt.md new file mode 100644 index 000000000..79d7b0993 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-jwt.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.createJWT( + duration = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-magic-url-token.md b/examples/2.0.x/client-android/kotlin/account/create-magic-url-token.md new file mode 100644 index 000000000..62904044f --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-magic-url-token.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.createMagicURLToken( + userId = "", + email = "email@example.com", + url = "https://example.com", // (optional) + phrase = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-mfa-authenticator.md b/examples/2.0.x/client-android/kotlin/account/create-mfa-authenticator.md new file mode 100644 index 000000000..132bf749e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-mfa-authenticator.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.createMFAAuthenticator( + type = AuthenticatorType.TOTP, +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-mfa-challenge.md b/examples/2.0.x/client-android/kotlin/account/create-mfa-challenge.md new file mode 100644 index 000000000..92206faba --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-mfa-challenge.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticationFactor + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.createMFAChallenge( + factor = AuthenticationFactor.EMAIL, +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-mfa-recovery-codes.md b/examples/2.0.x/client-android/kotlin/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..d91a3eb39 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-mfa-recovery-codes.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.createMFARecoveryCodes() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-session.md b/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-session.md new file mode 100644 index 000000000..cde941c78 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-session.md @@ -0,0 +1,19 @@ +```kotlin +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("") // Your project ID + +val account = Account(client) + +account.createOAuth2Session( + provider = OAuthProvider.AMAZON, + success = "https://example.com", // (optional) + failure = "https://example.com", // (optional) + scopes = listOf(), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-token.md b/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-token.md new file mode 100644 index 000000000..5e9056494 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-o-auth-2-token.md @@ -0,0 +1,19 @@ +```kotlin +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("") // 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) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-phone-token.md b/examples/2.0.x/client-android/kotlin/account/create-phone-token.md new file mode 100644 index 000000000..3a61bac79 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-phone-token.md @@ -0,0 +1,16 @@ +```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.createPhoneToken( + userId = "", + phone = "+12065550100", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-phone-verification.md b/examples/2.0.x/client-android/kotlin/account/create-phone-verification.md new file mode 100644 index 000000000..77705b8fd --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-phone-verification.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.createPhoneVerification() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-push-target.md b/examples/2.0.x/client-android/kotlin/account/create-push-target.md new file mode 100644 index 000000000..22d64cb9e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-push-target.md @@ -0,0 +1,17 @@ +```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.createPushTarget( + targetId = "", + identifier = "", + providerId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-recovery.md b/examples/2.0.x/client-android/kotlin/account/create-recovery.md new file mode 100644 index 000000000..1a89ccccb --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-recovery.md @@ -0,0 +1,16 @@ +```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.createRecovery( + email = "email@example.com", + url = "https://example.com", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-session.md b/examples/2.0.x/client-android/kotlin/account/create-session.md new file mode 100644 index 000000000..b86495cfb --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-session.md @@ -0,0 +1,16 @@ +```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.createSession( + userId = "", + secret = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create-verification.md b/examples/2.0.x/client-android/kotlin/account/create-verification.md new file mode 100644 index 000000000..d8ad1bc51 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create-verification.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.createVerification( + url = "https://example.com", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/create.md b/examples/2.0.x/client-android/kotlin/account/create.md new file mode 100644 index 000000000..8e7f12c51 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/create.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.create( + userId = "", + email = "email@example.com", + password = "password", + name = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/delete-identity.md b/examples/2.0.x/client-android/kotlin/account/delete-identity.md new file mode 100644 index 000000000..7efc1d7c9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/delete-identity.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.deleteIdentity( + identityId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/delete-mfa-authenticator.md b/examples/2.0.x/client-android/kotlin/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..77a68a075 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.deleteMFAAuthenticator( + type = AuthenticatorType.TOTP, +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/delete-push-target.md b/examples/2.0.x/client-android/kotlin/account/delete-push-target.md new file mode 100644 index 000000000..6fce7b7c3 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/delete-push-target.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.deletePushTarget( + targetId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/delete-session.md b/examples/2.0.x/client-android/kotlin/account/delete-session.md new file mode 100644 index 000000000..de9381177 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/delete-session.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.deleteSession( + sessionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/delete-sessions.md b/examples/2.0.x/client-android/kotlin/account/delete-sessions.md new file mode 100644 index 000000000..ff404dbc1 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/delete-sessions.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.deleteSessions() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/get-mfa-recovery-codes.md b/examples/2.0.x/client-android/kotlin/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..5d9e1e4a6 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/get-mfa-recovery-codes.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.getMFARecoveryCodes() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/get-prefs.md b/examples/2.0.x/client-android/kotlin/account/get-prefs.md new file mode 100644 index 000000000..8e963ca82 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/get-prefs.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.getPrefs() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/get-session.md b/examples/2.0.x/client-android/kotlin/account/get-session.md new file mode 100644 index 000000000..29bac94c2 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/get-session.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.getSession( + sessionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/get.md b/examples/2.0.x/client-android/kotlin/account/get.md new file mode 100644 index 000000000..e2dfe542a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/get.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.get() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/list-identities.md b/examples/2.0.x/client-android/kotlin/account/list-identities.md new file mode 100644 index 000000000..9037c0e68 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/list-identities.md @@ -0,0 +1,16 @@ +```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.listIdentities( + queries = listOf(), // (optional) + total = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/list-mfa-factors.md b/examples/2.0.x/client-android/kotlin/account/list-mfa-factors.md new file mode 100644 index 000000000..b12f25c86 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/list-mfa-factors.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.listMFAFactors() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/list-sessions.md b/examples/2.0.x/client-android/kotlin/account/list-sessions.md new file mode 100644 index 000000000..8c261a2d3 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/list-sessions.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.listSessions() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-email-verification.md b/examples/2.0.x/client-android/kotlin/account/update-email-verification.md new file mode 100644 index 000000000..cfc5d6714 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-email-verification.md @@ -0,0 +1,16 @@ +```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.updateEmailVerification( + userId = "", + secret = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-email.md b/examples/2.0.x/client-android/kotlin/account/update-email.md new file mode 100644 index 000000000..dc4bcbf3b --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-email.md @@ -0,0 +1,16 @@ +```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.updateEmail( + email = "email@example.com", + password = "password", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-magic-url-session.md b/examples/2.0.x/client-android/kotlin/account/update-magic-url-session.md new file mode 100644 index 000000000..d943ac6ad --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-magic-url-session.md @@ -0,0 +1,16 @@ +```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.updateMagicURLSession( + userId = "", + secret = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-mfa-authenticator.md b/examples/2.0.x/client-android/kotlin/account/update-mfa-authenticator.md new file mode 100644 index 000000000..9befabe94 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-mfa-authenticator.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val account = Account(client) + +val result = account.updateMFAAuthenticator( + type = AuthenticatorType.TOTP, + otp = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-mfa-challenge.md b/examples/2.0.x/client-android/kotlin/account/update-mfa-challenge.md new file mode 100644 index 000000000..6f2e99c0f --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-mfa-challenge.md @@ -0,0 +1,16 @@ +```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.updateMFAChallenge( + challengeId = "", + otp = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-mfa-recovery-codes.md b/examples/2.0.x/client-android/kotlin/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..dfdbd95d8 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-mfa-recovery-codes.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.updateMFARecoveryCodes() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-mfa.md b/examples/2.0.x/client-android/kotlin/account/update-mfa.md new file mode 100644 index 000000000..6acd1e701 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-mfa.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.updateMFA( + mfa = false, +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-name.md b/examples/2.0.x/client-android/kotlin/account/update-name.md new file mode 100644 index 000000000..ed40f240e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-name.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.updateName( + name = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-password.md b/examples/2.0.x/client-android/kotlin/account/update-password.md new file mode 100644 index 000000000..1ec378a1a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-password.md @@ -0,0 +1,16 @@ +```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.updatePassword( + password = "password", + oldPassword = "password", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-phone-session.md b/examples/2.0.x/client-android/kotlin/account/update-phone-session.md new file mode 100644 index 000000000..ea5f25b58 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-phone-session.md @@ -0,0 +1,16 @@ +```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.updatePhoneSession( + userId = "", + secret = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-phone-verification.md b/examples/2.0.x/client-android/kotlin/account/update-phone-verification.md new file mode 100644 index 000000000..c68d213aa --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-phone-verification.md @@ -0,0 +1,16 @@ +```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.updatePhoneVerification( + userId = "", + secret = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-phone.md b/examples/2.0.x/client-android/kotlin/account/update-phone.md new file mode 100644 index 000000000..b7e669b0b --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-phone.md @@ -0,0 +1,16 @@ +```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.updatePhone( + phone = "+12065550100", + password = "password", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-prefs.md b/examples/2.0.x/client-android/kotlin/account/update-prefs.md new file mode 100644 index 000000000..4444fb968 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-prefs.md @@ -0,0 +1,19 @@ +```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.updatePrefs( + prefs = mapOf( + "language" to "en", + "timezone" to "UTC", + "darkTheme" to true + ), +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-push-target.md b/examples/2.0.x/client-android/kotlin/account/update-push-target.md new file mode 100644 index 000000000..0e16e2fe7 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-push-target.md @@ -0,0 +1,16 @@ +```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.updatePushTarget( + targetId = "", + identifier = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-recovery.md b/examples/2.0.x/client-android/kotlin/account/update-recovery.md new file mode 100644 index 000000000..c18262570 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-recovery.md @@ -0,0 +1,17 @@ +```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.updateRecovery( + userId = "", + secret = "", + password = "password", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-session.md b/examples/2.0.x/client-android/kotlin/account/update-session.md new file mode 100644 index 000000000..b29ece551 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-session.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.updateSession( + sessionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-status.md b/examples/2.0.x/client-android/kotlin/account/update-status.md new file mode 100644 index 000000000..d22c9ce41 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-status.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.updateStatus() +``` diff --git a/examples/2.0.x/client-android/kotlin/account/update-verification.md b/examples/2.0.x/client-android/kotlin/account/update-verification.md new file mode 100644 index 000000000..1c4af79e8 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/account/update-verification.md @@ -0,0 +1,16 @@ +```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.updateVerification( + userId = "", + secret = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-browser.md b/examples/2.0.x/client-android/kotlin/avatars/get-browser.md new file mode 100644 index 000000000..7c32ad2d9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-browser.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.Browser + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getBrowser( + code = Browser.AVANT_BROWSER, + width = 0, // (optional) + height = 0, // (optional) + quality = -1, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-credit-card.md b/examples/2.0.x/client-android/kotlin/avatars/get-credit-card.md new file mode 100644 index 000000000..54244acc9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-credit-card.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.CreditCard + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getCreditCard( + code = CreditCard.AMERICAN_EXPRESS, + width = 0, // (optional) + height = 0, // (optional) + quality = -1, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-favicon.md b/examples/2.0.x/client-android/kotlin/avatars/get-favicon.md new file mode 100644 index 000000000..d55a0b424 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-favicon.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getFavicon( + url = "https://example.com", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-flag.md b/examples/2.0.x/client-android/kotlin/avatars/get-flag.md new file mode 100644 index 000000000..c03ccb3f9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-flag.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.Flag + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getFlag( + code = Flag.AFGHANISTAN, + width = 0, // (optional) + height = 0, // (optional) + quality = -1, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-image.md b/examples/2.0.x/client-android/kotlin/avatars/get-image.md new file mode 100644 index 000000000..4e22185de --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-image.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getImage( + url = "https://example.com", + width = 0, // (optional) + height = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-initials.md b/examples/2.0.x/client-android/kotlin/avatars/get-initials.md new file mode 100644 index 000000000..31b1f474d --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-initials.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getInitials( + name = "", // (optional) + width = 0, // (optional) + height = 0, // (optional) + background = "FFFFFF", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-photo.md b/examples/2.0.x/client-android/kotlin/avatars/get-photo.md new file mode 100644 index 000000000..d1127ba68 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-photo.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getPhoto( + width = 0, // (optional) + height = 0, // (optional) + quality = 0, // (optional) + output = "png", // (optional) + rating = "g", // (optional) + userId = "current()", // (optional) + emailHash = "", // (optional) + name = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-qr.md b/examples/2.0.x/client-android/kotlin/avatars/get-qr.md new file mode 100644 index 000000000..e962ef309 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-qr.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getQR( + text = "", + size = 1, // (optional) + margin = 0, // (optional) + download = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/avatars/get-screenshot.md b/examples/2.0.x/client-android/kotlin/avatars/get-screenshot.md new file mode 100644 index 000000000..1093c060f --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/avatars/get-screenshot.md @@ -0,0 +1,41 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.BrowserTheme +import io.appwrite.enums.Timezone +import io.appwrite.enums.BrowserPermission +import io.appwrite.enums.ImageFormat + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getScreenshot( + url = "https://example.com", + headers = mapOf( + "Authorization" to "Bearer token123", + "X-Custom-Header" to "value" + ), // (optional) + viewportWidth = 1920, // (optional) + viewportHeight = 1080, // (optional) + scale = 2, // (optional) + theme = BrowserTheme.LIGHT, // (optional) + userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // (optional) + fullpage = true, // (optional) + locale = "en-US", // (optional) + timezone = Timezone.AFRICA_ABIDJAN, // (optional) + latitude = 37.7749, // (optional) + longitude = -122.4194, // (optional) + accuracy = 100, // (optional) + touch = true, // (optional) + permissions = BrowserPermission.GEOLOCATION, // (optional) + sleep = 3, // (optional) + width = 800, // (optional) + height = 600, // (optional) + quality = 85, // (optional) + output = ImageFormat.JPG, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/create-document.md b/examples/2.0.x/client-android/kotlin/databases/create-document.md new file mode 100644 index 000000000..7105df5c1 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/create-document.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.createDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/create-operations.md b/examples/2.0.x/client-android/kotlin/databases/create-operations.md new file mode 100644 index 000000000..3bd7ae5d5 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/create-operations.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.createOperations( + transactionId = "", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "", + "collectionId" to "", + "documentId" to "", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/create-transaction.md b/examples/2.0.x/client-android/kotlin/databases/create-transaction.md new file mode 100644 index 000000000..59a3c12f6 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/create-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.createTransaction( + ttl = 60, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/decrement-document-attribute.md b/examples/2.0.x/client-android/kotlin/databases/decrement-document-attribute.md new file mode 100644 index 000000000..c32a60027 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.decrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 1, // (optional) + min = 0, // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/delete-document.md b/examples/2.0.x/client-android/kotlin/databases/delete-document.md new file mode 100644 index 000000000..c31bdb9fd --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/delete-document.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.deleteDocument( + databaseId = "", + collectionId = "", + documentId = "", + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/delete-transaction.md b/examples/2.0.x/client-android/kotlin/databases/delete-transaction.md new file mode 100644 index 000000000..101bd8cda --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/delete-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.deleteTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/get-document.md b/examples/2.0.x/client-android/kotlin/databases/get-document.md new file mode 100644 index 000000000..5c54be0ca --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/get-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.getDocument( + databaseId = "", + collectionId = "", + documentId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/get-transaction.md b/examples/2.0.x/client-android/kotlin/databases/get-transaction.md new file mode 100644 index 000000000..2f08ad611 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/get-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.getTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/increment-document-attribute.md b/examples/2.0.x/client-android/kotlin/databases/increment-document-attribute.md new file mode 100644 index 000000000..daaa6d6ae --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/increment-document-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.incrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 1, // (optional) + max = 100, // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/list-documents.md b/examples/2.0.x/client-android/kotlin/databases/list-documents.md new file mode 100644 index 000000000..b42b7dd8a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/list-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.listDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/list-transactions.md b/examples/2.0.x/client-android/kotlin/databases/list-transactions.md new file mode 100644 index 000000000..3cabd79f3 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/list-transactions.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.listTransactions( + queries = listOf(), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/update-document.md b/examples/2.0.x/client-android/kotlin/databases/update-document.md new file mode 100644 index 000000000..5c8a5e313 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/update-document.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.updateDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 33, + "isAdmin" to false + ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/update-transaction.md b/examples/2.0.x/client-android/kotlin/databases/update-transaction.md new file mode 100644 index 000000000..88360b276 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/update-transaction.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.updateTransaction( + transactionId = "", + commit = false, // (optional) + rollback = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/databases/upsert-document.md b/examples/2.0.x/client-android/kotlin/databases/upsert-document.md new file mode 100644 index 000000000..edecb8630 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/databases/upsert-document.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.upsertDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/create-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/create-document.md new file mode 100644 index 000000000..e2e493f86 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/create-document.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.createDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/create-documents.md b/examples/2.0.x/client-android/kotlin/documentsdb/create-documents.md new file mode 100644 index 000000000..2923c1007 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.createDocuments( + databaseId = "", + collectionId = "", + documents = listOf(), + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/create-operations.md b/examples/2.0.x/client-android/kotlin/documentsdb/create-operations.md new file mode 100644 index 000000000..c62580959 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/create-operations.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.createOperations( + transactionId = "", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "", + "collectionId" to "", + "documentId" to "", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/create-transaction.md b/examples/2.0.x/client-android/kotlin/documentsdb/create-transaction.md new file mode 100644 index 000000000..ad1f0b217 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.createTransaction( + ttl = 60, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-android/kotlin/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..fdb11fe06 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.decrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 1, // (optional) + min = 0, // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/delete-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/delete-document.md new file mode 100644 index 000000000..648a83ca4 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.deleteDocument( + databaseId = "", + collectionId = "", + documentId = "", + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/delete-transaction.md b/examples/2.0.x/client-android/kotlin/documentsdb/delete-transaction.md new file mode 100644 index 000000000..d991466f1 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.deleteTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/get-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/get-document.md new file mode 100644 index 000000000..1988e0028 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.getDocument( + databaseId = "", + collectionId = "", + documentId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/get-transaction.md b/examples/2.0.x/client-android/kotlin/documentsdb/get-transaction.md new file mode 100644 index 000000000..695412e77 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.getTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-android/kotlin/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..8286ad447 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.incrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 1, // (optional) + max = 100, // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/list-documents.md b/examples/2.0.x/client-android/kotlin/documentsdb/list-documents.md new file mode 100644 index 000000000..a8c1b66b7 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.listDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/list-transactions.md b/examples/2.0.x/client-android/kotlin/documentsdb/list-transactions.md new file mode 100644 index 000000000..46571468e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.listTransactions( + queries = listOf(), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/update-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/update-document.md new file mode 100644 index 000000000..69668863d --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/update-document.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.updateDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/update-transaction.md b/examples/2.0.x/client-android/kotlin/documentsdb/update-transaction.md new file mode 100644 index 000000000..78fb3e7b9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.updateTransaction( + transactionId = "", + commit = false, // (optional) + rollback = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/documentsdb/upsert-document.md b/examples/2.0.x/client-android/kotlin/documentsdb/upsert-document.md new file mode 100644 index 000000000..defc50a20 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/documentsdb/upsert-document.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val documentsDB = DocumentsDB(client) + +val result = documentsDB.upsertDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/functions/create-execution.md b/examples/2.0.x/client-android/kotlin/functions/create-execution.md new file mode 100644 index 000000000..13654e65e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/functions/create-execution.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.ExecutionMethod + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val functions = Functions(client) + +val result = functions.createExecution( + functionId = "", + body = "", // (optional) + async = false, // (optional) + path = "", // (optional) + method = ExecutionMethod.GET, // (optional) + headers = mapOf( "a" to "b" ), // (optional) + scheduledAt = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/functions/get-execution.md b/examples/2.0.x/client-android/kotlin/functions/get-execution.md new file mode 100644 index 000000000..c092909e9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/functions/get-execution.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val functions = Functions(client) + +val result = functions.getExecution( + functionId = "", + executionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/functions/list-executions.md b/examples/2.0.x/client-android/kotlin/functions/list-executions.md new file mode 100644 index 000000000..5fb16f85a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/functions/list-executions.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val functions = Functions(client) + +val result = functions.listExecutions( + functionId = "", + queries = listOf(), // (optional) + total = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/graphql/mutation.md b/examples/2.0.x/client-android/kotlin/graphql/mutation.md new file mode 100644 index 000000000..0cdb78e6d --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/graphql/mutation.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Graphql + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val graphql = Graphql(client) + +val result = graphql.mutation( + query = mapOf( "a" to "b" ), +) +``` diff --git a/examples/2.0.x/client-android/kotlin/graphql/query.md b/examples/2.0.x/client-android/kotlin/graphql/query.md new file mode 100644 index 000000000..3359822a5 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/graphql/query.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Graphql + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val graphql = Graphql(client) + +val result = graphql.query( + query = mapOf( "a" to "b" ), +) +``` diff --git a/examples/2.0.x/client-android/kotlin/locale/get.md b/examples/2.0.x/client-android/kotlin/locale/get.md new file mode 100644 index 000000000..151971612 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/locale/get.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val locale = Locale(client) + +val result = locale.get() +``` diff --git a/examples/2.0.x/client-android/kotlin/locale/list-codes.md b/examples/2.0.x/client-android/kotlin/locale/list-codes.md new file mode 100644 index 000000000..d70521444 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/locale/list-codes.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val locale = Locale(client) + +val result = locale.listCodes() +``` diff --git a/examples/2.0.x/client-android/kotlin/locale/list-continents.md b/examples/2.0.x/client-android/kotlin/locale/list-continents.md new file mode 100644 index 000000000..03e917e43 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/locale/list-continents.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val locale = Locale(client) + +val result = locale.listContinents() +``` diff --git a/examples/2.0.x/client-android/kotlin/locale/list-countries-eu.md b/examples/2.0.x/client-android/kotlin/locale/list-countries-eu.md new file mode 100644 index 000000000..a933ed85b --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/locale/list-countries-eu.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val locale = Locale(client) + +val result = locale.listCountriesEU() +``` diff --git a/examples/2.0.x/client-android/kotlin/locale/list-countries-phones.md b/examples/2.0.x/client-android/kotlin/locale/list-countries-phones.md new file mode 100644 index 000000000..8d4c7534e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/locale/list-countries-phones.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val locale = Locale(client) + +val result = locale.listCountriesPhones() +``` diff --git a/examples/2.0.x/client-android/kotlin/locale/list-countries.md b/examples/2.0.x/client-android/kotlin/locale/list-countries.md new file mode 100644 index 000000000..e67b5fe7c --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/locale/list-countries.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val locale = Locale(client) + +val result = locale.listCountries() +``` diff --git a/examples/2.0.x/client-android/kotlin/locale/list-currencies.md b/examples/2.0.x/client-android/kotlin/locale/list-currencies.md new file mode 100644 index 000000000..fb0087d7c --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/locale/list-currencies.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val locale = Locale(client) + +val result = locale.listCurrencies() +``` diff --git a/examples/2.0.x/client-android/kotlin/locale/list-languages.md b/examples/2.0.x/client-android/kotlin/locale/list-languages.md new file mode 100644 index 000000000..30fb65bf0 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/locale/list-languages.md @@ -0,0 +1,13 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val locale = Locale(client) + +val result = locale.listLanguages() +``` diff --git a/examples/2.0.x/client-android/kotlin/messaging/create-subscriber.md b/examples/2.0.x/client-android/kotlin/messaging/create-subscriber.md new file mode 100644 index 000000000..09c28349f --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/messaging/create-subscriber.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val messaging = Messaging(client) + +val result = messaging.createSubscriber( + topicId = "", + subscriberId = "", + targetId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/messaging/delete-subscriber.md b/examples/2.0.x/client-android/kotlin/messaging/delete-subscriber.md new file mode 100644 index 000000000..7247e1290 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/messaging/delete-subscriber.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val messaging = Messaging(client) + +val result = messaging.deleteSubscriber( + topicId = "", + subscriberId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/presences/delete.md b/examples/2.0.x/client-android/kotlin/presences/delete.md new file mode 100644 index 000000000..d74aae005 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/presences/delete.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val presences = Presences(client) + +val result = presences.delete( + presenceId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/presences/get.md b/examples/2.0.x/client-android/kotlin/presences/get.md new file mode 100644 index 000000000..c12a51821 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/presences/get.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val presences = Presences(client) + +val result = presences.get( + presenceId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/presences/list.md b/examples/2.0.x/client-android/kotlin/presences/list.md new file mode 100644 index 000000000..6496a3e26 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/presences/list.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val presences = Presences(client) + +val result = presences.list( + queries = listOf(), // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/presences/update.md b/examples/2.0.x/client-android/kotlin/presences/update.md new file mode 100644 index 000000000..c6626913a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/presences/update.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val presences = Presences(client) + +val result = presences.update( + presenceId = "", + status = "", // (optional) + expiresAt = "2020-10-15T06:38:00.000+00:00", // (optional) + metadata = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + purge = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/presences/upsert.md b/examples/2.0.x/client-android/kotlin/presences/upsert.md new file mode 100644 index 000000000..d868a1dd0 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/presences/upsert.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val presences = Presences(client) + +val result = presences.upsert( + presenceId = "", + status = "", + permissions = listOf(Permission.read(Role.any())), // (optional) + expiresAt = "2020-10-15T06:38:00.000+00:00", // (optional) + metadata = mapOf( "a" to "b" ), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/create-file.md b/examples/2.0.x/client-android/kotlin/storage/create-file.md new file mode 100644 index 000000000..0e095d2d9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/storage/create-file.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Storage +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val storage = Storage(client) + +val result = storage.createFile( + bucketId = "", + fileId = "", + file = InputFile.fromPath("file.png"), + permissions = listOf(Permission.read(Role.any())), // (optional) + folder = "photos/2026", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/delete-file.md b/examples/2.0.x/client-android/kotlin/storage/delete-file.md new file mode 100644 index 000000000..831ea2b2c --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/storage/delete-file.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val storage = Storage(client) + +val result = storage.deleteFile( + bucketId = "", + fileId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/get-file-download.md b/examples/2.0.x/client-android/kotlin/storage/get-file-download.md new file mode 100644 index 000000000..d60b5fa4a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/storage/get-file-download.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val storage = Storage(client) + +val result = storage.getFileDownload( + bucketId = "", + fileId = "", + token = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/get-file-preview.md b/examples/2.0.x/client-android/kotlin/storage/get-file-preview.md new file mode 100644 index 000000000..aa83fe6e8 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/storage/get-file-preview.md @@ -0,0 +1,30 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage +import io.appwrite.enums.ImageGravity +import io.appwrite.enums.ImageFormat + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val storage = Storage(client) + +val result = storage.getFilePreview( + bucketId = "", + fileId = "", + width = 0, // (optional) + height = 0, // (optional) + gravity = ImageGravity.CENTER, // (optional) + quality = -1, // (optional) + borderWidth = 0, // (optional) + borderColor = "FFFFFF", // (optional) + borderRadius = 0, // (optional) + opacity = 0, // (optional) + rotation = -360, // (optional) + background = "FFFFFF", // (optional) + output = ImageFormat.JPG, // (optional) + token = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/get-file-view.md b/examples/2.0.x/client-android/kotlin/storage/get-file-view.md new file mode 100644 index 000000000..6e6e77f46 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/storage/get-file-view.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val storage = Storage(client) + +val result = storage.getFileView( + bucketId = "", + fileId = "", + token = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/get-file.md b/examples/2.0.x/client-android/kotlin/storage/get-file.md new file mode 100644 index 000000000..ac456abf5 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/storage/get-file.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val storage = Storage(client) + +val result = storage.getFile( + bucketId = "", + fileId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/list-files.md b/examples/2.0.x/client-android/kotlin/storage/list-files.md new file mode 100644 index 000000000..7ad2ebeee --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/storage/list-files.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val storage = Storage(client) + +val result = storage.listFiles( + bucketId = "", + queries = listOf(), // (optional) + search = "", // (optional) + total = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/storage/update-file.md b/examples/2.0.x/client-android/kotlin/storage/update-file.md new file mode 100644 index 000000000..532c815b8 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/storage/update-file.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val storage = Storage(client) + +val result = storage.updateFile( + bucketId = "", + fileId = "", + name = "", // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/create-operations.md b/examples/2.0.x/client-android/kotlin/tablesdb/create-operations.md new file mode 100644 index 000000000..93c32c54a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/create-operations.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.createOperations( + transactionId = "", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "", + "tableId" to "", + "rowId" to "", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/create-row.md b/examples/2.0.x/client-android/kotlin/tablesdb/create-row.md new file mode 100644 index 000000000..e6e75051f --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/create-row.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.createRow( + databaseId = "", + tableId = "", + rowId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/create-transaction.md b/examples/2.0.x/client-android/kotlin/tablesdb/create-transaction.md new file mode 100644 index 000000000..dcf640c38 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/create-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.createTransaction( + ttl = 60, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/decrement-row-column.md b/examples/2.0.x/client-android/kotlin/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..157c3d118 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/decrement-row-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.decrementRowColumn( + databaseId = "", + tableId = "", + rowId = "", + column = "", + value = 1, // (optional) + min = 0, // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/delete-row.md b/examples/2.0.x/client-android/kotlin/tablesdb/delete-row.md new file mode 100644 index 000000000..976a7f88f --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/delete-row.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.deleteRow( + databaseId = "", + tableId = "", + rowId = "", + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/delete-transaction.md b/examples/2.0.x/client-android/kotlin/tablesdb/delete-transaction.md new file mode 100644 index 000000000..d3237744f --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/delete-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.deleteTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/get-row.md b/examples/2.0.x/client-android/kotlin/tablesdb/get-row.md new file mode 100644 index 000000000..e40856a3c --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/get-row.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.getRow( + databaseId = "", + tableId = "", + rowId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/get-transaction.md b/examples/2.0.x/client-android/kotlin/tablesdb/get-transaction.md new file mode 100644 index 000000000..fd0e5ee61 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/get-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.getTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/increment-row-column.md b/examples/2.0.x/client-android/kotlin/tablesdb/increment-row-column.md new file mode 100644 index 000000000..802c6a2b1 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/increment-row-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.incrementRowColumn( + databaseId = "", + tableId = "", + rowId = "", + column = "", + value = 1, // (optional) + max = 100, // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/list-rows.md b/examples/2.0.x/client-android/kotlin/tablesdb/list-rows.md new file mode 100644 index 000000000..a428290a9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/list-rows.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.listRows( + databaseId = "", + tableId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/list-transactions.md b/examples/2.0.x/client-android/kotlin/tablesdb/list-transactions.md new file mode 100644 index 000000000..03c9d5b4a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/list-transactions.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.listTransactions( + queries = listOf(), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/update-row.md b/examples/2.0.x/client-android/kotlin/tablesdb/update-row.md new file mode 100644 index 000000000..fcba331bc --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/update-row.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.updateRow( + databaseId = "", + tableId = "", + rowId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 33, + "isAdmin" to false + ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/update-transaction.md b/examples/2.0.x/client-android/kotlin/tablesdb/update-transaction.md new file mode 100644 index 000000000..4843e5b72 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/update-transaction.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.updateTransaction( + transactionId = "", + commit = false, // (optional) + rollback = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/tablesdb/upsert-row.md b/examples/2.0.x/client-android/kotlin/tablesdb/upsert-row.md new file mode 100644 index 000000000..d0b52793b --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/tablesdb/upsert-row.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.upsertRow( + databaseId = "", + tableId = "", + rowId = "", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 33, + "isAdmin" to false + ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/create-membership.md b/examples/2.0.x/client-android/kotlin/teams/create-membership.md new file mode 100644 index 000000000..e5289e645 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/create-membership.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.createMembership( + teamId = "", + roles = listOf(), + email = "email@example.com", // (optional) + userId = "", // (optional) + phone = "+12065550100", // (optional) + url = "https://example.com", // (optional) + name = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/create.md b/examples/2.0.x/client-android/kotlin/teams/create.md new file mode 100644 index 000000000..7b4bfcbc5 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/create.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.create( + teamId = "", + name = "", + roles = listOf(), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/delete-membership.md b/examples/2.0.x/client-android/kotlin/teams/delete-membership.md new file mode 100644 index 000000000..4c1cebeab --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/delete-membership.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.deleteMembership( + teamId = "", + membershipId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/delete.md b/examples/2.0.x/client-android/kotlin/teams/delete.md new file mode 100644 index 000000000..03f319f87 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/delete.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.delete( + teamId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/get-membership.md b/examples/2.0.x/client-android/kotlin/teams/get-membership.md new file mode 100644 index 000000000..cc85d6fb5 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/get-membership.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.getMembership( + teamId = "", + membershipId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/get-prefs.md b/examples/2.0.x/client-android/kotlin/teams/get-prefs.md new file mode 100644 index 000000000..3fa7fb3f3 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/get-prefs.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.getPrefs( + teamId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/get.md b/examples/2.0.x/client-android/kotlin/teams/get.md new file mode 100644 index 000000000..a01167ca1 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/get.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.get( + teamId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/list-memberships.md b/examples/2.0.x/client-android/kotlin/teams/list-memberships.md new file mode 100644 index 000000000..438194247 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/list-memberships.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.listMemberships( + teamId = "", + queries = listOf(), // (optional) + search = "", // (optional) + total = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/list.md b/examples/2.0.x/client-android/kotlin/teams/list.md new file mode 100644 index 000000000..d38ba4743 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/list.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.list( + queries = listOf(), // (optional) + search = "", // (optional) + total = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/update-membership-status.md b/examples/2.0.x/client-android/kotlin/teams/update-membership-status.md new file mode 100644 index 000000000..cc4fb2fb6 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/update-membership-status.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.updateMembershipStatus( + teamId = "", + membershipId = "", + userId = "", + secret = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/update-membership.md b/examples/2.0.x/client-android/kotlin/teams/update-membership.md new file mode 100644 index 000000000..6e721d4ec --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/update-membership.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.updateMembership( + teamId = "", + membershipId = "", + roles = listOf(), +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/update-name.md b/examples/2.0.x/client-android/kotlin/teams/update-name.md new file mode 100644 index 000000000..0248d2468 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/update-name.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.updateName( + teamId = "", + name = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/teams/update-prefs.md b/examples/2.0.x/client-android/kotlin/teams/update-prefs.md new file mode 100644 index 000000000..fd6e44eb8 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/teams/update-prefs.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val teams = Teams(client) + +val result = teams.updatePrefs( + teamId = "", + prefs = mapOf( "a" to "b" ), +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/create-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/create-document.md new file mode 100644 index 000000000..960654faa --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/create-document.md @@ -0,0 +1,27 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.createDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( + "embeddings" to listOf(0.12, -0.55, 0.88, 1.02), + "metadata" to mapOf( + "key" to "value" + ) + ), + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/create-operations.md b/examples/2.0.x/client-android/kotlin/vectorsdb/create-operations.md new file mode 100644 index 000000000..1a2908af9 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/create-operations.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.createOperations( + transactionId = "", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "", + "collectionId" to "", + "documentId" to "", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/create-query.md b/examples/2.0.x/client-android/kotlin/vectorsdb/create-query.md new file mode 100644 index 000000000..0e8aaf25e --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.createQuery( + databaseId = "", + collectionId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/create-transaction.md b/examples/2.0.x/client-android/kotlin/vectorsdb/create-transaction.md new file mode 100644 index 000000000..9ca3de5ce --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.createTransaction( + ttl = 60, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/delete-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/delete-document.md new file mode 100644 index 000000000..9cc1856f2 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.deleteDocument( + databaseId = "", + collectionId = "", + documentId = "", + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/delete-transaction.md b/examples/2.0.x/client-android/kotlin/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..e97ab53a8 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.deleteTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/get-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/get-document.md new file mode 100644 index 000000000..22584ab1a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.getDocument( + databaseId = "", + collectionId = "", + documentId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/get-transaction.md b/examples/2.0.x/client-android/kotlin/vectorsdb/get-transaction.md new file mode 100644 index 000000000..2a510ea86 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.getTransaction( + transactionId = "", +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/list-documents.md b/examples/2.0.x/client-android/kotlin/vectorsdb/list-documents.md new file mode 100644 index 000000000..90a7f04a3 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.listDocuments( + databaseId = "", + collectionId = "", + queries = listOf(), // (optional) + transactionId = "", // (optional) + total = false, // (optional) + ttl = 0, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/list-transactions.md b/examples/2.0.x/client-android/kotlin/vectorsdb/list-transactions.md new file mode 100644 index 000000000..97981c01a --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.listTransactions( + queries = listOf(), // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/update-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/update-document.md new file mode 100644 index 000000000..13422596c --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/update-document.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.updateDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/update-transaction.md b/examples/2.0.x/client-android/kotlin/vectorsdb/update-transaction.md new file mode 100644 index 000000000..c49da3486 --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.updateTransaction( + transactionId = "", + commit = false, // (optional) + rollback = false, // (optional) +) +``` diff --git a/examples/2.0.x/client-android/kotlin/vectorsdb/upsert-document.md b/examples/2.0.x/client-android/kotlin/vectorsdb/upsert-document.md new file mode 100644 index 000000000..111b61c6b --- /dev/null +++ b/examples/2.0.x/client-android/kotlin/vectorsdb/upsert-document.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val vectorsDB = VectorsDB(client) + +val result = vectorsDB.upsertDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf(Permission.read(Role.any())), // (optional) + transactionId = "", // (optional) +) +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-anonymous-session.md b/examples/2.0.x/client-apple/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..eeeb552a1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-anonymous-session.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let session = try await account.createAnonymousSession() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-email-password-session.md b/examples/2.0.x/client-apple/examples/account/create-email-password-session.md new file mode 100644 index 000000000..7233b7399 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-email-password-session.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let session = try await account.createEmailPasswordSession( + email: "email@example.com", + password: "password" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-email-token.md b/examples/2.0.x/client-apple/examples/account/create-email-token.md new file mode 100644 index 000000000..eb21e9bc0 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-email-token.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.createEmailToken( + userId: "", + email: "email@example.com", + phrase: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-email-verification.md b/examples/2.0.x/client-apple/examples/account/create-email-verification.md new file mode 100644 index 000000000..841ddd68d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-email-verification.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.createEmailVerification( + url: "https://example.com" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-jwt.md b/examples/2.0.x/client-apple/examples/account/create-jwt.md new file mode 100644 index 000000000..96c867f7f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-jwt.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let jwt = try await account.createJWT( + duration: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-magic-url-token.md b/examples/2.0.x/client-apple/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..dd60fa939 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-magic-url-token.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.createMagicURLToken( + userId: "", + email: "email@example.com", + url: "https://example.com", // optional + phrase: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-mfa-authenticator.md b/examples/2.0.x/client-apple/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..b42fc7fdc --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-mfa-authenticator.md @@ -0,0 +1,15 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let mfaType = try await account.createMFAAuthenticator( + type: .totp +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-mfa-challenge.md b/examples/2.0.x/client-apple/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..dfb50487e --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-mfa-challenge.md @@ -0,0 +1,15 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let mfaChallenge = try await account.createMFAChallenge( + factor: .email +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/client-apple/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..fb1b22de7 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let mfaRecoveryCodes = try await account.createMFARecoveryCodes() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-apple/examples/account/create-o-auth-2-session.md new file mode 100644 index 000000000..3552fda80 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-o-auth-2-session.md @@ -0,0 +1,18 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let success = try await account.createOAuth2Session( + provider: .amazon, + success: "https://example.com", // optional + failure: "https://example.com", // optional + scopes: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-apple/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..1a22fb32c --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-o-auth-2-token.md @@ -0,0 +1,18 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let success = try await account.createOAuth2Token( + provider: .amazon, + success: "https://example.com", // optional + failure: "https://example.com", // optional + scopes: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-phone-token.md b/examples/2.0.x/client-apple/examples/account/create-phone-token.md new file mode 100644 index 000000000..bdf53c43b --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-phone-token.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.createPhoneToken( + userId: "", + phone: "+12065550100" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-phone-verification.md b/examples/2.0.x/client-apple/examples/account/create-phone-verification.md new file mode 100644 index 000000000..1259af838 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-phone-verification.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.createPhoneVerification() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-push-target.md b/examples/2.0.x/client-apple/examples/account/create-push-target.md new file mode 100644 index 000000000..2507d9660 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-push-target.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let target = try await account.createPushTarget( + targetId: "", + identifier: "", + providerId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-recovery.md b/examples/2.0.x/client-apple/examples/account/create-recovery.md new file mode 100644 index 000000000..3d2e2d1b4 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-recovery.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.createRecovery( + email: "email@example.com", + url: "https://example.com" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-session.md b/examples/2.0.x/client-apple/examples/account/create-session.md new file mode 100644 index 000000000..1cec5939d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-session.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let session = try await account.createSession( + userId: "", + secret: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create-verification.md b/examples/2.0.x/client-apple/examples/account/create-verification.md new file mode 100644 index 000000000..054d7657c --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create-verification.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.createVerification( + url: "https://example.com" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/create.md b/examples/2.0.x/client-apple/examples/account/create.md new file mode 100644 index 000000000..7bebdefce --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/create.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.create( + userId: "", + email: "email@example.com", + password: "password", + name: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/delete-identity.md b/examples/2.0.x/client-apple/examples/account/delete-identity.md new file mode 100644 index 000000000..0e63ea0cf --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/delete-identity.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let result = try await account.deleteIdentity( + identityId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/client-apple/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..e8ef91a81 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let result = try await account.deleteMFAAuthenticator( + type: .totp +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/delete-push-target.md b/examples/2.0.x/client-apple/examples/account/delete-push-target.md new file mode 100644 index 000000000..cf613b553 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/delete-push-target.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let result = try await account.deletePushTarget( + targetId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/delete-session.md b/examples/2.0.x/client-apple/examples/account/delete-session.md new file mode 100644 index 000000000..79e0aa2c6 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/delete-session.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let result = try await account.deleteSession( + sessionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/delete-sessions.md b/examples/2.0.x/client-apple/examples/account/delete-sessions.md new file mode 100644 index 000000000..7e524f2d6 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/delete-sessions.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let result = try await account.deleteSessions() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/client-apple/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..31e9e5b88 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let mfaRecoveryCodes = try await account.getMFARecoveryCodes() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/get-prefs.md b/examples/2.0.x/client-apple/examples/account/get-prefs.md new file mode 100644 index 000000000..0235e0d8d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/get-prefs.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let preferences = try await account.getPrefs() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/get-session.md b/examples/2.0.x/client-apple/examples/account/get-session.md new file mode 100644 index 000000000..8c22074a6 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/get-session.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let session = try await account.getSession( + sessionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/get.md b/examples/2.0.x/client-apple/examples/account/get.md new file mode 100644 index 000000000..3ddbca44d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/get.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.get() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/list-identities.md b/examples/2.0.x/client-apple/examples/account/list-identities.md new file mode 100644 index 000000000..eb5874c59 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/list-identities.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let identityList = try await account.listIdentities( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/list-mfa-factors.md b/examples/2.0.x/client-apple/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..534ccbe2b --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/list-mfa-factors.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let mfaFactors = try await account.listMFAFactors() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/list-sessions.md b/examples/2.0.x/client-apple/examples/account/list-sessions.md new file mode 100644 index 000000000..2932881f0 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/list-sessions.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let sessionList = try await account.listSessions() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-email-verification.md b/examples/2.0.x/client-apple/examples/account/update-email-verification.md new file mode 100644 index 000000000..823cc4128 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-email-verification.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.updateEmailVerification( + userId: "", + secret: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-email.md b/examples/2.0.x/client-apple/examples/account/update-email.md new file mode 100644 index 000000000..f13a4d5f1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-email.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.updateEmail( + email: "email@example.com", + password: "password" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-magic-url-session.md b/examples/2.0.x/client-apple/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..c55827099 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-magic-url-session.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let session = try await account.updateMagicURLSession( + userId: "", + secret: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-mfa-authenticator.md b/examples/2.0.x/client-apple/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..75c37f229 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-mfa-authenticator.md @@ -0,0 +1,16 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.updateMFAAuthenticator( + type: .totp, + otp: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-mfa-challenge.md b/examples/2.0.x/client-apple/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..6bc6e47ab --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-mfa-challenge.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let session = try await account.updateMFAChallenge( + challengeId: "", + otp: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/client-apple/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..5445ab215 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let mfaRecoveryCodes = try await account.updateMFARecoveryCodes() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-mfa.md b/examples/2.0.x/client-apple/examples/account/update-mfa.md new file mode 100644 index 000000000..9a509efa9 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-mfa.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.updateMFA( + mfa: false +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-name.md b/examples/2.0.x/client-apple/examples/account/update-name.md new file mode 100644 index 000000000..72d0b7a26 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-name.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.updateName( + name: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-password.md b/examples/2.0.x/client-apple/examples/account/update-password.md new file mode 100644 index 000000000..fe1479efd --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-password.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.updatePassword( + password: "password", + oldPassword: "password" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-phone-session.md b/examples/2.0.x/client-apple/examples/account/update-phone-session.md new file mode 100644 index 000000000..bc3ae963d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-phone-session.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let session = try await account.updatePhoneSession( + userId: "", + secret: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-phone-verification.md b/examples/2.0.x/client-apple/examples/account/update-phone-verification.md new file mode 100644 index 000000000..11f7f91ac --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-phone-verification.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.updatePhoneVerification( + userId: "", + secret: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-phone.md b/examples/2.0.x/client-apple/examples/account/update-phone.md new file mode 100644 index 000000000..098bb06b3 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-phone.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.updatePhone( + phone: "+12065550100", + password: "password" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-prefs.md b/examples/2.0.x/client-apple/examples/account/update-prefs.md new file mode 100644 index 000000000..43ebb2461 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-prefs.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.updatePrefs( + prefs: [ + "language": "en", + "timezone": "UTC", + "darkTheme": true + ] +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-push-target.md b/examples/2.0.x/client-apple/examples/account/update-push-target.md new file mode 100644 index 000000000..7b4ce8bd9 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-push-target.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let target = try await account.updatePushTarget( + targetId: "", + identifier: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-recovery.md b/examples/2.0.x/client-apple/examples/account/update-recovery.md new file mode 100644 index 000000000..f785d8f63 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-recovery.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.updateRecovery( + userId: "", + secret: "", + password: "password" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-session.md b/examples/2.0.x/client-apple/examples/account/update-session.md new file mode 100644 index 000000000..2e9849b47 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-session.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let session = try await account.updateSession( + sessionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-status.md b/examples/2.0.x/client-apple/examples/account/update-status.md new file mode 100644 index 000000000..a6198d68f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-status.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let user = try await account.updateStatus() + +``` diff --git a/examples/2.0.x/client-apple/examples/account/update-verification.md b/examples/2.0.x/client-apple/examples/account/update-verification.md new file mode 100644 index 000000000..d4a251c5a --- /dev/null +++ b/examples/2.0.x/client-apple/examples/account/update-verification.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let account = Account(client) + +let token = try await account.updateVerification( + userId: "", + secret: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-browser.md b/examples/2.0.x/client-apple/examples/avatars/get-browser.md new file mode 100644 index 000000000..9825d8804 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-browser.md @@ -0,0 +1,18 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getBrowser( + code: .avantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-credit-card.md b/examples/2.0.x/client-apple/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..a294929a6 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-credit-card.md @@ -0,0 +1,18 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getCreditCard( + code: .americanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-favicon.md b/examples/2.0.x/client-apple/examples/avatars/get-favicon.md new file mode 100644 index 000000000..0d5435214 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-favicon.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getFavicon( + url: "https://example.com" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-flag.md b/examples/2.0.x/client-apple/examples/avatars/get-flag.md new file mode 100644 index 000000000..ae4586067 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-flag.md @@ -0,0 +1,18 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getFlag( + code: .afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-image.md b/examples/2.0.x/client-apple/examples/avatars/get-image.md new file mode 100644 index 000000000..0cbc666ae --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-image.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getImage( + url: "https://example.com", + width: 0, // optional + height: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-initials.md b/examples/2.0.x/client-apple/examples/avatars/get-initials.md new file mode 100644 index 000000000..44fca8f30 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-initials.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getInitials( + name: "", // optional + width: 0, // optional + height: 0, // optional + background: "FFFFFF" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-photo.md b/examples/2.0.x/client-apple/examples/avatars/get-photo.md new file mode 100644 index 000000000..d5a198275 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-photo.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: "png", // optional + rating: "g", // optional + userId: "current()", // optional + emailHash: "", // optional + name: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-qr.md b/examples/2.0.x/client-apple/examples/avatars/get-qr.md new file mode 100644 index 000000000..86a43fba1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-qr.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getQR( + text: "", + size: 1, // optional + margin: 0, // optional + download: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/avatars/get-screenshot.md b/examples/2.0.x/client-apple/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..7711677f4 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/avatars/get-screenshot.md @@ -0,0 +1,37 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getScreenshot( + url: "https://example.com", + headers: [ + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + ], // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: .dark, // optional + userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // optional + fullpage: true, // optional + locale: "en-US", // optional + timezone: .africaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [.geolocation, .notifications], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: .jpeg // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/create-document.md b/examples/2.0.x/client-apple/examples/databases/create-document.md new file mode 100644 index 000000000..973bb324e --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/create-document.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let document = try await databases.createDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/create-operations.md b/examples/2.0.x/client-apple/examples/databases/create-operations.md new file mode 100644 index 000000000..c9d59976f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/create-operations.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let transaction = try await databases.createOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/create-transaction.md b/examples/2.0.x/client-apple/examples/databases/create-transaction.md new file mode 100644 index 000000000..29bb609ec --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/create-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let transaction = try await databases.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/decrement-document-attribute.md b/examples/2.0.x/client-apple/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..8f7746ed2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/decrement-document-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let document = try await databases.decrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + min: 0, // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/delete-document.md b/examples/2.0.x/client-apple/examples/databases/delete-document.md new file mode 100644 index 000000000..6cd36430b --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/delete-document.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let result = try await databases.deleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/delete-transaction.md b/examples/2.0.x/client-apple/examples/databases/delete-transaction.md new file mode 100644 index 000000000..4a3a7e29e --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/delete-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let result = try await databases.deleteTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/get-document.md b/examples/2.0.x/client-apple/examples/databases/get-document.md new file mode 100644 index 000000000..c7cc142a6 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/get-document.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let document = try await databases.getDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/get-transaction.md b/examples/2.0.x/client-apple/examples/databases/get-transaction.md new file mode 100644 index 000000000..9e2c76c59 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/get-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let transaction = try await databases.getTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/increment-document-attribute.md b/examples/2.0.x/client-apple/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..3bd247486 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/increment-document-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let document = try await databases.incrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + max: 100, // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/list-documents.md b/examples/2.0.x/client-apple/examples/databases/list-documents.md new file mode 100644 index 000000000..801424eaf --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/list-documents.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let documentList = try await databases.listDocuments( + databaseId: "", + collectionId: "", + queries: [], // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/list-transactions.md b/examples/2.0.x/client-apple/examples/databases/list-transactions.md new file mode 100644 index 000000000..15c823f51 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/list-transactions.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let transactionList = try await databases.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/update-document.md b/examples/2.0.x/client-apple/examples/databases/update-document.md new file mode 100644 index 000000000..0963c234a --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/update-document.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let document = try await databases.updateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + ], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/update-transaction.md b/examples/2.0.x/client-apple/examples/databases/update-transaction.md new file mode 100644 index 000000000..e4e0eb62a --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/update-transaction.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let transaction = try await databases.updateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/databases/upsert-document.md b/examples/2.0.x/client-apple/examples/databases/upsert-document.md new file mode 100644 index 000000000..9e8aea690 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/databases/upsert-document.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let document = try await databases.upsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/create-document.md b/examples/2.0.x/client-apple/examples/documentsdb/create-document.md new file mode 100644 index 000000000..a0d6a69bc --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/create-document.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.createDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/create-documents.md b/examples/2.0.x/client-apple/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..c170200b7 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/create-documents.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.createDocuments( + databaseId: "", + collectionId: "", + documents: [], + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/create-operations.md b/examples/2.0.x/client-apple/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..c1bc948d3 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.createOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-apple/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..88030b7de --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/create-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-apple/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..11d2ed3e1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.decrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + min: 0, // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/delete-document.md b/examples/2.0.x/client-apple/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..10eef1736 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/delete-document.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.deleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-apple/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..ca1c9bb19 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/delete-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.deleteTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/get-document.md b/examples/2.0.x/client-apple/examples/documentsdb/get-document.md new file mode 100644 index 000000000..504bbf1cc --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/get-document.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.getDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-apple/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..4435dce02 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/get-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.getTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-apple/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..41648951d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.incrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, // optional + max: 100, // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/list-documents.md b/examples/2.0.x/client-apple/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..81768bc19 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/list-documents.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.listDocuments( + databaseId: "", + collectionId: "", + queries: [], // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-apple/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..0fe1ca767 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/list-transactions.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transactionList = try await documentsDB.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/update-document.md b/examples/2.0.x/client-apple/examples/documentsdb/update-document.md new file mode 100644 index 000000000..250ecd700 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/update-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.updateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-apple/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..1ea869b7c --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/update-transaction.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.updateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-apple/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..cede61c6d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/documentsdb/upsert-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.upsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/functions/create-execution.md b/examples/2.0.x/client-apple/examples/functions/create-execution.md new file mode 100644 index 000000000..9597fd9d3 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/functions/create-execution.md @@ -0,0 +1,21 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let functions = Functions(client) + +let execution = try await functions.createExecution( + functionId: "", + body: "", // optional + async: false, // optional + path: "", // optional + method: .gET, // optional + headers: [:], // optional + scheduledAt: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/functions/get-execution.md b/examples/2.0.x/client-apple/examples/functions/get-execution.md new file mode 100644 index 000000000..fbd787f4c --- /dev/null +++ b/examples/2.0.x/client-apple/examples/functions/get-execution.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let functions = Functions(client) + +let execution = try await functions.getExecution( + functionId: "", + executionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/functions/list-executions.md b/examples/2.0.x/client-apple/examples/functions/list-executions.md new file mode 100644 index 000000000..e0204619f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/functions/list-executions.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let functions = Functions(client) + +let executionList = try await functions.listExecutions( + functionId: "", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/graphql/mutation.md b/examples/2.0.x/client-apple/examples/graphql/mutation.md new file mode 100644 index 000000000..86894fea9 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/graphql/mutation.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let graphql = Graphql(client) + +let any = try await graphql.mutation( + query: [:] +) + +``` diff --git a/examples/2.0.x/client-apple/examples/graphql/query.md b/examples/2.0.x/client-apple/examples/graphql/query.md new file mode 100644 index 000000000..e01c78df1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/graphql/query.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let graphql = Graphql(client) + +let any = try await graphql.query( + query: [:] +) + +``` diff --git a/examples/2.0.x/client-apple/examples/locale/get.md b/examples/2.0.x/client-apple/examples/locale/get.md new file mode 100644 index 000000000..f87854a1d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/locale/get.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let locale = Locale(client) + +let locale = try await locale.get() + +``` diff --git a/examples/2.0.x/client-apple/examples/locale/list-codes.md b/examples/2.0.x/client-apple/examples/locale/list-codes.md new file mode 100644 index 000000000..d524b5e2a --- /dev/null +++ b/examples/2.0.x/client-apple/examples/locale/list-codes.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let locale = Locale(client) + +let localeCodeList = try await locale.listCodes() + +``` diff --git a/examples/2.0.x/client-apple/examples/locale/list-continents.md b/examples/2.0.x/client-apple/examples/locale/list-continents.md new file mode 100644 index 000000000..dfad5ced7 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/locale/list-continents.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let locale = Locale(client) + +let continentList = try await locale.listContinents() + +``` diff --git a/examples/2.0.x/client-apple/examples/locale/list-countries-eu.md b/examples/2.0.x/client-apple/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..ee6a97f92 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/locale/list-countries-eu.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let locale = Locale(client) + +let countryList = try await locale.listCountriesEU() + +``` diff --git a/examples/2.0.x/client-apple/examples/locale/list-countries-phones.md b/examples/2.0.x/client-apple/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..d9267a684 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/locale/list-countries-phones.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let locale = Locale(client) + +let phoneList = try await locale.listCountriesPhones() + +``` diff --git a/examples/2.0.x/client-apple/examples/locale/list-countries.md b/examples/2.0.x/client-apple/examples/locale/list-countries.md new file mode 100644 index 000000000..2b79063db --- /dev/null +++ b/examples/2.0.x/client-apple/examples/locale/list-countries.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let locale = Locale(client) + +let countryList = try await locale.listCountries() + +``` diff --git a/examples/2.0.x/client-apple/examples/locale/list-currencies.md b/examples/2.0.x/client-apple/examples/locale/list-currencies.md new file mode 100644 index 000000000..ccd5c92e1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/locale/list-currencies.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let locale = Locale(client) + +let currencyList = try await locale.listCurrencies() + +``` diff --git a/examples/2.0.x/client-apple/examples/locale/list-languages.md b/examples/2.0.x/client-apple/examples/locale/list-languages.md new file mode 100644 index 000000000..7132b1bfe --- /dev/null +++ b/examples/2.0.x/client-apple/examples/locale/list-languages.md @@ -0,0 +1,12 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let locale = Locale(client) + +let languageList = try await locale.listLanguages() + +``` diff --git a/examples/2.0.x/client-apple/examples/messaging/create-subscriber.md b/examples/2.0.x/client-apple/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..a7e96e552 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/messaging/create-subscriber.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let messaging = Messaging(client) + +let subscriber = try await messaging.createSubscriber( + topicId: "", + subscriberId: "", + targetId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/messaging/delete-subscriber.md b/examples/2.0.x/client-apple/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..7e68489b6 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/messaging/delete-subscriber.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let messaging = Messaging(client) + +let result = try await messaging.deleteSubscriber( + topicId: "", + subscriberId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/presences/delete.md b/examples/2.0.x/client-apple/examples/presences/delete.md new file mode 100644 index 000000000..6df012b51 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/presences/delete.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let presences = Presences(client) + +let result = try await presences.delete( + presenceId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/presences/get.md b/examples/2.0.x/client-apple/examples/presences/get.md new file mode 100644 index 000000000..9e8ae6ac2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/presences/get.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let presences = Presences(client) + +let presence = try await presences.get( + presenceId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/presences/list.md b/examples/2.0.x/client-apple/examples/presences/list.md new file mode 100644 index 000000000..e24323535 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/presences/list.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let presences = Presences(client) + +let presenceList = try await presences.list( + queries: [], // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/presences/update.md b/examples/2.0.x/client-apple/examples/presences/update.md new file mode 100644 index 000000000..1dce7b7d3 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/presences/update.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let presences = Presences(client) + +let presence = try await presences.update( + presenceId: "", + status: "", // optional + expiresAt: "2020-10-15T06:38:00.000+00:00", // optional + metadata: [:], // optional + permissions: [Permission.read(Role.any())], // optional + purge: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/presences/upsert.md b/examples/2.0.x/client-apple/examples/presences/upsert.md new file mode 100644 index 000000000..23e495015 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/presences/upsert.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let presences = Presences(client) + +let presence = try await presences.upsert( + presenceId: "", + status: "", + permissions: [Permission.read(Role.any())], // optional + expiresAt: "2020-10-15T06:38:00.000+00:00", // optional + metadata: [:] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/create-file.md b/examples/2.0.x/client-apple/examples/storage/create-file.md new file mode 100644 index 000000000..bfa3197a1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/storage/create-file.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let storage = Storage(client) + +let file = try await storage.createFile( + bucketId: "", + fileId: "", + file: InputFile.fromPath("file.png"), + permissions: [Permission.read(Role.any())], // optional + folder: "photos/2026" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/delete-file.md b/examples/2.0.x/client-apple/examples/storage/delete-file.md new file mode 100644 index 000000000..dee1c64b2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/storage/delete-file.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let storage = Storage(client) + +let result = try await storage.deleteFile( + bucketId: "", + fileId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/get-file-download.md b/examples/2.0.x/client-apple/examples/storage/get-file-download.md new file mode 100644 index 000000000..c46d0723a --- /dev/null +++ b/examples/2.0.x/client-apple/examples/storage/get-file-download.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let storage = Storage(client) + +let bytes = try await storage.getFileDownload( + bucketId: "", + fileId: "", + token: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/get-file-preview.md b/examples/2.0.x/client-apple/examples/storage/get-file-preview.md new file mode 100644 index 000000000..7f7902cb8 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/storage/get-file-preview.md @@ -0,0 +1,28 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let storage = Storage(client) + +let bytes = try await storage.getFilePreview( + bucketId: "", + fileId: "", + width: 0, // optional + height: 0, // optional + gravity: .center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: "FFFFFF", // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: "FFFFFF", // optional + output: .jpg, // optional + token: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/get-file-view.md b/examples/2.0.x/client-apple/examples/storage/get-file-view.md new file mode 100644 index 000000000..1364d8ef6 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/storage/get-file-view.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let storage = Storage(client) + +let bytes = try await storage.getFileView( + bucketId: "", + fileId: "", + token: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/get-file.md b/examples/2.0.x/client-apple/examples/storage/get-file.md new file mode 100644 index 000000000..7ec8438e5 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/storage/get-file.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let storage = Storage(client) + +let file = try await storage.getFile( + bucketId: "", + fileId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/list-files.md b/examples/2.0.x/client-apple/examples/storage/list-files.md new file mode 100644 index 000000000..f65495610 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/storage/list-files.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let storage = Storage(client) + +let fileList = try await storage.listFiles( + bucketId: "", + queries: [], // optional + search: "", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/storage/update-file.md b/examples/2.0.x/client-apple/examples/storage/update-file.md new file mode 100644 index 000000000..dcc0c5dd2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/storage/update-file.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let storage = Storage(client) + +let file = try await storage.updateFile( + bucketId: "", + fileId: "", + name: "", // optional + permissions: [Permission.read(Role.any())] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/create-operations.md b/examples/2.0.x/client-apple/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..ee3d6ce3d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/create-operations.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let transaction = try await tablesDB.createOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "tableId": "", + "rowId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/create-row.md b/examples/2.0.x/client-apple/examples/tablesdb/create-row.md new file mode 100644 index 000000000..68e9fc386 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/create-row.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.createRow( + databaseId: "", + tableId: "", + rowId: "", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/create-transaction.md b/examples/2.0.x/client-apple/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..97d1346e9 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/create-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let transaction = try await tablesDB.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/client-apple/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..bef6d34e2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.decrementRowColumn( + databaseId: "", + tableId: "", + rowId: "", + column: "", + value: 1, // optional + min: 0, // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/delete-row.md b/examples/2.0.x/client-apple/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..82890ed77 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/delete-row.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteRow( + databaseId: "", + tableId: "", + rowId: "", + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/delete-transaction.md b/examples/2.0.x/client-apple/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..865aeaecc --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/delete-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/get-row.md b/examples/2.0.x/client-apple/examples/tablesdb/get-row.md new file mode 100644 index 000000000..51167094f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/get-row.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.getRow( + databaseId: "", + tableId: "", + rowId: "", + queries: [], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/get-transaction.md b/examples/2.0.x/client-apple/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..601ece79b --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/get-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let transaction = try await tablesDB.getTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/increment-row-column.md b/examples/2.0.x/client-apple/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..f82985265 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/increment-row-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.incrementRowColumn( + databaseId: "", + tableId: "", + rowId: "", + column: "", + value: 1, // optional + max: 100, // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/list-rows.md b/examples/2.0.x/client-apple/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..b6df80e0c --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/list-rows.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.listRows( + databaseId: "", + tableId: "", + queries: [], // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/list-transactions.md b/examples/2.0.x/client-apple/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..655109394 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/list-transactions.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let transactionList = try await tablesDB.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/update-row.md b/examples/2.0.x/client-apple/examples/tablesdb/update-row.md new file mode 100644 index 000000000..29fb327e2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/update-row.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.updateRow( + databaseId: "", + tableId: "", + rowId: "", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + ], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/update-transaction.md b/examples/2.0.x/client-apple/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..432d7c486 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/update-transaction.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let transaction = try await tablesDB.updateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/tablesdb/upsert-row.md b/examples/2.0.x/client-apple/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..77d971c97 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/tablesdb/upsert-row.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.upsertRow( + databaseId: "", + tableId: "", + rowId: "", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + ], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/create-membership.md b/examples/2.0.x/client-apple/examples/teams/create-membership.md new file mode 100644 index 000000000..124765abf --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/create-membership.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let membership = try await teams.createMembership( + teamId: "", + roles: [], + email: "email@example.com", // optional + userId: "", // optional + phone: "+12065550100", // optional + url: "https://example.com", // optional + name: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/create.md b/examples/2.0.x/client-apple/examples/teams/create.md new file mode 100644 index 000000000..70600909b --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/create.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let team = try await teams.create( + teamId: "", + name: "", + roles: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/delete-membership.md b/examples/2.0.x/client-apple/examples/teams/delete-membership.md new file mode 100644 index 000000000..c5e61cfb2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/delete-membership.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let result = try await teams.deleteMembership( + teamId: "", + membershipId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/delete.md b/examples/2.0.x/client-apple/examples/teams/delete.md new file mode 100644 index 000000000..782b41b3d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/delete.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let result = try await teams.delete( + teamId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/get-membership.md b/examples/2.0.x/client-apple/examples/teams/get-membership.md new file mode 100644 index 000000000..94882c98f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/get-membership.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let membership = try await teams.getMembership( + teamId: "", + membershipId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/get-prefs.md b/examples/2.0.x/client-apple/examples/teams/get-prefs.md new file mode 100644 index 000000000..0fc67385e --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/get-prefs.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let preferences = try await teams.getPrefs( + teamId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/get.md b/examples/2.0.x/client-apple/examples/teams/get.md new file mode 100644 index 000000000..592be9553 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/get.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let team = try await teams.get( + teamId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/list-memberships.md b/examples/2.0.x/client-apple/examples/teams/list-memberships.md new file mode 100644 index 000000000..b2338476b --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/list-memberships.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let membershipList = try await teams.listMemberships( + teamId: "", + queries: [], // optional + search: "", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/list.md b/examples/2.0.x/client-apple/examples/teams/list.md new file mode 100644 index 000000000..7404c8b7f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/list.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let teamList = try await teams.list( + queries: [], // optional + search: "", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/update-membership-status.md b/examples/2.0.x/client-apple/examples/teams/update-membership-status.md new file mode 100644 index 000000000..1a3ae9139 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/update-membership-status.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let membership = try await teams.updateMembershipStatus( + teamId: "", + membershipId: "", + userId: "", + secret: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/update-membership.md b/examples/2.0.x/client-apple/examples/teams/update-membership.md new file mode 100644 index 000000000..5663848d1 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/update-membership.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let membership = try await teams.updateMembership( + teamId: "", + membershipId: "", + roles: [] +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/update-name.md b/examples/2.0.x/client-apple/examples/teams/update-name.md new file mode 100644 index 000000000..bc7187cd9 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/update-name.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let team = try await teams.updateName( + teamId: "", + name: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/teams/update-prefs.md b/examples/2.0.x/client-apple/examples/teams/update-prefs.md new file mode 100644 index 000000000..c40796b3a --- /dev/null +++ b/examples/2.0.x/client-apple/examples/teams/update-prefs.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let teams = Teams(client) + +let preferences = try await teams.updatePrefs( + teamId: "", + prefs: [:] +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/create-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..6676e3aa3 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/create-document.md @@ -0,0 +1,29 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.createDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [ + "embeddings": [ + "0": 0.12, + "1": -0.55, + "2": 0.88, + "3": 1.02 + ], + "metadata": [ + "key": "value" + ] + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-apple/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..c90069aa2 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.createOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/create-query.md b/examples/2.0.x/client-apple/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..e80be9b2d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/create-query.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.createQuery( + databaseId: "", + collectionId: "", + queries: [], // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-apple/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..4cdabc2ec --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/create-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..dd80e834d --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/delete-document.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.deleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-apple/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..ff7538a06 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.deleteTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/get-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..e1814376f --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/get-document.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.getDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-apple/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..4b8fd1a64 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/get-transaction.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.getTransaction( + transactionId: "" +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-apple/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..c082c815e --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/list-documents.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.listDocuments( + databaseId: "", + collectionId: "", + queries: [], // optional + transactionId: "", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-apple/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..26aa4f467 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/list-transactions.md @@ -0,0 +1,14 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transactionList = try await vectorsDB.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/update-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..f96706f84 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/update-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.updateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-apple/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..f254540e5 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/update-transaction.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.updateTransaction( + transactionId: "", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/client-apple/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-apple/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..4fd857661 --- /dev/null +++ b/examples/2.0.x/client-apple/examples/vectorsdb/upsert-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.upsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "" // optional +) + +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-anonymous-session.md b/examples/2.0.x/client-flutter/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..0cdedf8f2 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Session result = await account.createAnonymousSession(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-email-password-session.md b/examples/2.0.x/client-flutter/examples/account/create-email-password-session.md new file mode 100644 index 000000000..d444996d9 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-email-password-session.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Session result = await account.createEmailPasswordSession( + email: 'email@example.com', + password: 'password', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-email-token.md b/examples/2.0.x/client-flutter/examples/account/create-email-token.md new file mode 100644 index 000000000..738905812 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-email-token.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.createEmailToken( + userId: '', + email: 'email@example.com', + phrase: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-email-verification.md b/examples/2.0.x/client-flutter/examples/account/create-email-verification.md new file mode 100644 index 000000000..d88979c88 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-email-verification.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.createEmailVerification( + url: 'https://example.com', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-jwt.md b/examples/2.0.x/client-flutter/examples/account/create-jwt.md new file mode 100644 index 000000000..72ff1180e --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-jwt.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Jwt result = await account.createJWT( + duration: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-magic-url-token.md b/examples/2.0.x/client-flutter/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..59d1cc243 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-magic-url-token.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.createMagicURLToken( + userId: '', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-mfa-authenticator.md b/examples/2.0.x/client-flutter/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..c86de3ba7 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-mfa-authenticator.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +MfaType result = await account.createMFAAuthenticator( + type: enums.AuthenticatorType.totp, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-mfa-challenge.md b/examples/2.0.x/client-flutter/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..c7007d328 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-mfa-challenge.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +MfaChallenge result = await account.createMFAChallenge( + factor: enums.AuthenticationFactor.email, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/client-flutter/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..252dec7a7 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +MfaRecoveryCodes result = await account.createMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-session.md new file mode 100644 index 000000000..75abae31a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-session.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +await account.createOAuth2Session( + provider: enums.OAuthProvider.amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..be098a627 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-o-auth-2-token.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +await account.createOAuth2Token( + provider: enums.OAuthProvider.amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-phone-token.md b/examples/2.0.x/client-flutter/examples/account/create-phone-token.md new file mode 100644 index 000000000..95799d62a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-phone-token.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.createPhoneToken( + userId: '', + phone: '+12065550100', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-phone-verification.md b/examples/2.0.x/client-flutter/examples/account/create-phone-verification.md new file mode 100644 index 000000000..9fc84dfc7 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-phone-verification.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.createPhoneVerification(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-push-target.md b/examples/2.0.x/client-flutter/examples/account/create-push-target.md new file mode 100644 index 000000000..d493b2a00 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-push-target.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Target result = await account.createPushTarget( + targetId: '', + identifier: '', + providerId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-recovery.md b/examples/2.0.x/client-flutter/examples/account/create-recovery.md new file mode 100644 index 000000000..fe5ecfa05 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.createRecovery( + email: 'email@example.com', + url: 'https://example.com', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-session.md b/examples/2.0.x/client-flutter/examples/account/create-session.md new file mode 100644 index 000000000..ebac1f930 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-session.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Session result = await account.createSession( + userId: '', + secret: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create-verification.md b/examples/2.0.x/client-flutter/examples/account/create-verification.md new file mode 100644 index 000000000..c36cb8f34 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create-verification.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.createVerification( + url: 'https://example.com', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/create.md b/examples/2.0.x/client-flutter/examples/account/create.md new file mode 100644 index 000000000..8343f6284 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/create.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.create( + userId: '', + email: 'email@example.com', + password: 'password', + name: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/delete-identity.md b/examples/2.0.x/client-flutter/examples/account/delete-identity.md new file mode 100644 index 000000000..47407e7f7 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/delete-identity.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +await account.deleteIdentity( + identityId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/client-flutter/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..eac797665 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +await account.deleteMFAAuthenticator( + type: enums.AuthenticatorType.totp, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/delete-push-target.md b/examples/2.0.x/client-flutter/examples/account/delete-push-target.md new file mode 100644 index 000000000..477a0446f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/delete-push-target.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +await account.deletePushTarget( + targetId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/delete-session.md b/examples/2.0.x/client-flutter/examples/account/delete-session.md new file mode 100644 index 000000000..513f2146f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/delete-session.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +await account.deleteSession( + sessionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/delete-sessions.md b/examples/2.0.x/client-flutter/examples/account/delete-sessions.md new file mode 100644 index 000000000..e8e8ba1af --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/delete-sessions.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +await account.deleteSessions(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/client-flutter/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..ed5531a32 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +MfaRecoveryCodes result = await account.getMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/get-prefs.md b/examples/2.0.x/client-flutter/examples/account/get-prefs.md new file mode 100644 index 000000000..dc359f9c1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/get-prefs.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Preferences result = await account.getPrefs(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/get-session.md b/examples/2.0.x/client-flutter/examples/account/get-session.md new file mode 100644 index 000000000..c27058a8e --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/get-session.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Session result = await account.getSession( + sessionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/get.md b/examples/2.0.x/client-flutter/examples/account/get.md new file mode 100644 index 000000000..1bd67c6a1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/get.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.get(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/list-identities.md b/examples/2.0.x/client-flutter/examples/account/list-identities.md new file mode 100644 index 000000000..d0c0e5b60 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/list-identities.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +IdentityList result = await account.listIdentities( + queries: [], // optional + total: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/list-mfa-factors.md b/examples/2.0.x/client-flutter/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..4cfcf88b3 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +MfaFactors result = await account.listMFAFactors(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/list-sessions.md b/examples/2.0.x/client-flutter/examples/account/list-sessions.md new file mode 100644 index 000000000..18db93bbb --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/list-sessions.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +SessionList result = await account.listSessions(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-email-verification.md b/examples/2.0.x/client-flutter/examples/account/update-email-verification.md new file mode 100644 index 000000000..7e3975e96 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-email-verification.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.updateEmailVerification( + userId: '', + secret: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-email.md b/examples/2.0.x/client-flutter/examples/account/update-email.md new file mode 100644 index 000000000..e5e1a169a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-email.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.updateEmail( + email: 'email@example.com', + password: 'password', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-magic-url-session.md b/examples/2.0.x/client-flutter/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..c45dcf1eb --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-magic-url-session.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Session result = await account.updateMagicURLSession( + userId: '', + secret: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-mfa-authenticator.md b/examples/2.0.x/client-flutter/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..539c5e280 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-mfa-authenticator.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.updateMFAAuthenticator( + type: enums.AuthenticatorType.totp, + otp: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-mfa-challenge.md b/examples/2.0.x/client-flutter/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..55f4ebee4 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Session result = await account.updateMFAChallenge( + challengeId: '', + otp: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/client-flutter/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..7a188d40f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +MfaRecoveryCodes result = await account.updateMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-mfa.md b/examples/2.0.x/client-flutter/examples/account/update-mfa.md new file mode 100644 index 000000000..db9addd61 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-mfa.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.updateMFA( + mfa: false, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-name.md b/examples/2.0.x/client-flutter/examples/account/update-name.md new file mode 100644 index 000000000..8ab712232 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-name.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.updateName( + name: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-password.md b/examples/2.0.x/client-flutter/examples/account/update-password.md new file mode 100644 index 000000000..c2604a9c2 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-password.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.updatePassword( + password: 'password', + oldPassword: 'password', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-phone-session.md b/examples/2.0.x/client-flutter/examples/account/update-phone-session.md new file mode 100644 index 000000000..f538680a5 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Session result = await account.updatePhoneSession( + userId: '', + secret: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-phone-verification.md b/examples/2.0.x/client-flutter/examples/account/update-phone-verification.md new file mode 100644 index 000000000..de226a7c7 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-phone-verification.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.updatePhoneVerification( + userId: '', + secret: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-phone.md b/examples/2.0.x/client-flutter/examples/account/update-phone.md new file mode 100644 index 000000000..f631c5dfc --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-phone.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.updatePhone( + phone: '+12065550100', + password: 'password', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-prefs.md b/examples/2.0.x/client-flutter/examples/account/update-prefs.md new file mode 100644 index 000000000..6f9863d38 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-prefs.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.updatePrefs( + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-push-target.md b/examples/2.0.x/client-flutter/examples/account/update-push-target.md new file mode 100644 index 000000000..601f3aece --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-push-target.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Target result = await account.updatePushTarget( + targetId: '', + identifier: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-recovery.md b/examples/2.0.x/client-flutter/examples/account/update-recovery.md new file mode 100644 index 000000000..809aa0448 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.updateRecovery( + userId: '', + secret: '', + password: 'password', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-session.md b/examples/2.0.x/client-flutter/examples/account/update-session.md new file mode 100644 index 000000000..7fb334aaa --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-session.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Session result = await account.updateSession( + sessionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-status.md b/examples/2.0.x/client-flutter/examples/account/update-status.md new file mode 100644 index 000000000..d7b0d0dcc --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-status.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +User result = await account.updateStatus(); +``` diff --git a/examples/2.0.x/client-flutter/examples/account/update-verification.md b/examples/2.0.x/client-flutter/examples/account/update-verification.md new file mode 100644 index 000000000..339b4b91c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/account/update-verification.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Account account = Account(client); + +Token result = await account.updateVerification( + userId: '', + secret: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-browser.md b/examples/2.0.x/client-flutter/examples/avatars/get-browser.md new file mode 100644 index 000000000..91cd7be6e --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-browser.md @@ -0,0 +1,39 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getBrowser( + code: enums.Browser.avantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getBrowser( + code: enums.Browser.avantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-credit-card.md b/examples/2.0.x/client-flutter/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..4665fcce1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-credit-card.md @@ -0,0 +1,39 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getCreditCard( + code: enums.CreditCard.americanExpress, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getCreditCard( + code: enums.CreditCard.americanExpress, + width: 0, // optional + height: 0, // optional + quality: -1, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-favicon.md b/examples/2.0.x/client-flutter/examples/avatars/get-favicon.md new file mode 100644 index 000000000..5f523f814 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-favicon.md @@ -0,0 +1,32 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getFavicon( + url: 'https://example.com', +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getFavicon( + url: 'https://example.com', + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-flag.md b/examples/2.0.x/client-flutter/examples/avatars/get-flag.md new file mode 100644 index 000000000..552c22ccd --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-flag.md @@ -0,0 +1,39 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getFlag( + code: enums.Flag.afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getFlag( + code: enums.Flag.afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-image.md b/examples/2.0.x/client-flutter/examples/avatars/get-image.md new file mode 100644 index 000000000..3f74cae01 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-image.md @@ -0,0 +1,36 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getImage( + url: 'https://example.com', + width: 0, // optional + height: 0, // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getImage( + url: 'https://example.com', + width: 0, // optional + height: 0, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-initials.md b/examples/2.0.x/client-flutter/examples/avatars/get-initials.md new file mode 100644 index 000000000..89e20e7c6 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-initials.md @@ -0,0 +1,38 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getInitials( + name: '', // optional + width: 0, // optional + height: 0, // optional + background: 'FFFFFF', // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getInitials( + name: '', // optional + width: 0, // optional + height: 0, // optional + background: 'FFFFFF', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-photo.md b/examples/2.0.x/client-flutter/examples/avatars/get-photo.md new file mode 100644 index 000000000..371b19d91 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-photo.md @@ -0,0 +1,46 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '', // optional + name: '', // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '', // optional + name: '', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-qr.md b/examples/2.0.x/client-flutter/examples/avatars/get-qr.md new file mode 100644 index 000000000..3579f4312 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-qr.md @@ -0,0 +1,38 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getQR( + text: '', + size: 1, // optional + margin: 0, // optional + download: false, // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getQR( + text: '', + size: 1, // optional + margin: 0, // optional + download: false, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/avatars/get-screenshot.md b/examples/2.0.x/client-flutter/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..daa38d171 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/avatars/get-screenshot.md @@ -0,0 +1,77 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +Uint8List bytes = await avatars.getScreenshot( + url: 'https://example.com', + headers: { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + }, // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: enums.BrowserTheme.dark, // optional + userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + fullpage: true, // optional + locale: 'en-US', // optional + timezone: enums.Timezone.africaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [enums.BrowserPermission.geolocation, enums.BrowserPermission.notifications], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: enums.ImageFormat.jpeg, // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getScreenshot( + url: 'https://example.com', + headers: { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + }, // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: enums.BrowserTheme.dark, // optional + userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + fullpage: true, // optional + locale: 'en-US', // optional + timezone: enums.Timezone.africaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [enums.BrowserPermission.geolocation, enums.BrowserPermission.notifications], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: enums.ImageFormat.jpeg, // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/create-document.md b/examples/2.0.x/client-flutter/examples/databases/create-document.md new file mode 100644 index 000000000..a4df848f0 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/create-document.md @@ -0,0 +1,26 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.createDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/create-operations.md b/examples/2.0.x/client-flutter/examples/databases/create-operations.md new file mode 100644 index 000000000..0551c28bf --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/create-operations.md @@ -0,0 +1,24 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Transaction result = await databases.createOperations( + transactionId: '', + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/create-transaction.md b/examples/2.0.x/client-flutter/examples/databases/create-transaction.md new file mode 100644 index 000000000..14ea55637 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/create-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Transaction result = await databases.createTransaction( + ttl: 60, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/decrement-document-attribute.md b/examples/2.0.x/client-flutter/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..0d178cff1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.decrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/delete-document.md b/examples/2.0.x/client-flutter/examples/databases/delete-document.md new file mode 100644 index 000000000..92350ce2f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/delete-document.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +await databases.deleteDocument( + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/delete-transaction.md b/examples/2.0.x/client-flutter/examples/databases/delete-transaction.md new file mode 100644 index 000000000..3d6d5ed41 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/delete-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +await databases.deleteTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/get-document.md b/examples/2.0.x/client-flutter/examples/databases/get-document.md new file mode 100644 index 000000000..1f384afd1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/get-document.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.getDocument( + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/get-transaction.md b/examples/2.0.x/client-flutter/examples/databases/get-transaction.md new file mode 100644 index 000000000..142b8bfa4 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/get-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Transaction result = await databases.getTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/increment-document-attribute.md b/examples/2.0.x/client-flutter/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..05b3690ef --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.incrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/list-documents.md b/examples/2.0.x/client-flutter/examples/databases/list-documents.md new file mode 100644 index 000000000..531be6ade --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/list-documents.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +DocumentList result = await databases.listDocuments( + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/list-transactions.md b/examples/2.0.x/client-flutter/examples/databases/list-transactions.md new file mode 100644 index 000000000..ca9ff6fb1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/list-transactions.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +TransactionList result = await databases.listTransactions( + queries: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/update-document.md b/examples/2.0.x/client-flutter/examples/databases/update-document.md new file mode 100644 index 000000000..52557334c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/update-document.md @@ -0,0 +1,26 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.updateDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/update-transaction.md b/examples/2.0.x/client-flutter/examples/databases/update-transaction.md new file mode 100644 index 000000000..a882eb92c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/update-transaction.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Transaction result = await databases.updateTransaction( + transactionId: '', + commit: false, // optional + rollback: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/databases/upsert-document.md b/examples/2.0.x/client-flutter/examples/databases/upsert-document.md new file mode 100644 index 000000000..6678a0dcb --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/databases/upsert-document.md @@ -0,0 +1,26 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.upsertDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/create-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/create-document.md new file mode 100644 index 000000000..d4b564e2e --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.createDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/create-documents.md b/examples/2.0.x/client-flutter/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..6a5083730 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/create-documents.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +DocumentList result = await documentsDB.createDocuments( + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/create-operations.md b/examples/2.0.x/client-flutter/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..a4d1ecddb --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/create-operations.md @@ -0,0 +1,24 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.createOperations( + transactionId: '', + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-flutter/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..2d9cb9f72 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/create-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.createTransaction( + ttl: 60, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-flutter/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..dcdac3aae --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.decrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/delete-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..8d59422e1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/delete-document.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteDocument( + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-flutter/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..9b95d9487 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/delete-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/get-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/get-document.md new file mode 100644 index 000000000..45db46e6a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/get-document.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.getDocument( + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-flutter/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..4b1a5f1f8 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/get-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.getTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-flutter/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..c2c6e95c8 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.incrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/list-documents.md b/examples/2.0.x/client-flutter/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..92d2651c5 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/list-documents.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +DocumentList result = await documentsDB.listDocuments( + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-flutter/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..d2c09525d --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/list-transactions.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +TransactionList result = await documentsDB.listTransactions( + queries: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/update-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/update-document.md new file mode 100644 index 000000000..1b9fba9a5 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.updateDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-flutter/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..ebcf17be1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/update-transaction.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.updateTransaction( + transactionId: '', + commit: false, // optional + rollback: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-flutter/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..bdf3844b1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.upsertDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/functions/create-execution.md b/examples/2.0.x/client-flutter/examples/functions/create-execution.md new file mode 100644 index 000000000..0e2197489 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/functions/create-execution.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Functions functions = Functions(client); + +Execution result = await functions.createExecution( + functionId: '', + body: '', // optional + xasync: false, // optional + path: '', // optional + method: enums.ExecutionMethod.gET, // optional + headers: {}, // optional + scheduledAt: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/functions/get-execution.md b/examples/2.0.x/client-flutter/examples/functions/get-execution.md new file mode 100644 index 000000000..f17e10c1d --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/functions/get-execution.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Functions functions = Functions(client); + +Execution result = await functions.getExecution( + functionId: '', + executionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/functions/list-executions.md b/examples/2.0.x/client-flutter/examples/functions/list-executions.md new file mode 100644 index 000000000..ae31ffcce --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/functions/list-executions.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Functions functions = Functions(client); + +ExecutionList result = await functions.listExecutions( + functionId: '', + queries: [], // optional + total: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/graphql/mutation.md b/examples/2.0.x/client-flutter/examples/graphql/mutation.md new file mode 100644 index 000000000..7ec3ba75f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Graphql graphql = Graphql(client); + +Any result = await graphql.mutation( + query: {}, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/graphql/query.md b/examples/2.0.x/client-flutter/examples/graphql/query.md new file mode 100644 index 000000000..cac705e5a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/graphql/query.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Graphql graphql = Graphql(client); + +Any result = await graphql.query( + query: {}, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/locale/get.md b/examples/2.0.x/client-flutter/examples/locale/get.md new file mode 100644 index 000000000..630211442 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/locale/get.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Locale locale = Locale(client); + +Locale result = await locale.get(); +``` diff --git a/examples/2.0.x/client-flutter/examples/locale/list-codes.md b/examples/2.0.x/client-flutter/examples/locale/list-codes.md new file mode 100644 index 000000000..23c375ba3 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Locale locale = Locale(client); + +LocaleCodeList result = await locale.listCodes(); +``` diff --git a/examples/2.0.x/client-flutter/examples/locale/list-continents.md b/examples/2.0.x/client-flutter/examples/locale/list-continents.md new file mode 100644 index 000000000..349be7951 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Locale locale = Locale(client); + +ContinentList result = await locale.listContinents(); +``` diff --git a/examples/2.0.x/client-flutter/examples/locale/list-countries-eu.md b/examples/2.0.x/client-flutter/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..f775aa2e7 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Locale locale = Locale(client); + +CountryList result = await locale.listCountriesEU(); +``` diff --git a/examples/2.0.x/client-flutter/examples/locale/list-countries-phones.md b/examples/2.0.x/client-flutter/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..ee368e297 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Locale locale = Locale(client); + +PhoneList result = await locale.listCountriesPhones(); +``` diff --git a/examples/2.0.x/client-flutter/examples/locale/list-countries.md b/examples/2.0.x/client-flutter/examples/locale/list-countries.md new file mode 100644 index 000000000..17e0814f9 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Locale locale = Locale(client); + +CountryList result = await locale.listCountries(); +``` diff --git a/examples/2.0.x/client-flutter/examples/locale/list-currencies.md b/examples/2.0.x/client-flutter/examples/locale/list-currencies.md new file mode 100644 index 000000000..751de786f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/locale/list-currencies.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Locale locale = Locale(client); + +CurrencyList result = await locale.listCurrencies(); +``` diff --git a/examples/2.0.x/client-flutter/examples/locale/list-languages.md b/examples/2.0.x/client-flutter/examples/locale/list-languages.md new file mode 100644 index 000000000..28b46a0a8 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/locale/list-languages.md @@ -0,0 +1,11 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Locale locale = Locale(client); + +LanguageList result = await locale.listLanguages(); +``` diff --git a/examples/2.0.x/client-flutter/examples/messaging/create-subscriber.md b/examples/2.0.x/client-flutter/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..e28a1ab62 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Messaging messaging = Messaging(client); + +Subscriber result = await messaging.createSubscriber( + topicId: '', + subscriberId: '', + targetId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/messaging/delete-subscriber.md b/examples/2.0.x/client-flutter/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..4861ec905 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Messaging messaging = Messaging(client); + +await messaging.deleteSubscriber( + topicId: '', + subscriberId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/presences/delete.md b/examples/2.0.x/client-flutter/examples/presences/delete.md new file mode 100644 index 000000000..b79ace2c8 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/presences/delete.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Presences presences = Presences(client); + +await presences.delete( + presenceId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/presences/get.md b/examples/2.0.x/client-flutter/examples/presences/get.md new file mode 100644 index 000000000..9fad57c6f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/presences/get.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Presences presences = Presences(client); + +Presence result = await presences.get( + presenceId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/presences/list.md b/examples/2.0.x/client-flutter/examples/presences/list.md new file mode 100644 index 000000000..5810a2984 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/presences/list.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Presences presences = Presences(client); + +PresenceList result = await presences.list( + queries: [], // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/presences/update.md b/examples/2.0.x/client-flutter/examples/presences/update.md new file mode 100644 index 000000000..84a64be01 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/presences/update.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Presences presences = Presences(client); + +Presence result = await presences.update( + presenceId: '', + status: '', // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional + permissions: [Permission.read(Role.any())], // optional + purge: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/presences/upsert.md b/examples/2.0.x/client-flutter/examples/presences/upsert.md new file mode 100644 index 000000000..32acc92fe --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/presences/upsert.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Presences presences = Presences(client); + +Presence result = await presences.upsert( + presenceId: '', + status: '', + permissions: [Permission.read(Role.any())], // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/create-file.md b/examples/2.0.x/client-flutter/examples/storage/create-file.md new file mode 100644 index 000000000..7d8fbd13c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/storage/create-file.md @@ -0,0 +1,20 @@ +```dart +import 'dart:io'; +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Storage storage = Storage(client); + +File result = await storage.createFile( + bucketId: '', + fileId: '', + file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + permissions: [Permission.read(Role.any())], // optional + folder: 'photos/2026', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/delete-file.md b/examples/2.0.x/client-flutter/examples/storage/delete-file.md new file mode 100644 index 000000000..960e92f57 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Storage storage = Storage(client); + +await storage.deleteFile( + bucketId: '', + fileId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/get-file-download.md b/examples/2.0.x/client-flutter/examples/storage/get-file-download.md new file mode 100644 index 000000000..8e6e75eff --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/storage/get-file-download.md @@ -0,0 +1,36 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Storage storage = Storage(client); + +// Downloading file +Uint8List bytes = await storage.getFileDownload( + bucketId: '', + fileId: '', + token: '', // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFileDownload( + bucketId: '', + fileId: '', + token: '', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/get-file-preview.md b/examples/2.0.x/client-flutter/examples/storage/get-file-preview.md new file mode 100644 index 000000000..274b42245 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/storage/get-file-preview.md @@ -0,0 +1,59 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Storage storage = Storage(client); + +// Downloading file +Uint8List bytes = await storage.getFilePreview( + bucketId: '', + fileId: '', + width: 0, // optional + height: 0, // optional + gravity: enums.ImageGravity.center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: 'FFFFFF', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: 'FFFFFF', // optional + output: enums.ImageFormat.jpg, // optional + token: '', // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFilePreview( + bucketId: '', + fileId: '', + width: 0, // optional + height: 0, // optional + gravity: enums.ImageGravity.center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: 'FFFFFF', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: 'FFFFFF', // optional + output: enums.ImageFormat.jpg, // optional + token: '', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/get-file-view.md b/examples/2.0.x/client-flutter/examples/storage/get-file-view.md new file mode 100644 index 000000000..6cc01b658 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/storage/get-file-view.md @@ -0,0 +1,36 @@ +```dart +import 'dart:io'; +import 'dart:typed_data'; +import 'package:flutter/material.dart'; +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Storage storage = Storage(client); + +// Downloading file +Uint8List bytes = await storage.getFileView( + bucketId: '', + fileId: '', + token: '', // optional +); + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFileView( + bucketId: '', + fileId: '', + token: '', // optional + ), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data!) + : const CircularProgressIndicator(); + }, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/get-file.md b/examples/2.0.x/client-flutter/examples/storage/get-file.md new file mode 100644 index 000000000..9f1adb6e7 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/storage/get-file.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Storage storage = Storage(client); + +File result = await storage.getFile( + bucketId: '', + fileId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/list-files.md b/examples/2.0.x/client-flutter/examples/storage/list-files.md new file mode 100644 index 000000000..0decd6953 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/storage/list-files.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Storage storage = Storage(client); + +FileList result = await storage.listFiles( + bucketId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/storage/update-file.md b/examples/2.0.x/client-flutter/examples/storage/update-file.md new file mode 100644 index 000000000..90814329a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/storage/update-file.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Storage storage = Storage(client); + +File result = await storage.updateFile( + bucketId: '', + fileId: '', + name: '', // optional + permissions: [Permission.read(Role.any())], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/create-operations.md b/examples/2.0.x/client-flutter/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..bc779b6bf --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/create-operations.md @@ -0,0 +1,24 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Transaction result = await tablesDB.createOperations( + transactionId: '', + operations: [ + { + "action": "create", + "databaseId": "", + "tableId": "", + "rowId": "", + "data": { + "name": "Walter O'Brien" + } + } + ], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/create-row.md b/examples/2.0.x/client-flutter/examples/tablesdb/create-row.md new file mode 100644 index 000000000..cb5d85783 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/create-row.md @@ -0,0 +1,26 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.createRow( + databaseId: '', + tableId: '', + rowId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/create-transaction.md b/examples/2.0.x/client-flutter/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..527dde392 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/create-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Transaction result = await tablesDB.createTransaction( + ttl: 60, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/client-flutter/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..bee4987f1 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.decrementRowColumn( + databaseId: '', + tableId: '', + rowId: '', + column: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/delete-row.md b/examples/2.0.x/client-flutter/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..c4e66f58a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/delete-row.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteRow( + databaseId: '', + tableId: '', + rowId: '', + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/delete-transaction.md b/examples/2.0.x/client-flutter/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..ab178fb88 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/delete-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/get-row.md b/examples/2.0.x/client-flutter/examples/tablesdb/get-row.md new file mode 100644 index 000000000..6e385a846 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/get-row.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.getRow( + databaseId: '', + tableId: '', + rowId: '', + queries: [], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/get-transaction.md b/examples/2.0.x/client-flutter/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..39b02a77f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/get-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Transaction result = await tablesDB.getTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/increment-row-column.md b/examples/2.0.x/client-flutter/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..9b0e47694 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/increment-row-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.incrementRowColumn( + databaseId: '', + tableId: '', + rowId: '', + column: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/list-rows.md b/examples/2.0.x/client-flutter/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..a2637a93e --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/list-rows.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.listRows( + databaseId: '', + tableId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/list-transactions.md b/examples/2.0.x/client-flutter/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..d95e5198b --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/list-transactions.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +TransactionList result = await tablesDB.listTransactions( + queries: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/update-row.md b/examples/2.0.x/client-flutter/examples/tablesdb/update-row.md new file mode 100644 index 000000000..3cf3c9551 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/update-row.md @@ -0,0 +1,26 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.updateRow( + databaseId: '', + tableId: '', + rowId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/update-transaction.md b/examples/2.0.x/client-flutter/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..d5a8e0820 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/update-transaction.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Transaction result = await tablesDB.updateTransaction( + transactionId: '', + commit: false, // optional + rollback: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/tablesdb/upsert-row.md b/examples/2.0.x/client-flutter/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..74c7d2c58 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/tablesdb/upsert-row.md @@ -0,0 +1,26 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.upsertRow( + databaseId: '', + tableId: '', + rowId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/create-membership.md b/examples/2.0.x/client-flutter/examples/teams/create-membership.md new file mode 100644 index 000000000..caab7926c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Membership result = await teams.createMembership( + teamId: '', + roles: [], + email: 'email@example.com', // optional + userId: '', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/create.md b/examples/2.0.x/client-flutter/examples/teams/create.md new file mode 100644 index 000000000..7a4af366f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/create.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Team result = await teams.create( + teamId: '', + name: '', + roles: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/delete-membership.md b/examples/2.0.x/client-flutter/examples/teams/delete-membership.md new file mode 100644 index 000000000..e42161fac --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +await teams.deleteMembership( + teamId: '', + membershipId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/delete.md b/examples/2.0.x/client-flutter/examples/teams/delete.md new file mode 100644 index 000000000..d3f4d7115 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/delete.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +await teams.delete( + teamId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/get-membership.md b/examples/2.0.x/client-flutter/examples/teams/get-membership.md new file mode 100644 index 000000000..3a2906b9c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/get-membership.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Membership result = await teams.getMembership( + teamId: '', + membershipId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/get-prefs.md b/examples/2.0.x/client-flutter/examples/teams/get-prefs.md new file mode 100644 index 000000000..e35006fa5 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/get-prefs.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Preferences result = await teams.getPrefs( + teamId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/get.md b/examples/2.0.x/client-flutter/examples/teams/get.md new file mode 100644 index 000000000..2a71db42b --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/get.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Team result = await teams.get( + teamId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/list-memberships.md b/examples/2.0.x/client-flutter/examples/teams/list-memberships.md new file mode 100644 index 000000000..bf643511c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/list-memberships.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +MembershipList result = await teams.listMemberships( + teamId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/list.md b/examples/2.0.x/client-flutter/examples/teams/list.md new file mode 100644 index 000000000..2de4ebfe8 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/list.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +TeamList result = await teams.list( + queries: [], // optional + search: '', // optional + total: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/update-membership-status.md b/examples/2.0.x/client-flutter/examples/teams/update-membership-status.md new file mode 100644 index 000000000..ebb924b0a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/update-membership-status.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Membership result = await teams.updateMembershipStatus( + teamId: '', + membershipId: '', + userId: '', + secret: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/update-membership.md b/examples/2.0.x/client-flutter/examples/teams/update-membership.md new file mode 100644 index 000000000..2d7c25c87 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/update-membership.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Membership result = await teams.updateMembership( + teamId: '', + membershipId: '', + roles: [], +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/update-name.md b/examples/2.0.x/client-flutter/examples/teams/update-name.md new file mode 100644 index 000000000..629e76082 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/update-name.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Team result = await teams.updateName( + teamId: '', + name: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/teams/update-prefs.md b/examples/2.0.x/client-flutter/examples/teams/update-prefs.md new file mode 100644 index 000000000..1a53c4985 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/teams/update-prefs.md @@ -0,0 +1,14 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Teams teams = Teams(client); + +Preferences result = await teams.updatePrefs( + teamId: '', + prefs: {}, +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/create-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..fc39a7c10 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/create-document.md @@ -0,0 +1,30 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.createDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-flutter/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..a994693e3 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/create-operations.md @@ -0,0 +1,24 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.createOperations( + transactionId: '', + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/create-query.md b/examples/2.0.x/client-flutter/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..fa41ee5c5 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/create-query.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.createQuery( + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-flutter/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..9c8c96d3b --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/create-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.createTransaction( + ttl: 60, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..7827d9c36 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/delete-document.md @@ -0,0 +1,16 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteDocument( + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-flutter/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..e4b82888f --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/get-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..28e544b37 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/get-document.md @@ -0,0 +1,17 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.getDocument( + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-flutter/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..1d191d09c --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/get-transaction.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.getTransaction( + transactionId: '', +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-flutter/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..03b4931de --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/list-documents.md @@ -0,0 +1,18 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.listDocuments( + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-flutter/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..fb7f83dbf --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/list-transactions.md @@ -0,0 +1,13 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +TransactionList result = await vectorsDB.listTransactions( + queries: [], // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/update-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..8c2a90919 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.updateDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-flutter/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..1abd8b028 --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/update-transaction.md @@ -0,0 +1,15 @@ +```dart +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.updateTransaction( + transactionId: '', + commit: false, // optional + rollback: false, // optional +); +``` diff --git a/examples/2.0.x/client-flutter/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-flutter/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..1367bba4a --- /dev/null +++ b/examples/2.0.x/client-flutter/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```dart +import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/permission.dart'; +import 'package:appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.upsertDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +); +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-anonymous-session.md b/examples/2.0.x/client-graphql/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..c040efb8c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-anonymous-session.md @@ -0,0 +1,35 @@ +```graphql +mutation { + accountCreateAnonymousSession { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-email-password-session.md b/examples/2.0.x/client-graphql/examples/account/create-email-password-session.md new file mode 100644 index 000000000..c68a4feb2 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-email-password-session.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountCreateEmailPasswordSession( + email: "email@example.com", + password: "password" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-email-token.md b/examples/2.0.x/client-graphql/examples/account/create-email-token.md new file mode 100644 index 000000000..f9db2e2cc --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-email-token.md @@ -0,0 +1,16 @@ +```graphql +mutation { + accountCreateEmailToken( + userId: "", + email: "email@example.com", + phrase: false + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-email-verification.md b/examples/2.0.x/client-graphql/examples/account/create-email-verification.md new file mode 100644 index 000000000..3a4c559b2 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-email-verification.md @@ -0,0 +1,14 @@ +```graphql +mutation { + accountCreateEmailVerification( + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-jwt.md b/examples/2.0.x/client-graphql/examples/account/create-jwt.md new file mode 100644 index 000000000..8bc8f9acd --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-jwt.md @@ -0,0 +1,9 @@ +```graphql +mutation { + accountCreateJWT( + duration: 0 + ) { + jwt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-magic-url-token.md b/examples/2.0.x/client-graphql/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..59b2c94f2 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-magic-url-token.md @@ -0,0 +1,17 @@ +```graphql +mutation { + accountCreateMagicURLToken( + userId: "", + email: "email@example.com", + url: "https://example.com", + phrase: false + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-mfa-authenticator.md b/examples/2.0.x/client-graphql/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..a3920a197 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-mfa-authenticator.md @@ -0,0 +1,10 @@ +```graphql +mutation { + accountCreateMFAAuthenticator( + type: "totp" + ) { + secret + uri + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-mfa-challenge.md b/examples/2.0.x/client-graphql/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..3da400f67 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-mfa-challenge.md @@ -0,0 +1,12 @@ +```graphql +mutation { + accountCreateMFAChallenge( + factor: "email" + ) { + _id + _createdAt + userId + expire + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/client-graphql/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..9f1c3596e --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```graphql +mutation { + accountCreateMFARecoveryCodes { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-phone-token.md b/examples/2.0.x/client-graphql/examples/account/create-phone-token.md new file mode 100644 index 000000000..e382df55c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-phone-token.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountCreatePhoneToken( + userId: "", + phone: "+12065550100" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-phone-verification.md b/examples/2.0.x/client-graphql/examples/account/create-phone-verification.md new file mode 100644 index 000000000..88ce51a14 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-phone-verification.md @@ -0,0 +1,12 @@ +```graphql +mutation { + accountCreatePhoneVerification { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-push-target.md b/examples/2.0.x/client-graphql/examples/account/create-push-target.md new file mode 100644 index 000000000..3b47523db --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-push-target.md @@ -0,0 +1,19 @@ +```graphql +mutation { + accountCreatePushTarget( + targetId: "", + identifier: "", + providerId: "" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-recovery.md b/examples/2.0.x/client-graphql/examples/account/create-recovery.md new file mode 100644 index 000000000..f72f5a653 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-recovery.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountCreateRecovery( + email: "email@example.com", + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-session.md b/examples/2.0.x/client-graphql/examples/account/create-session.md new file mode 100644 index 000000000..b5dda77e1 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-session.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountCreateSession( + userId: "", + secret: "" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create-verification.md b/examples/2.0.x/client-graphql/examples/account/create-verification.md new file mode 100644 index 000000000..818efe4dd --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create-verification.md @@ -0,0 +1,14 @@ +```graphql +mutation { + accountCreateVerification( + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/create.md b/examples/2.0.x/client-graphql/examples/account/create.md new file mode 100644 index 000000000..46d379ac4 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/create.md @@ -0,0 +1,49 @@ +```graphql +mutation { + accountCreate( + userId: "", + email: "email@example.com", + password: "password", + name: "" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/delete-identity.md b/examples/2.0.x/client-graphql/examples/account/delete-identity.md new file mode 100644 index 000000000..d984a934b --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/delete-identity.md @@ -0,0 +1,9 @@ +```graphql +mutation { + accountDeleteIdentity( + identityId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/client-graphql/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..7c78bc317 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,9 @@ +```graphql +mutation { + accountDeleteMFAAuthenticator( + type: "totp" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/delete-push-target.md b/examples/2.0.x/client-graphql/examples/account/delete-push-target.md new file mode 100644 index 000000000..a8588be93 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/delete-push-target.md @@ -0,0 +1,9 @@ +```graphql +mutation { + accountDeletePushTarget( + targetId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/delete-session.md b/examples/2.0.x/client-graphql/examples/account/delete-session.md new file mode 100644 index 000000000..36c3de994 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/delete-session.md @@ -0,0 +1,9 @@ +```graphql +mutation { + accountDeleteSession( + sessionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/delete-sessions.md b/examples/2.0.x/client-graphql/examples/account/delete-sessions.md new file mode 100644 index 000000000..65f6900e5 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/delete-sessions.md @@ -0,0 +1,7 @@ +```graphql +mutation { + accountDeleteSessions { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/client-graphql/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..430d5f42c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```graphql +query { + accountGetMFARecoveryCodes { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/get-prefs.md b/examples/2.0.x/client-graphql/examples/account/get-prefs.md new file mode 100644 index 000000000..f7920fc2e --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/get-prefs.md @@ -0,0 +1,7 @@ +```graphql +query { + accountGetPrefs { + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/get-session.md b/examples/2.0.x/client-graphql/examples/account/get-session.md new file mode 100644 index 000000000..0ff57c396 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/get-session.md @@ -0,0 +1,37 @@ +```graphql +query { + accountGetSession( + sessionId: "" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/get.md b/examples/2.0.x/client-graphql/examples/account/get.md new file mode 100644 index 000000000..0a4a636d5 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/get.md @@ -0,0 +1,44 @@ +```graphql +query { + accountGet { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/list-identities.md b/examples/2.0.x/client-graphql/examples/account/list-identities.md new file mode 100644 index 000000000..237e67175 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/list-identities.md @@ -0,0 +1,22 @@ +```graphql +query { + accountListIdentities( + queries: [], + total: false + ) { + total + identities { + _id + _createdAt + _updatedAt + userId + provider + providerUid + providerEmail + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/list-mfa-factors.md b/examples/2.0.x/client-graphql/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..cca647fec --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +```graphql +query { + accountListMFAFactors { + totp + phone + email + recoveryCode + custom + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/list-sessions.md b/examples/2.0.x/client-graphql/examples/account/list-sessions.md new file mode 100644 index 000000000..106419a76 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/list-sessions.md @@ -0,0 +1,38 @@ +```graphql +query { + accountListSessions { + total + sessions { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-email-verification.md b/examples/2.0.x/client-graphql/examples/account/update-email-verification.md new file mode 100644 index 000000000..9a045dd80 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-email-verification.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountUpdateEmailVerification( + userId: "", + secret: "" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-email.md b/examples/2.0.x/client-graphql/examples/account/update-email.md new file mode 100644 index 000000000..4bb0aa3a1 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-email.md @@ -0,0 +1,47 @@ +```graphql +mutation { + accountUpdateEmail( + email: "email@example.com", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-magic-url-session.md b/examples/2.0.x/client-graphql/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..92ad9693d --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-magic-url-session.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountUpdateMagicURLSession( + userId: "", + secret: "" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-mfa-authenticator.md b/examples/2.0.x/client-graphql/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..264c5029f --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-mfa-authenticator.md @@ -0,0 +1,47 @@ +```graphql +mutation { + accountUpdateMFAAuthenticator( + type: "totp", + otp: "" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-mfa-challenge.md b/examples/2.0.x/client-graphql/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..d3a438cf0 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-mfa-challenge.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountUpdateMFAChallenge( + challengeId: "", + otp: "" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/client-graphql/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..5f0c5c2d6 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```graphql +mutation { + accountUpdateMFARecoveryCodes { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-mfa.md b/examples/2.0.x/client-graphql/examples/account/update-mfa.md new file mode 100644 index 000000000..0028106a3 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-mfa.md @@ -0,0 +1,46 @@ +```graphql +mutation { + accountUpdateMFA( + mfa: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-name.md b/examples/2.0.x/client-graphql/examples/account/update-name.md new file mode 100644 index 000000000..3fdf28ae1 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-name.md @@ -0,0 +1,46 @@ +```graphql +mutation { + accountUpdateName( + name: "" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-password.md b/examples/2.0.x/client-graphql/examples/account/update-password.md new file mode 100644 index 000000000..1864a76ac --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-password.md @@ -0,0 +1,47 @@ +```graphql +mutation { + accountUpdatePassword( + password: "password", + oldPassword: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-phone-session.md b/examples/2.0.x/client-graphql/examples/account/update-phone-session.md new file mode 100644 index 000000000..aa054709d --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-phone-session.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountUpdatePhoneSession( + userId: "", + secret: "" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-phone-verification.md b/examples/2.0.x/client-graphql/examples/account/update-phone-verification.md new file mode 100644 index 000000000..2122d41be --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-phone-verification.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountUpdatePhoneVerification( + userId: "", + secret: "" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-phone.md b/examples/2.0.x/client-graphql/examples/account/update-phone.md new file mode 100644 index 000000000..7a3f7ce93 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-phone.md @@ -0,0 +1,47 @@ +```graphql +mutation { + accountUpdatePhone( + phone: "+12065550100", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-prefs.md b/examples/2.0.x/client-graphql/examples/account/update-prefs.md new file mode 100644 index 000000000..868ef3ef3 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-prefs.md @@ -0,0 +1,46 @@ +```graphql +mutation { + accountUpdatePrefs( + prefs: "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-push-target.md b/examples/2.0.x/client-graphql/examples/account/update-push-target.md new file mode 100644 index 000000000..9cd77d826 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-push-target.md @@ -0,0 +1,18 @@ +```graphql +mutation { + accountUpdatePushTarget( + targetId: "", + identifier: "" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-recovery.md b/examples/2.0.x/client-graphql/examples/account/update-recovery.md new file mode 100644 index 000000000..8d4c37a99 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-recovery.md @@ -0,0 +1,16 @@ +```graphql +mutation { + accountUpdateRecovery( + userId: "", + secret: "", + password: "password" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-session.md b/examples/2.0.x/client-graphql/examples/account/update-session.md new file mode 100644 index 000000000..c045df3c1 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-session.md @@ -0,0 +1,37 @@ +```graphql +mutation { + accountUpdateSession( + sessionId: "" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-status.md b/examples/2.0.x/client-graphql/examples/account/update-status.md new file mode 100644 index 000000000..4737887be --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-status.md @@ -0,0 +1,44 @@ +```graphql +mutation { + accountUpdateStatus { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/account/update-verification.md b/examples/2.0.x/client-graphql/examples/account/update-verification.md new file mode 100644 index 000000000..927ce4953 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/account/update-verification.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountUpdateVerification( + userId: "", + secret: "" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-browser.md b/examples/2.0.x/client-graphql/examples/avatars/get-browser.md new file mode 100644 index 000000000..2f432681b --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-browser.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetBrowser( + code: "aa", + width: 0, + height: 0, + quality: -1 + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-credit-card.md b/examples/2.0.x/client-graphql/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..952c23021 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-credit-card.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetCreditCard( + code: "amex", + width: 0, + height: 0, + quality: -1 + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-favicon.md b/examples/2.0.x/client-graphql/examples/avatars/get-favicon.md new file mode 100644 index 000000000..22653ab58 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-favicon.md @@ -0,0 +1,9 @@ +```graphql +query { + avatarsGetFavicon( + url: "https://example.com" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-flag.md b/examples/2.0.x/client-graphql/examples/avatars/get-flag.md new file mode 100644 index 000000000..6444e6988 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-flag.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetFlag( + code: "af", + width: 0, + height: 0, + quality: -1 + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-image.md b/examples/2.0.x/client-graphql/examples/avatars/get-image.md new file mode 100644 index 000000000..8acc02134 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-image.md @@ -0,0 +1,11 @@ +```graphql +query { + avatarsGetImage( + url: "https://example.com", + width: 0, + height: 0 + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-initials.md b/examples/2.0.x/client-graphql/examples/avatars/get-initials.md new file mode 100644 index 000000000..c172740be --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-initials.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetInitials( + name: "", + width: 0, + height: 0, + background: "FFFFFF" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-photo.md b/examples/2.0.x/client-graphql/examples/avatars/get-photo.md new file mode 100644 index 000000000..101335eac --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-photo.md @@ -0,0 +1,16 @@ +```graphql +query { + avatarsGetPhoto( + width: 0, + height: 0, + quality: 0, + output: "png", + rating: "g", + userId: "current()", + emailHash: "", + name: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-qr.md b/examples/2.0.x/client-graphql/examples/avatars/get-qr.md new file mode 100644 index 000000000..9206b404e --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-qr.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetQR( + text: "", + size: 1, + margin: 0, + download: false + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/avatars/get-screenshot.md b/examples/2.0.x/client-graphql/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..f5cab660c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/avatars/get-screenshot.md @@ -0,0 +1,28 @@ +```graphql +query { + avatarsGetScreenshot( + url: "https://example.com", + headers: "{\"Authorization\":\"Bearer token123\",\"X-Custom-Header\":\"value\"}", + viewportWidth: 1920, + viewportHeight: 1080, + scale: 2, + theme: "dark", + userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", + fullpage: true, + locale: "en-US", + timezone: "America/New_York", + latitude: 37.7749, + longitude: -122.4194, + accuracy: 100, + touch: true, + permissions: ["geolocation", "notifications"], + sleep: 3, + width: 800, + height: 600, + quality: 85, + output: "jpeg" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/create-document.md b/examples/2.0.x/client-graphql/examples/databases/create-document.md new file mode 100644 index 000000000..5ca3e372a --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/create-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesCreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/create-operations.md b/examples/2.0.x/client-graphql/examples/databases/create-operations.md new file mode 100644 index 000000000..7fa29cf3f --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + databasesCreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/create-transaction.md b/examples/2.0.x/client-graphql/examples/databases/create-transaction.md new file mode 100644 index 000000000..d28f2eadc --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + databasesCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/decrement-document-attribute.md b/examples/2.0.x/client-graphql/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..0b5428ae6 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesDecrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, + min: 0, + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/delete-document.md b/examples/2.0.x/client-graphql/examples/databases/delete-document.md new file mode 100644 index 000000000..f6d166b0c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/delete-document.md @@ -0,0 +1,12 @@ +```graphql +mutation { + databasesDeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/delete-transaction.md b/examples/2.0.x/client-graphql/examples/databases/delete-transaction.md new file mode 100644 index 000000000..9230d0c85 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + databasesDeleteTransaction( + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/get-document.md b/examples/2.0.x/client-graphql/examples/databases/get-document.md new file mode 100644 index 000000000..e188dee38 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/get-document.md @@ -0,0 +1,20 @@ +```graphql +query { + databasesGetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/get-transaction.md b/examples/2.0.x/client-graphql/examples/databases/get-transaction.md new file mode 100644 index 000000000..001554140 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + databasesGetTransaction( + transactionId: "" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/increment-document-attribute.md b/examples/2.0.x/client-graphql/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..8c3246a05 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/increment-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesIncrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, + max: 100, + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/list-documents.md b/examples/2.0.x/client-graphql/examples/databases/list-documents.md new file mode 100644 index 000000000..d0e331d0e --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/list-documents.md @@ -0,0 +1,24 @@ +```graphql +query { + databasesListDocuments( + databaseId: "", + collectionId: "", + queries: [], + transactionId: "", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/list-transactions.md b/examples/2.0.x/client-graphql/examples/databases/list-transactions.md new file mode 100644 index 000000000..2fc18db35 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + databasesListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/update-document.md b/examples/2.0.x/client-graphql/examples/databases/update-document.md new file mode 100644 index 000000000..5b9eaf050 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/update-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesUpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":33,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/update-transaction.md b/examples/2.0.x/client-graphql/examples/databases/update-transaction.md new file mode 100644 index 000000000..a2d8cb145 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + databasesUpdateTransaction( + transactionId: "", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/databases/upsert-document.md b/examples/2.0.x/client-graphql/examples/databases/upsert-document.md new file mode 100644 index 000000000..910971ed5 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/databases/upsert-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesUpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/create-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/create-document.md new file mode 100644 index 000000000..f8415e6af --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/create-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBCreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/create-documents.md b/examples/2.0.x/client-graphql/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..211576113 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/create-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBCreateDocuments( + databaseId: "", + collectionId: "", + documents: [], + transactionId: "" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/create-operations.md b/examples/2.0.x/client-graphql/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..153d00770 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + documentsDBCreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-graphql/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..75a9d53d4 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + documentsDBCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-graphql/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..180e2af17 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBDecrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, + min: 0, + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/delete-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..64f03c698 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/delete-document.md @@ -0,0 +1,12 @@ +```graphql +mutation { + documentsDBDeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-graphql/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..d6cea68f2 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + documentsDBDeleteTransaction( + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/get-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/get-document.md new file mode 100644 index 000000000..970f56656 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/get-document.md @@ -0,0 +1,20 @@ +```graphql +query { + documentsDBGetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-graphql/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..76e3dd728 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + documentsDBGetTransaction( + transactionId: "" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-graphql/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..cb70414fd --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBIncrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 1, + max: 100, + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/list-documents.md b/examples/2.0.x/client-graphql/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..89a23cf05 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/list-documents.md @@ -0,0 +1,24 @@ +```graphql +query { + documentsDBListDocuments( + databaseId: "", + collectionId: "", + queries: [], + transactionId: "", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-graphql/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..2569dde05 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + documentsDBListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/update-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/update-document.md new file mode 100644 index 000000000..40a4898c9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/update-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBUpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-graphql/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..a9616ca48 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + documentsDBUpdateTransaction( + transactionId: "", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-graphql/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..1b75a2830 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/documentsdb/upsert-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBUpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/functions/create-execution.md b/examples/2.0.x/client-graphql/examples/functions/create-execution.md new file mode 100644 index 000000000..1009c36d5 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/functions/create-execution.md @@ -0,0 +1,39 @@ +```graphql +mutation { + functionsCreateExecution( + functionId: "", + body: "", + async: false, + path: "", + method: "GET", + headers: "{}", + scheduledAt: "" + ) { + _id + _createdAt + _updatedAt + _permissions + resourceId + resourceType + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/functions/get-execution.md b/examples/2.0.x/client-graphql/examples/functions/get-execution.md new file mode 100644 index 000000000..314b7423e --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/functions/get-execution.md @@ -0,0 +1,34 @@ +```graphql +query { + functionsGetExecution( + functionId: "", + executionId: "" + ) { + _id + _createdAt + _updatedAt + _permissions + resourceId + resourceType + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/functions/list-executions.md b/examples/2.0.x/client-graphql/examples/functions/list-executions.md new file mode 100644 index 000000000..b76e92aca --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/functions/list-executions.md @@ -0,0 +1,38 @@ +```graphql +query { + functionsListExecutions( + functionId: "", + queries: [], + total: false + ) { + total + executions { + _id + _createdAt + _updatedAt + _permissions + resourceId + resourceType + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/locale/get.md b/examples/2.0.x/client-graphql/examples/locale/get.md new file mode 100644 index 000000000..c591b694c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/locale/get.md @@ -0,0 +1,13 @@ +```graphql +query { + localeGet { + ip + countryCode + country + continentCode + continent + eu + currency + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/locale/list-codes.md b/examples/2.0.x/client-graphql/examples/locale/list-codes.md new file mode 100644 index 000000000..0e3967246 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +```graphql +query { + localeListCodes { + total + localeCodes { + code + name + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/locale/list-continents.md b/examples/2.0.x/client-graphql/examples/locale/list-continents.md new file mode 100644 index 000000000..16ad0fd94 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +```graphql +query { + localeListContinents { + total + continents { + name + code + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/locale/list-countries-eu.md b/examples/2.0.x/client-graphql/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..293d32c9c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +```graphql +query { + localeListCountriesEU { + total + countries { + name + code + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/locale/list-countries-phones.md b/examples/2.0.x/client-graphql/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..b17b065e3 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/locale/list-countries-phones.md @@ -0,0 +1,12 @@ +```graphql +query { + localeListCountriesPhones { + total + phones { + code + countryCode + countryName + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/locale/list-countries.md b/examples/2.0.x/client-graphql/examples/locale/list-countries.md new file mode 100644 index 000000000..15f566af0 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +```graphql +query { + localeListCountries { + total + countries { + name + code + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/locale/list-currencies.md b/examples/2.0.x/client-graphql/examples/locale/list-currencies.md new file mode 100644 index 000000000..374d67126 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/locale/list-currencies.md @@ -0,0 +1,16 @@ +```graphql +query { + localeListCurrencies { + total + currencies { + symbol + name + symbolNative + decimalDigits + rounding + code + namePlural + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/locale/list-languages.md b/examples/2.0.x/client-graphql/examples/locale/list-languages.md new file mode 100644 index 000000000..ed108f5a4 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/locale/list-languages.md @@ -0,0 +1,12 @@ +```graphql +query { + localeListLanguages { + total + languages { + name + code + nativeName + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/messaging/create-subscriber.md b/examples/2.0.x/client-graphql/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..50d67e14f --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/messaging/create-subscriber.md @@ -0,0 +1,29 @@ +```graphql +mutation { + messagingCreateSubscriber( + topicId: "", + subscriberId: "", + targetId: "" + ) { + _id + _createdAt + _updatedAt + targetId + target { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + userId + userName + topicId + providerType + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/messaging/delete-subscriber.md b/examples/2.0.x/client-graphql/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..81c5558ad --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/messaging/delete-subscriber.md @@ -0,0 +1,10 @@ +```graphql +mutation { + messagingDeleteSubscriber( + topicId: "", + subscriberId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/presences/delete.md b/examples/2.0.x/client-graphql/examples/presences/delete.md new file mode 100644 index 000000000..cc8294d0c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/presences/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + presencesDelete( + presenceId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/presences/get.md b/examples/2.0.x/client-graphql/examples/presences/get.md new file mode 100644 index 000000000..c7c9da818 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/presences/get.md @@ -0,0 +1,17 @@ +```graphql +query { + presencesGet( + presenceId: "" + ) { + _id + _createdAt + _updatedAt + _permissions + userId + status + source + expiresAt + metadata + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/presences/list.md b/examples/2.0.x/client-graphql/examples/presences/list.md new file mode 100644 index 000000000..ff95bbd1c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/presences/list.md @@ -0,0 +1,22 @@ +```graphql +query { + presencesList( + queries: [], + total: false, + ttl: 0 + ) { + total + presences { + _id + _createdAt + _updatedAt + _permissions + userId + status + source + expiresAt + metadata + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/presences/update.md b/examples/2.0.x/client-graphql/examples/presences/update.md new file mode 100644 index 000000000..82f9c9dbc --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/presences/update.md @@ -0,0 +1,22 @@ +```graphql +mutation { + presencesUpdate( + presenceId: "", + status: "", + expiresAt: "2020-10-15T06:38:00.000+00:00", + metadata: "{}", + permissions: ["read(\"any\")"], + purge: false + ) { + _id + _createdAt + _updatedAt + _permissions + userId + status + source + expiresAt + metadata + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/presences/upsert.md b/examples/2.0.x/client-graphql/examples/presences/upsert.md new file mode 100644 index 000000000..451f53b04 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/presences/upsert.md @@ -0,0 +1,21 @@ +```graphql +mutation { + presencesUpsert( + presenceId: "", + status: "", + permissions: ["read(\"any\")"], + expiresAt: "2020-10-15T06:38:00.000+00:00", + metadata: "{}" + ) { + _id + _createdAt + _updatedAt + _permissions + userId + status + source + expiresAt + metadata + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/create-file.md b/examples/2.0.x/client-graphql/examples/storage/create-file.md new file mode 100644 index 000000000..ed33222ed --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/storage/create-file.md @@ -0,0 +1,26 @@ +```graphql +POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file, permissions: $permissions, folder: $folder) { id }" }, "variables": { "bucketId": "", "fileId": "", "file": null, "permissions": ["read(\"any\")"], "folder": "photos/2026" } } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="map" + +{ "0": ["variables.file"], } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="0"; filename="file.ext" + +File contents + +--cec8e8123c05ba25-- +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/delete-file.md b/examples/2.0.x/client-graphql/examples/storage/delete-file.md new file mode 100644 index 000000000..c36fa0e94 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/storage/delete-file.md @@ -0,0 +1,10 @@ +```graphql +mutation { + storageDeleteFile( + bucketId: "", + fileId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/get-file-download.md b/examples/2.0.x/client-graphql/examples/storage/get-file-download.md new file mode 100644 index 000000000..f323f21e2 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/storage/get-file-download.md @@ -0,0 +1,11 @@ +```graphql +query { + storageGetFileDownload( + bucketId: "", + fileId: "", + token: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/get-file-preview.md b/examples/2.0.x/client-graphql/examples/storage/get-file-preview.md new file mode 100644 index 000000000..d4cc5edf0 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/storage/get-file-preview.md @@ -0,0 +1,22 @@ +```graphql +query { + storageGetFilePreview( + bucketId: "", + fileId: "", + width: 0, + height: 0, + gravity: "center", + quality: -1, + borderWidth: 0, + borderColor: "FFFFFF", + borderRadius: 0, + opacity: 0, + rotation: -360, + background: "FFFFFF", + output: "jpg", + token: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/get-file-view.md b/examples/2.0.x/client-graphql/examples/storage/get-file-view.md new file mode 100644 index 000000000..7871a3111 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/storage/get-file-view.md @@ -0,0 +1,11 @@ +```graphql +query { + storageGetFileView( + bucketId: "", + fileId: "", + token: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/get-file.md b/examples/2.0.x/client-graphql/examples/storage/get-file.md new file mode 100644 index 000000000..3bbbfcb4b --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/storage/get-file.md @@ -0,0 +1,25 @@ +```graphql +query { + storageGetFile( + bucketId: "", + fileId: "" + ) { + _id + bucketId + _createdAt + _updatedAt + _permissions + name + folder + key + signature + mimeType + sizeOriginal + sizeActual + chunksTotal + chunksUploaded + encryption + compression + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/list-files.md b/examples/2.0.x/client-graphql/examples/storage/list-files.md new file mode 100644 index 000000000..974b01a7f --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/storage/list-files.md @@ -0,0 +1,30 @@ +```graphql +query { + storageListFiles( + bucketId: "", + queries: [], + search: "", + total: false + ) { + total + files { + _id + bucketId + _createdAt + _updatedAt + _permissions + name + folder + key + signature + mimeType + sizeOriginal + sizeActual + chunksTotal + chunksUploaded + encryption + compression + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/storage/update-file.md b/examples/2.0.x/client-graphql/examples/storage/update-file.md new file mode 100644 index 000000000..ace17f9b1 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/storage/update-file.md @@ -0,0 +1,27 @@ +```graphql +mutation { + storageUpdateFile( + bucketId: "", + fileId: "", + name: "", + permissions: ["read(\"any\")"] + ) { + _id + bucketId + _createdAt + _updatedAt + _permissions + name + folder + key + signature + mimeType + sizeOriginal + sizeActual + chunksTotal + chunksUploaded + encryption + compression + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/create-operations.md b/examples/2.0.x/client-graphql/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..f5721ece9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + tablesDBCreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "tableId": "", + "rowId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/create-row.md b/examples/2.0.x/client-graphql/examples/tablesdb/create-row.md new file mode 100644 index 000000000..556147030 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/create-row.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBCreateRow( + databaseId: "", + tableId: "", + rowId: "", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/create-transaction.md b/examples/2.0.x/client-graphql/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..2ecb30310 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + tablesDBCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/client-graphql/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..203ed56e9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBDecrementRowColumn( + databaseId: "", + tableId: "", + rowId: "", + column: "", + value: 1, + min: 0, + transactionId: "" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/delete-row.md b/examples/2.0.x/client-graphql/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..0acff213e --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/delete-row.md @@ -0,0 +1,12 @@ +```graphql +mutation { + tablesDBDeleteRow( + databaseId: "", + tableId: "", + rowId: "", + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/delete-transaction.md b/examples/2.0.x/client-graphql/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..e12bd209a --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + tablesDBDeleteTransaction( + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/get-row.md b/examples/2.0.x/client-graphql/examples/tablesdb/get-row.md new file mode 100644 index 000000000..354f847dc --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/get-row.md @@ -0,0 +1,20 @@ +```graphql +query { + tablesDBGetRow( + databaseId: "", + tableId: "", + rowId: "", + queries: [], + transactionId: "" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/get-transaction.md b/examples/2.0.x/client-graphql/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..0c520f611 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + tablesDBGetTransaction( + transactionId: "" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/increment-row-column.md b/examples/2.0.x/client-graphql/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..1137e3e4d --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/increment-row-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBIncrementRowColumn( + databaseId: "", + tableId: "", + rowId: "", + column: "", + value: 1, + max: 100, + transactionId: "" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/list-rows.md b/examples/2.0.x/client-graphql/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..6927344f1 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/list-rows.md @@ -0,0 +1,24 @@ +```graphql +query { + tablesDBListRows( + databaseId: "", + tableId: "", + queries: [], + transactionId: "", + total: false, + ttl: 0 + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/list-transactions.md b/examples/2.0.x/client-graphql/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..bc3663bec --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + tablesDBListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/update-row.md b/examples/2.0.x/client-graphql/examples/tablesdb/update-row.md new file mode 100644 index 000000000..2f3abc144 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/update-row.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBUpdateRow( + databaseId: "", + tableId: "", + rowId: "", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":33,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/update-transaction.md b/examples/2.0.x/client-graphql/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..0d0986b85 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + tablesDBUpdateTransaction( + transactionId: "", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/tablesdb/upsert-row.md b/examples/2.0.x/client-graphql/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..027687876 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/tablesdb/upsert-row.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBUpsertRow( + databaseId: "", + tableId: "", + rowId: "", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":33,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/create-membership.md b/examples/2.0.x/client-graphql/examples/teams/create-membership.md new file mode 100644 index 000000000..67b153ea1 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/create-membership.md @@ -0,0 +1,29 @@ +```graphql +mutation { + teamsCreateMembership( + teamId: "", + roles: [], + email: "email@example.com", + userId: "", + phone: "+12065550100", + url: "https://example.com", + name: "" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/create.md b/examples/2.0.x/client-graphql/examples/teams/create.md new file mode 100644 index 000000000..c31af8335 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/create.md @@ -0,0 +1,18 @@ +```graphql +mutation { + teamsCreate( + teamId: "", + name: "", + roles: [] + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/delete-membership.md b/examples/2.0.x/client-graphql/examples/teams/delete-membership.md new file mode 100644 index 000000000..297d48689 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/delete-membership.md @@ -0,0 +1,10 @@ +```graphql +mutation { + teamsDeleteMembership( + teamId: "", + membershipId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/delete.md b/examples/2.0.x/client-graphql/examples/teams/delete.md new file mode 100644 index 000000000..924ab91c9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + teamsDelete( + teamId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/get-membership.md b/examples/2.0.x/client-graphql/examples/teams/get-membership.md new file mode 100644 index 000000000..cccc945b4 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/get-membership.md @@ -0,0 +1,24 @@ +```graphql +query { + teamsGetMembership( + teamId: "", + membershipId: "" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/get-prefs.md b/examples/2.0.x/client-graphql/examples/teams/get-prefs.md new file mode 100644 index 000000000..182735730 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/get-prefs.md @@ -0,0 +1,9 @@ +```graphql +query { + teamsGetPrefs( + teamId: "" + ) { + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/get.md b/examples/2.0.x/client-graphql/examples/teams/get.md new file mode 100644 index 000000000..17f4a5ee9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/get.md @@ -0,0 +1,16 @@ +```graphql +query { + teamsGet( + teamId: "" + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/list-memberships.md b/examples/2.0.x/client-graphql/examples/teams/list-memberships.md new file mode 100644 index 000000000..9f76ab1d5 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/list-memberships.md @@ -0,0 +1,29 @@ +```graphql +query { + teamsListMemberships( + teamId: "", + queries: [], + search: "", + total: false + ) { + total + memberships { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/list.md b/examples/2.0.x/client-graphql/examples/teams/list.md new file mode 100644 index 000000000..a714bd0bc --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/list.md @@ -0,0 +1,21 @@ +```graphql +query { + teamsList( + queries: [], + search: "", + total: false + ) { + total + teams { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/update-membership-status.md b/examples/2.0.x/client-graphql/examples/teams/update-membership-status.md new file mode 100644 index 000000000..2b86ad398 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/update-membership-status.md @@ -0,0 +1,26 @@ +```graphql +mutation { + teamsUpdateMembershipStatus( + teamId: "", + membershipId: "", + userId: "", + secret: "" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/update-membership.md b/examples/2.0.x/client-graphql/examples/teams/update-membership.md new file mode 100644 index 000000000..c08593729 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/update-membership.md @@ -0,0 +1,25 @@ +```graphql +mutation { + teamsUpdateMembership( + teamId: "", + membershipId: "", + roles: [] + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/update-name.md b/examples/2.0.x/client-graphql/examples/teams/update-name.md new file mode 100644 index 000000000..a3ce2bd1f --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/update-name.md @@ -0,0 +1,17 @@ +```graphql +mutation { + teamsUpdateName( + teamId: "", + name: "" + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/teams/update-prefs.md b/examples/2.0.x/client-graphql/examples/teams/update-prefs.md new file mode 100644 index 000000000..411431a12 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/teams/update-prefs.md @@ -0,0 +1,10 @@ +```graphql +mutation { + teamsUpdatePrefs( + teamId: "", + prefs: "{}" + ) { + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/create-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..e81b723e9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/create-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBCreateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{\"embeddings\":[0.12,-0.55,0.88,1.02],\"metadata\":{\"key\":\"value\"}}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-graphql/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..b1d86d55b --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + vectorsDBCreateOperations( + transactionId: "", + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/create-query.md b/examples/2.0.x/client-graphql/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..fac71fdf8 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/create-query.md @@ -0,0 +1,24 @@ +```graphql +mutation { + vectorsDBCreateQuery( + databaseId: "", + collectionId: "", + queries: [], + transactionId: "", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-graphql/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..d3057810c --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + vectorsDBCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..2da5f257d --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/delete-document.md @@ -0,0 +1,12 @@ +```graphql +mutation { + vectorsDBDeleteDocument( + databaseId: "", + collectionId: "", + documentId: "", + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-graphql/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..ba12d0e13 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + vectorsDBDeleteTransaction( + transactionId: "" + ) { + status + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/get-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..4a2ca99c9 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/get-document.md @@ -0,0 +1,20 @@ +```graphql +query { + vectorsDBGetDocument( + databaseId: "", + collectionId: "", + documentId: "", + queries: [], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-graphql/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..df2dbc325 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + vectorsDBGetTransaction( + transactionId: "" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-graphql/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..68f1ff5c7 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/list-documents.md @@ -0,0 +1,24 @@ +```graphql +query { + vectorsDBListDocuments( + databaseId: "", + collectionId: "", + queries: [], + transactionId: "", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-graphql/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..1f2ea4aa4 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + vectorsDBListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/update-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..328c52df5 --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/update-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBUpdateDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-graphql/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..106a7b51d --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + vectorsDBUpdateTransaction( + transactionId: "", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/client-graphql/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-graphql/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..21e56bc8b --- /dev/null +++ b/examples/2.0.x/client-graphql/examples/vectorsdb/upsert-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBUpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-anonymous-session.md b/examples/2.0.x/client-react-native/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..7047a74dc --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-anonymous-session.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createAnonymousSession(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-email-password-session.md b/examples/2.0.x/client-react-native/examples/account/create-email-password-session.md new file mode 100644 index 000000000..e38beaf79 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-email-password-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-email-token.md b/examples/2.0.x/client-react-native/examples/account/create-email-token.md new file mode 100644 index 000000000..9b9db8b8f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-email-token.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailToken({ + userId: '', + email: 'email@example.com', + phrase: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-email-verification.md b/examples/2.0.x/client-react-native/examples/account/create-email-verification.md new file mode 100644 index 000000000..1a42defdd --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-email-verification.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailVerification({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-jwt.md b/examples/2.0.x/client-react-native/examples/account/create-jwt.md new file mode 100644 index 000000000..77ecb531e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-jwt.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createJWT({ + duration: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-magic-url-token.md b/examples/2.0.x/client-react-native/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..95327d71e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-magic-url-token.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMagicURLToken({ + userId: '', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-mfa-authenticator.md b/examples/2.0.x/client-react-native/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..3b43a0241 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-mfa-authenticator.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticatorType } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAAuthenticator({ + type: AuthenticatorType.Totp, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-mfa-challenge.md b/examples/2.0.x/client-react-native/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..532343667 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-mfa-challenge.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticationFactor } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAChallenge({ + factor: AuthenticationFactor.Email, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/client-react-native/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..300096e99 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-session.md new file mode 100644 index 000000000..c90edc145 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, OAuthProvider } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +account.createOAuth2Session({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +}); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..c043fb78c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-o-auth-2-token.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, OAuthProvider } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +}); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-phone-token.md b/examples/2.0.x/client-react-native/examples/account/create-phone-token.md new file mode 100644 index 000000000..1bf53f9af --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-phone-token.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneToken({ + userId: '', + phone: '+12065550100', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-phone-verification.md b/examples/2.0.x/client-react-native/examples/account/create-phone-verification.md new file mode 100644 index 000000000..6588b6b22 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-phone-verification.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneVerification(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-push-target.md b/examples/2.0.x/client-react-native/examples/account/create-push-target.md new file mode 100644 index 000000000..da09d09d1 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-push-target.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPushTarget({ + targetId: '', + identifier: '', + providerId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-recovery.md b/examples/2.0.x/client-react-native/examples/account/create-recovery.md new file mode 100644 index 000000000..4d970c4f6 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-recovery.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-session.md b/examples/2.0.x/client-react-native/examples/account/create-session.md new file mode 100644 index 000000000..bcee0a800 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create-verification.md b/examples/2.0.x/client-react-native/examples/account/create-verification.md new file mode 100644 index 000000000..8c7be4e8f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create-verification.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createVerification({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/create.md b/examples/2.0.x/client-react-native/examples/account/create.md new file mode 100644 index 000000000..964d1c4d1 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/create.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.create({ + userId: '', + email: 'email@example.com', + password: 'password', + name: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/delete-identity.md b/examples/2.0.x/client-react-native/examples/account/delete-identity.md new file mode 100644 index 000000000..fbf4f7eca --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/delete-identity.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteIdentity({ + identityId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/client-react-native/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..faffbba64 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticatorType } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteMFAAuthenticator({ + type: AuthenticatorType.Totp, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/delete-push-target.md b/examples/2.0.x/client-react-native/examples/account/delete-push-target.md new file mode 100644 index 000000000..ab0bb9d43 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/delete-push-target.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deletePushTarget({ + targetId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/delete-session.md b/examples/2.0.x/client-react-native/examples/account/delete-session.md new file mode 100644 index 000000000..16f6df8a0 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/delete-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/delete-sessions.md b/examples/2.0.x/client-react-native/examples/account/delete-sessions.md new file mode 100644 index 000000000..0f1bc281c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/delete-sessions.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSessions(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/client-react-native/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..cd2a16efc --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/get-prefs.md b/examples/2.0.x/client-react-native/examples/account/get-prefs.md new file mode 100644 index 000000000..337523afe --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/get-prefs.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getPrefs(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/get-session.md b/examples/2.0.x/client-react-native/examples/account/get-session.md new file mode 100644 index 000000000..3676c4b2e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/get-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/get.md b/examples/2.0.x/client-react-native/examples/account/get.md new file mode 100644 index 000000000..7144a9eb3 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/get.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.get(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/list-identities.md b/examples/2.0.x/client-react-native/examples/account/list-identities.md new file mode 100644 index 000000000..24426d423 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/list-identities.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listIdentities({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/list-mfa-factors.md b/examples/2.0.x/client-react-native/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..82c643bcd --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/list-mfa-factors.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listMFAFactors(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/list-sessions.md b/examples/2.0.x/client-react-native/examples/account/list-sessions.md new file mode 100644 index 000000000..c8acda4d4 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/list-sessions.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listSessions(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-email-verification.md b/examples/2.0.x/client-react-native/examples/account/update-email-verification.md new file mode 100644 index 000000000..684ecfa8c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-email-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmailVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-email.md b/examples/2.0.x/client-react-native/examples/account/update-email.md new file mode 100644 index 000000000..ec0f8d643 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-email.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmail({ + email: 'email@example.com', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-magic-url-session.md b/examples/2.0.x/client-react-native/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..625453225 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-magic-url-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMagicURLSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-mfa-authenticator.md b/examples/2.0.x/client-react-native/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..4a954e855 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-mfa-authenticator.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, AuthenticatorType } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAAuthenticator({ + type: AuthenticatorType.Totp, + otp: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-mfa-challenge.md b/examples/2.0.x/client-react-native/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..b6521a692 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-mfa-challenge.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAChallenge({ + challengeId: '', + otp: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/client-react-native/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..fa03ccd0f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-mfa.md b/examples/2.0.x/client-react-native/examples/account/update-mfa.md new file mode 100644 index 000000000..c2973e41d --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-mfa.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFA({ + mfa: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-name.md b/examples/2.0.x/client-react-native/examples/account/update-name.md new file mode 100644 index 000000000..500e2f06e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-name.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateName({ + name: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-password.md b/examples/2.0.x/client-react-native/examples/account/update-password.md new file mode 100644 index 000000000..cf8ad5b60 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-password.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePassword({ + password: 'password', + oldPassword: 'password', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-phone-session.md b/examples/2.0.x/client-react-native/examples/account/update-phone-session.md new file mode 100644 index 000000000..d008f2af7 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-phone-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-phone-verification.md b/examples/2.0.x/client-react-native/examples/account/update-phone-verification.md new file mode 100644 index 000000000..0bc9a3f00 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-phone-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-phone.md b/examples/2.0.x/client-react-native/examples/account/update-phone.md new file mode 100644 index 000000000..d8537e97c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-phone.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhone({ + phone: '+12065550100', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-prefs.md b/examples/2.0.x/client-react-native/examples/account/update-prefs.md new file mode 100644 index 000000000..a7afc13af --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-prefs.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePrefs({ + prefs: { + language: 'en', + timezone: 'UTC', + darkTheme: true, + }, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-push-target.md b/examples/2.0.x/client-react-native/examples/account/update-push-target.md new file mode 100644 index 000000000..a759e5c5e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-push-target.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePushTarget({ + targetId: '', + identifier: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-recovery.md b/examples/2.0.x/client-react-native/examples/account/update-recovery.md new file mode 100644 index 000000000..87cc4f413 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-recovery.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateRecovery({ + userId: '', + secret: '', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-session.md b/examples/2.0.x/client-react-native/examples/account/update-session.md new file mode 100644 index 000000000..cc3f3216e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-status.md b/examples/2.0.x/client-react-native/examples/account/update-status.md new file mode 100644 index 000000000..48976e3cd --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-status.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateStatus(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/account/update-verification.md b/examples/2.0.x/client-react-native/examples/account/update-verification.md new file mode 100644 index 000000000..421643025 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/account/update-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-browser.md b/examples/2.0.x/client-react-native/examples/avatars/get-browser.md new file mode 100644 index 000000000..d748496c9 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-browser.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, Browser } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getBrowser({ + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-credit-card.md b/examples/2.0.x/client-react-native/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..604390fea --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-credit-card.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, CreditCard } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard({ + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-favicon.md b/examples/2.0.x/client-react-native/examples/avatars/get-favicon.md new file mode 100644 index 000000000..ec54e8c56 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-favicon.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Avatars } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFavicon({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-flag.md b/examples/2.0.x/client-react-native/examples/avatars/get-flag.md new file mode 100644 index 000000000..8e5f4d7bd --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-flag.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, Flag } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFlag({ + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-image.md b/examples/2.0.x/client-react-native/examples/avatars/get-image.md new file mode 100644 index 000000000..55abf9dca --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-image.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Avatars } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-initials.md b/examples/2.0.x/client-react-native/examples/avatars/get-initials.md new file mode 100644 index 000000000..bd4675aff --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-initials.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getInitials({ + name: '', // optional + width: 0, // optional + height: 0, // optional + background: 'FFFFFF', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-photo.md b/examples/2.0.x/client-react-native/examples/avatars/get-photo.md new file mode 100644 index 000000000..44ca362b9 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-photo.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Avatars } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getPhoto({ + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '', // optional + name: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-qr.md b/examples/2.0.x/client-react-native/examples/avatars/get-qr.md new file mode 100644 index 000000000..98c291b9d --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-qr.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getQR({ + text: '', + size: 1, // optional + margin: 0, // optional + download: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/avatars/get-screenshot.md b/examples/2.0.x/client-react-native/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..4e0402bc8 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/avatars/get-screenshot.md @@ -0,0 +1,48 @@ +```javascript +import { + Client, + Avatars, + BrowserTheme, + Timezone, + BrowserPermission, + ImageFormat, +} from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getScreenshot({ + url: 'https://example.com', + headers: { + Authorization: 'Bearer token123', + 'X-Custom-Header': 'value', + }, // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: BrowserTheme.Dark, // optional + userAgent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + fullpage: true, // optional + locale: 'en-US', // optional + timezone: Timezone.AfricaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [ + BrowserPermission.Geolocation, + BrowserPermission.Notifications, + ], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: ImageFormat.Jpeg, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/create-document.md b/examples/2.0.x/client-react-native/examples/databases/create-document.md new file mode 100644 index 000000000..5f4f0d8be --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/create-operations.md b/examples/2.0.x/client-react-native/examples/databases/create-operations.md new file mode 100644 index 000000000..29999609f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/create-transaction.md b/examples/2.0.x/client-react-native/examples/databases/create-transaction.md new file mode 100644 index 000000000..508008db1 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/decrement-document-attribute.md b/examples/2.0.x/client-react-native/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..efb34ee4a --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/delete-document.md b/examples/2.0.x/client-react-native/examples/databases/delete-document.md new file mode 100644 index 000000000..5b326f085 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/delete-transaction.md b/examples/2.0.x/client-react-native/examples/databases/delete-transaction.md new file mode 100644 index 000000000..b020fec4c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/get-document.md b/examples/2.0.x/client-react-native/examples/databases/get-document.md new file mode 100644 index 000000000..c4de18152 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/get-transaction.md b/examples/2.0.x/client-react-native/examples/databases/get-transaction.md new file mode 100644 index 000000000..76923162f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/increment-document-attribute.md b/examples/2.0.x/client-react-native/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..9da47e2a8 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/list-documents.md b/examples/2.0.x/client-react-native/examples/databases/list-documents.md new file mode 100644 index 000000000..c4f07bf9a --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/list-transactions.md b/examples/2.0.x/client-react-native/examples/databases/list-transactions.md new file mode 100644 index 000000000..051ea0f3a --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/update-document.md b/examples/2.0.x/client-react-native/examples/databases/update-document.md new file mode 100644 index 000000000..9aac365fb --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/update-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/update-transaction.md b/examples/2.0.x/client-react-native/examples/databases/update-transaction.md new file mode 100644 index 000000000..9f040f0b8 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/databases/upsert-document.md b/examples/2.0.x/client-react-native/examples/databases/upsert-document.md new file mode 100644 index 000000000..6d2102aa7 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/databases/upsert-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/create-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/create-document.md new file mode 100644 index 000000000..51d69a975 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/create-documents.md b/examples/2.0.x/client-react-native/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..891757c68 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/create-operations.md b/examples/2.0.x/client-react-native/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..41698bbf4 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-react-native/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..e535ea74b --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-react-native/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..ca7ed94fb --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/delete-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..ba07f8316 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-react-native/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..a537cad48 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/get-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/get-document.md new file mode 100644 index 000000000..64a5b43be --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-react-native/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..449f89245 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-react-native/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..80f4b0cc0 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/list-documents.md b/examples/2.0.x/client-react-native/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..b6a16cc2d --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-react-native/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..24c8dbdb1 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/update-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/update-document.md new file mode 100644 index 000000000..cad772ded --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-react-native/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..df1009a61 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-react-native/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..52af7040e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/functions/create-execution.md b/examples/2.0.x/client-react-native/examples/functions/create-execution.md new file mode 100644 index 000000000..7c0addc78 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/functions/create-execution.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Functions, ExecutionMethod } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createExecution({ + functionId: '', + body: '', // optional + async: false, // optional + xpath: '', // optional + method: ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/functions/get-execution.md b/examples/2.0.x/client-react-native/examples/functions/get-execution.md new file mode 100644 index 000000000..5f3bd5128 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/functions/get-execution.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getExecution({ + functionId: '', + executionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/functions/list-executions.md b/examples/2.0.x/client-react-native/examples/functions/list-executions.md new file mode 100644 index 000000000..fedf597a3 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/functions/list-executions.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Functions } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listExecutions({ + functionId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/graphql/mutation.md b/examples/2.0.x/client-react-native/examples/graphql/mutation.md new file mode 100644 index 000000000..f5e673a2f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/graphql/mutation.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Graphql } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.mutation({ + query: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/graphql/query.md b/examples/2.0.x/client-react-native/examples/graphql/query.md new file mode 100644 index 000000000..c9640ebeb --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/graphql/query.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Graphql } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.query({ + query: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/locale/get.md b/examples/2.0.x/client-react-native/examples/locale/get.md new file mode 100644 index 000000000..99bde954a --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/locale/get.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.get(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/locale/list-codes.md b/examples/2.0.x/client-react-native/examples/locale/list-codes.md new file mode 100644 index 000000000..f96a7ee39 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/locale/list-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/locale/list-continents.md b/examples/2.0.x/client-react-native/examples/locale/list-continents.md new file mode 100644 index 000000000..8973cfd4d --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/locale/list-continents.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listContinents(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/locale/list-countries-eu.md b/examples/2.0.x/client-react-native/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..f948ee69d --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/locale/list-countries-eu.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesEU(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/locale/list-countries-phones.md b/examples/2.0.x/client-react-native/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..7974d60ee --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/locale/list-countries-phones.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesPhones(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/locale/list-countries.md b/examples/2.0.x/client-react-native/examples/locale/list-countries.md new file mode 100644 index 000000000..b46bc615f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/locale/list-countries.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountries(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/locale/list-currencies.md b/examples/2.0.x/client-react-native/examples/locale/list-currencies.md new file mode 100644 index 000000000..28498d9a5 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/locale/list-currencies.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCurrencies(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/locale/list-languages.md b/examples/2.0.x/client-react-native/examples/locale/list-languages.md new file mode 100644 index 000000000..835b04de2 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/locale/list-languages.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listLanguages(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/messaging/create-subscriber.md b/examples/2.0.x/client-react-native/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..20f1368b3 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/messaging/create-subscriber.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSubscriber({ + topicId: '', + subscriberId: '', + targetId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/messaging/delete-subscriber.md b/examples/2.0.x/client-react-native/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..209c133fb --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/messaging/delete-subscriber.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Messaging } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteSubscriber({ + topicId: '', + subscriberId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/presences/delete.md b/examples/2.0.x/client-react-native/examples/presences/delete.md new file mode 100644 index 000000000..03e4a1075 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/presences/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Presences } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.delete({ + presenceId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/presences/get.md b/examples/2.0.x/client-react-native/examples/presences/get.md new file mode 100644 index 000000000..7358111b9 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/presences/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Presences } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.get({ + presenceId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/presences/list.md b/examples/2.0.x/client-react-native/examples/presences/list.md new file mode 100644 index 000000000..ea4f8fe81 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/presences/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Presences } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.list({ + queries: [], // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/presences/update.md b/examples/2.0.x/client-react-native/examples/presences/update.md new file mode 100644 index 000000000..a9a0dad7b --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/presences/update.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Presences, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.update({ + presenceId: '', + status: '', // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional + permissions: [Permission.read(Role.any())], // optional + purge: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/presences/upsert.md b/examples/2.0.x/client-react-native/examples/presences/upsert.md new file mode 100644 index 000000000..09e216221 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/presences/upsert.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Presences, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.upsert({ + presenceId: '', + status: '', + permissions: [Permission.read(Role.any())], // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/create-file.md b/examples/2.0.x/client-react-native/examples/storage/create-file.md new file mode 100644 index 000000000..2901c4bd4 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/storage/create-file.md @@ -0,0 +1,24 @@ +```javascript +import { Client, Storage, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createFile({ + bucketId: '', + fileId: '', + file: { + name: 'image.png', + type: 'image/png', + size: 1024, + uri: 'file:///path/to/image.png', + }, + permissions: [Permission.read(Role.any())], // optional + folder: 'photos/2026', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/delete-file.md b/examples/2.0.x/client-react-native/examples/storage/delete-file.md new file mode 100644 index 000000000..c6ef83ceb --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/storage/delete-file.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Storage } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteFile({ + bucketId: '', + fileId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/get-file-download.md b/examples/2.0.x/client-react-native/examples/storage/get-file-download.md new file mode 100644 index 000000000..cba6f31c8 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/storage/get-file-download.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Storage } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileDownload({ + bucketId: '', + fileId: '', + token: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/get-file-preview.md b/examples/2.0.x/client-react-native/examples/storage/get-file-preview.md new file mode 100644 index 000000000..5be0eea8c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/storage/get-file-preview.md @@ -0,0 +1,33 @@ +```javascript +import { + Client, + Storage, + ImageGravity, + ImageFormat, +} from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFilePreview({ + bucketId: '', + fileId: '', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: 'FFFFFF', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: 'FFFFFF', // optional + output: ImageFormat.Jpg, // optional + token: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/get-file-view.md b/examples/2.0.x/client-react-native/examples/storage/get-file-view.md new file mode 100644 index 000000000..99b341613 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/storage/get-file-view.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Storage } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileView({ + bucketId: '', + fileId: '', + token: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/get-file.md b/examples/2.0.x/client-react-native/examples/storage/get-file.md new file mode 100644 index 000000000..80b9a17e4 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/storage/get-file.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Storage } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getFile({ + bucketId: '', + fileId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/list-files.md b/examples/2.0.x/client-react-native/examples/storage/list-files.md new file mode 100644 index 000000000..31b88fb52 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/storage/list-files.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Storage } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listFiles({ + bucketId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/storage/update-file.md b/examples/2.0.x/client-react-native/examples/storage/update-file.md new file mode 100644 index 000000000..417fb8111 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/storage/update-file.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Storage, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateFile({ + bucketId: '', + fileId: '', + name: '', // optional + permissions: [Permission.read(Role.any())], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/create-operations.md b/examples/2.0.x/client-react-native/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..9c1458fe4 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + tableId: '', + rowId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/create-row.md b/examples/2.0.x/client-react-native/examples/tablesdb/create-row.md new file mode 100644 index 000000000..c4d2cb4fe --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/create-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/create-transaction.md b/examples/2.0.x/client-react-native/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..87e53a18d --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/client-react-native/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..a3a845f8a --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.decrementRowColumn({ + databaseId: '', + tableId: '', + rowId: '', + column: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/delete-row.md b/examples/2.0.x/client-react-native/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..4a32be86c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/delete-row.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteRow({ + databaseId: '', + tableId: '', + rowId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/delete-transaction.md b/examples/2.0.x/client-react-native/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..3cbf63e9f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/get-row.md b/examples/2.0.x/client-react-native/examples/tablesdb/get-row.md new file mode 100644 index 000000000..fe2c7769c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/get-row.md @@ -0,0 +1,19 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getRow({ + databaseId: '', + tableId: '', + rowId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/get-transaction.md b/examples/2.0.x/client-react-native/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..8776ee669 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/increment-row-column.md b/examples/2.0.x/client-react-native/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..189851478 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/increment-row-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.incrementRowColumn({ + databaseId: '', + tableId: '', + rowId: '', + column: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/list-rows.md b/examples/2.0.x/client-react-native/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..6c0cc4179 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/list-rows.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listRows({ + databaseId: '', + tableId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/list-transactions.md b/examples/2.0.x/client-react-native/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..e28ff1415 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/update-row.md b/examples/2.0.x/client-react-native/examples/tablesdb/update-row.md new file mode 100644 index 000000000..a330449ef --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/update-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/update-transaction.md b/examples/2.0.x/client-react-native/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..d89cc16ee --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/tablesdb/upsert-row.md b/examples/2.0.x/client-react-native/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..916919316 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/tablesdb/upsert-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.upsertRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/create-membership.md b/examples/2.0.x/client-react-native/examples/teams/create-membership.md new file mode 100644 index 000000000..e7fe0d72c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/create-membership.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.createMembership({ + teamId: '', + roles: [], + email: 'email@example.com', // optional + userId: '', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/create.md b/examples/2.0.x/client-react-native/examples/teams/create.md new file mode 100644 index 000000000..0bd3adf53 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.create({ + teamId: '', + name: '', + roles: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/delete-membership.md b/examples/2.0.x/client-react-native/examples/teams/delete-membership.md new file mode 100644 index 000000000..f8fb2c970 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/delete-membership.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteMembership({ + teamId: '', + membershipId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/delete.md b/examples/2.0.x/client-react-native/examples/teams/delete.md new file mode 100644 index 000000000..e5927ef8c --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.delete({ + teamId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/get-membership.md b/examples/2.0.x/client-react-native/examples/teams/get-membership.md new file mode 100644 index 000000000..b73f234ea --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/get-membership.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getMembership({ + teamId: '', + membershipId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/get-prefs.md b/examples/2.0.x/client-react-native/examples/teams/get-prefs.md new file mode 100644 index 000000000..78fd30c62 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/get-prefs.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getPrefs({ + teamId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/get.md b/examples/2.0.x/client-react-native/examples/teams/get.md new file mode 100644 index 000000000..fb2fc31f6 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.get({ + teamId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/list-memberships.md b/examples/2.0.x/client-react-native/examples/teams/list-memberships.md new file mode 100644 index 000000000..14104a631 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/list-memberships.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listMemberships({ + teamId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/list.md b/examples/2.0.x/client-react-native/examples/teams/list.md new file mode 100644 index 000000000..5f3fb9b90 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.list({ + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/update-membership-status.md b/examples/2.0.x/client-react-native/examples/teams/update-membership-status.md new file mode 100644 index 000000000..23d0479a8 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/update-membership-status.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembershipStatus({ + teamId: '', + membershipId: '', + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/update-membership.md b/examples/2.0.x/client-react-native/examples/teams/update-membership.md new file mode 100644 index 000000000..92e596961 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/update-membership.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembership({ + teamId: '', + membershipId: '', + roles: [], +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/update-name.md b/examples/2.0.x/client-react-native/examples/teams/update-name.md new file mode 100644 index 000000000..c18ed1283 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/update-name.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateName({ + teamId: '', + name: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/teams/update-prefs.md b/examples/2.0.x/client-react-native/examples/teams/update-prefs.md new file mode 100644 index 000000000..1e068740a --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/teams/update-prefs.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updatePrefs({ + teamId: '', + prefs: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/create-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..f2aaf4729 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + embeddings: [0.12, -0.55, 0.88, 1.02], + metadata: { + key: 'value', + }, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-react-native/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..86be153fa --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/create-query.md b/examples/2.0.x/client-react-native/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..af9820000 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createQuery({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-react-native/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..8377619f7 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..5046144d5 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-react-native/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..fc6cc5c53 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/get-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..1545ae996 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-react-native/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..b6e81c948 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-react-native/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..fa79136ab --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-react-native/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..8a009a985 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/update-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..d2fa8794f --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-react-native/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..d1392088e --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-react-native/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-react-native/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..cabe87c07 --- /dev/null +++ b/examples/2.0.x/client-react-native/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-anonymous-session.md b/examples/2.0.x/client-rest/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..ea0b5d45e --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-anonymous-session.md @@ -0,0 +1,9 @@ +```http +POST /v1/account/sessions/anonymous HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-email-password-session.md b/examples/2.0.x/client-rest/examples/account/create-email-password-session.md new file mode 100644 index 000000000..27068af95 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-email-password-session.md @@ -0,0 +1,13 @@ +```http +POST /v1/account/sessions/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "email": "email@example.com", + "password": "password" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-email-token.md b/examples/2.0.x/client-rest/examples/account/create-email-token.md new file mode 100644 index 000000000..78ef041a0 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-email-token.md @@ -0,0 +1,14 @@ +```http +POST /v1/account/tokens/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "email": "email@example.com", + "phrase": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-email-verification.md b/examples/2.0.x/client-rest/examples/account/create-email-verification.md new file mode 100644 index 000000000..836b98d78 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-email-verification.md @@ -0,0 +1,12 @@ +```http +POST /v1/account/verifications/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "url": "https://example.com" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-jwt.md b/examples/2.0.x/client-rest/examples/account/create-jwt.md new file mode 100644 index 000000000..799783a1e --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-jwt.md @@ -0,0 +1,12 @@ +```http +POST /v1/account/jwts HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "duration": 0 +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-magic-url-token.md b/examples/2.0.x/client-rest/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..29eb52ac5 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-magic-url-token.md @@ -0,0 +1,15 @@ +```http +POST /v1/account/tokens/magic-url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "email": "email@example.com", + "url": "https://example.com", + "phrase": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-mfa-authenticator.md b/examples/2.0.x/client-rest/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..be21af4b7 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-mfa-authenticator.md @@ -0,0 +1,9 @@ +```http +POST /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-mfa-challenge.md b/examples/2.0.x/client-rest/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..0175ac0e6 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-mfa-challenge.md @@ -0,0 +1,12 @@ +```http +POST /v1/account/mfa/challenges HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "factor": "email" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/client-rest/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..16c75df10 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```http +POST /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-rest/examples/account/create-o-auth-2-session.md new file mode 100644 index 000000000..c8faf0e3e --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-o-auth-2-session.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/sessions/oauth2/{provider} HTTP/1.1 +Host: cloud.appwrite.io +Accept: text/html +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-rest/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..b19a35c01 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-o-auth-2-token.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/tokens/oauth2/{provider} HTTP/1.1 +Host: cloud.appwrite.io +Accept: text/html +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-phone-token.md b/examples/2.0.x/client-rest/examples/account/create-phone-token.md new file mode 100644 index 000000000..b1d2bb78d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-phone-token.md @@ -0,0 +1,13 @@ +```http +POST /v1/account/tokens/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "phone": "+12065550100" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-phone-verification.md b/examples/2.0.x/client-rest/examples/account/create-phone-verification.md new file mode 100644 index 000000000..e14cfad29 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-phone-verification.md @@ -0,0 +1,9 @@ +```http +POST /v1/account/verifications/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-push-target.md b/examples/2.0.x/client-rest/examples/account/create-push-target.md new file mode 100644 index 000000000..adf60a163 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-push-target.md @@ -0,0 +1,14 @@ +```http +POST /v1/account/targets/push HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "targetId": "", + "identifier": "", + "providerId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-recovery.md b/examples/2.0.x/client-rest/examples/account/create-recovery.md new file mode 100644 index 000000000..eb5b43a9b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-recovery.md @@ -0,0 +1,13 @@ +```http +POST /v1/account/recovery HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "email": "email@example.com", + "url": "https://example.com" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-session.md b/examples/2.0.x/client-rest/examples/account/create-session.md new file mode 100644 index 000000000..751a63df9 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-session.md @@ -0,0 +1,13 @@ +```http +POST /v1/account/sessions/token HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "secret": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create-verification.md b/examples/2.0.x/client-rest/examples/account/create-verification.md new file mode 100644 index 000000000..836b98d78 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create-verification.md @@ -0,0 +1,12 @@ +```http +POST /v1/account/verifications/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "url": "https://example.com" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/create.md b/examples/2.0.x/client-rest/examples/account/create.md new file mode 100644 index 000000000..df2538b89 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/create.md @@ -0,0 +1,15 @@ +```http +POST /v1/account HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "email": "email@example.com", + "password": "password", + "name": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/delete-identity.md b/examples/2.0.x/client-rest/examples/account/delete-identity.md new file mode 100644 index 000000000..f20de5903 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/delete-identity.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/identities/{identityId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/client-rest/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..cbd62a55a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/delete-push-target.md b/examples/2.0.x/client-rest/examples/account/delete-push-target.md new file mode 100644 index 000000000..6c6479004 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/delete-push-target.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/targets/{targetId}/push HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/delete-session.md b/examples/2.0.x/client-rest/examples/account/delete-session.md new file mode 100644 index 000000000..cbb8c40c8 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/delete-session.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/delete-sessions.md b/examples/2.0.x/client-rest/examples/account/delete-sessions.md new file mode 100644 index 000000000..f36a3a5e5 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/delete-sessions.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/sessions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/client-rest/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..c4a6af661 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/get-prefs.md b/examples/2.0.x/client-rest/examples/account/get-prefs.md new file mode 100644 index 000000000..6d7f3cf50 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/get-prefs.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/prefs HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/get-session.md b/examples/2.0.x/client-rest/examples/account/get-session.md new file mode 100644 index 000000000..c97eb6b89 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/get-session.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/get.md b/examples/2.0.x/client-rest/examples/account/get.md new file mode 100644 index 000000000..c4a692e47 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/account HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/list-identities.md b/examples/2.0.x/client-rest/examples/account/list-identities.md new file mode 100644 index 000000000..1a29c60c5 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/list-identities.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/identities HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/list-mfa-factors.md b/examples/2.0.x/client-rest/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..20da67a89 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/list-mfa-factors.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/mfa/factors HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/list-sessions.md b/examples/2.0.x/client-rest/examples/account/list-sessions.md new file mode 100644 index 000000000..dd1d1e773 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/list-sessions.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/sessions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-email-verification.md b/examples/2.0.x/client-rest/examples/account/update-email-verification.md new file mode 100644 index 000000000..fb7c4c18c --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-email-verification.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/verifications/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "secret": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-email.md b/examples/2.0.x/client-rest/examples/account/update-email.md new file mode 100644 index 000000000..38120d9bb --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-email.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/account/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "email": "email@example.com", + "password": "password" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-magic-url-session.md b/examples/2.0.x/client-rest/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..5f9ed0a6b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-magic-url-session.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/sessions/magic-url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "secret": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-mfa-authenticator.md b/examples/2.0.x/client-rest/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..bbf28b896 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-mfa-authenticator.md @@ -0,0 +1,12 @@ +```http +PUT /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "otp": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-mfa-challenge.md b/examples/2.0.x/client-rest/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..3096e977b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-mfa-challenge.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/mfa/challenges HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "challengeId": "", + "otp": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/client-rest/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..489692edb --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-mfa.md b/examples/2.0.x/client-rest/examples/account/update-mfa.md new file mode 100644 index 000000000..a1258bc74 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-mfa.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/account/mfa HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "mfa": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-name.md b/examples/2.0.x/client-rest/examples/account/update-name.md new file mode 100644 index 000000000..558df6398 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-name.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/account/name HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "name": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-password.md b/examples/2.0.x/client-rest/examples/account/update-password.md new file mode 100644 index 000000000..963f4b8f7 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-password.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/account/password HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "password": "password", + "oldPassword": "password" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-phone-session.md b/examples/2.0.x/client-rest/examples/account/update-phone-session.md new file mode 100644 index 000000000..bccc8ca2b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-phone-session.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/sessions/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "secret": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-phone-verification.md b/examples/2.0.x/client-rest/examples/account/update-phone-verification.md new file mode 100644 index 000000000..6b8079122 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-phone-verification.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/verifications/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "secret": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-phone.md b/examples/2.0.x/client-rest/examples/account/update-phone.md new file mode 100644 index 000000000..ca021eb09 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-phone.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/account/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "phone": "+12065550100", + "password": "password" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-prefs.md b/examples/2.0.x/client-rest/examples/account/update-prefs.md new file mode 100644 index 000000000..b6d238ea9 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-prefs.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/account/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "prefs": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-push-target.md b/examples/2.0.x/client-rest/examples/account/update-push-target.md new file mode 100644 index 000000000..85d60e890 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-push-target.md @@ -0,0 +1,12 @@ +```http +PUT /v1/account/targets/{targetId}/push HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "identifier": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-recovery.md b/examples/2.0.x/client-rest/examples/account/update-recovery.md new file mode 100644 index 000000000..c8cda2d89 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +```http +PUT /v1/account/recovery HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "secret": "", + "password": "password" +} +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-session.md b/examples/2.0.x/client-rest/examples/account/update-session.md new file mode 100644 index 000000000..7b291854a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-session.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-status.md b/examples/2.0.x/client-rest/examples/account/update-status.md new file mode 100644 index 000000000..305c445ce --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-status.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/account/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/account/update-verification.md b/examples/2.0.x/client-rest/examples/account/update-verification.md new file mode 100644 index 000000000..fb7c4c18c --- /dev/null +++ b/examples/2.0.x/client-rest/examples/account/update-verification.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/verifications/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "secret": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-browser.md b/examples/2.0.x/client-rest/examples/avatars/get-browser.md new file mode 100644 index 000000000..adb7e9e05 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-browser.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/browsers/{code} HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-credit-card.md b/examples/2.0.x/client-rest/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..231313784 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-credit-card.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/credit-cards/{code} HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-favicon.md b/examples/2.0.x/client-rest/examples/avatars/get-favicon.md new file mode 100644 index 000000000..992b27fea --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-favicon.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/favicon HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-flag.md b/examples/2.0.x/client-rest/examples/avatars/get-flag.md new file mode 100644 index 000000000..757490c64 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-flag.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/flags/{code} HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-image.md b/examples/2.0.x/client-rest/examples/avatars/get-image.md new file mode 100644 index 000000000..9a459b65f --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-image.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/image HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-initials.md b/examples/2.0.x/client-rest/examples/avatars/get-initials.md new file mode 100644 index 000000000..ac4620ba5 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-initials.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/initials HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-photo.md b/examples/2.0.x/client-rest/examples/avatars/get-photo.md new file mode 100644 index 000000000..1b7340662 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-photo.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/photo HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-qr.md b/examples/2.0.x/client-rest/examples/avatars/get-qr.md new file mode 100644 index 000000000..68211b899 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-qr.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/qr HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/avatars/get-screenshot.md b/examples/2.0.x/client-rest/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..1663cbe5c --- /dev/null +++ b/examples/2.0.x/client-rest/examples/avatars/get-screenshot.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/screenshots HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/databases/create-document.md b/examples/2.0.x/client-rest/examples/databases/create-document.md new file mode 100644 index 000000000..6223bba6f --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/create-document.md @@ -0,0 +1,21 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "documentId": "", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/databases/create-operations.md b/examples/2.0.x/client-rest/examples/databases/create-operations.md new file mode 100644 index 000000000..b493a86ad --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/databases/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "operations": [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/client-rest/examples/databases/create-transaction.md b/examples/2.0.x/client-rest/examples/databases/create-transaction.md new file mode 100644 index 000000000..f6373fb35 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/databases/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/client-rest/examples/databases/decrement-document-attribute.md b/examples/2.0.x/client-rest/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..d0a33a2b7 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/decrement-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "value": 1, + "min": 0, + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/databases/delete-document.md b/examples/2.0.x/client-rest/examples/databases/delete-document.md new file mode 100644 index 000000000..e6a63d179 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/delete-document.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/databases/delete-transaction.md b/examples/2.0.x/client-rest/examples/databases/delete-transaction.md new file mode 100644 index 000000000..3b1d23f48 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/databases/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/databases/get-document.md b/examples/2.0.x/client-rest/examples/databases/get-document.md new file mode 100644 index 000000000..61d3e7135 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/get-document.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/databases/get-transaction.md b/examples/2.0.x/client-rest/examples/databases/get-transaction.md new file mode 100644 index 000000000..aaf5dca7a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/databases/increment-document-attribute.md b/examples/2.0.x/client-rest/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..4beabd693 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/increment-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "value": 1, + "max": 100, + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/databases/list-documents.md b/examples/2.0.x/client-rest/examples/databases/list-documents.md new file mode 100644 index 000000000..5a5e34f17 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/list-documents.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/databases/list-transactions.md b/examples/2.0.x/client-rest/examples/databases/list-transactions.md new file mode 100644 index 000000000..7672296f8 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/databases/update-document.md b/examples/2.0.x/client-rest/examples/databases/update-document.md new file mode 100644 index 000000000..804f30e35 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/update-document.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/databases/update-transaction.md b/examples/2.0.x/client-rest/examples/databases/update-transaction.md new file mode 100644 index 000000000..bf8d85ac0 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/databases/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/databases/upsert-document.md b/examples/2.0.x/client-rest/examples/databases/upsert-document.md new file mode 100644 index 000000000..509973400 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/databases/upsert-document.md @@ -0,0 +1,20 @@ +```http +PUT /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/create-document.md b/examples/2.0.x/client-rest/examples/documentsdb/create-document.md new file mode 100644 index 000000000..52d8070c5 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/create-document.md @@ -0,0 +1,21 @@ +```http +POST /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "documentId": "", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/create-documents.md b/examples/2.0.x/client-rest/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..eaabe5614 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/create-documents.md @@ -0,0 +1,13 @@ +```http +POST /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "documents": [], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/create-operations.md b/examples/2.0.x/client-rest/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..1dcd46628 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/documentsdb/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "operations": [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-rest/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..0bfd5284d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/documentsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-rest/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..14814b79b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "value": 1, + "min": 0, + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/delete-document.md b/examples/2.0.x/client-rest/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..e22b30f85 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/delete-document.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-rest/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..a8458e709 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/get-document.md b/examples/2.0.x/client-rest/examples/documentsdb/get-document.md new file mode 100644 index 000000000..179693312 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/get-document.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-rest/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..9495d52d2 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-rest/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..22e65a9ec --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "value": 1, + "max": 100, + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/list-documents.md b/examples/2.0.x/client-rest/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..e9e706462 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/list-documents.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-rest/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..c030724dd --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/update-document.md b/examples/2.0.x/client-rest/examples/documentsdb/update-document.md new file mode 100644 index 000000000..5b4583400 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/update-document.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-rest/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..b23d949bb --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-rest/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..378f7c20b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/documentsdb/upsert-document.md @@ -0,0 +1,14 @@ +```http +PUT /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/functions/create-execution.md b/examples/2.0.x/client-rest/examples/functions/create-execution.md new file mode 100644 index 000000000..9ca901db6 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/functions/create-execution.md @@ -0,0 +1,17 @@ +```http +POST /v1/functions/{functionId}/executions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "body": "", + "async": false, + "path": "", + "method": "GET", + "headers": {}, + "scheduledAt": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/functions/get-execution.md b/examples/2.0.x/client-rest/examples/functions/get-execution.md new file mode 100644 index 000000000..84d9079f1 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/functions/get-execution.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/executions/{executionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/functions/list-executions.md b/examples/2.0.x/client-rest/examples/functions/list-executions.md new file mode 100644 index 000000000..38c3c32ee --- /dev/null +++ b/examples/2.0.x/client-rest/examples/functions/list-executions.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/executions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/graphql/mutation.md b/examples/2.0.x/client-rest/examples/graphql/mutation.md new file mode 100644 index 000000000..a51586e9d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +```http +POST /v1/graphql/mutation HTTP/1.1 +Host: cloud.appwrite.io +X-Sdk-Graphql: true +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "query": {} +} +``` diff --git a/examples/2.0.x/client-rest/examples/graphql/query.md b/examples/2.0.x/client-rest/examples/graphql/query.md new file mode 100644 index 000000000..5029a563a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/graphql/query.md @@ -0,0 +1,13 @@ +```http +POST /v1/graphql HTTP/1.1 +Host: cloud.appwrite.io +X-Sdk-Graphql: true +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "query": {} +} +``` diff --git a/examples/2.0.x/client-rest/examples/locale/get.md b/examples/2.0.x/client-rest/examples/locale/get.md new file mode 100644 index 000000000..1cfc91844 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/locale/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/locale/list-codes.md b/examples/2.0.x/client-rest/examples/locale/list-codes.md new file mode 100644 index 000000000..2ecd3d7ef --- /dev/null +++ b/examples/2.0.x/client-rest/examples/locale/list-codes.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/codes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/locale/list-continents.md b/examples/2.0.x/client-rest/examples/locale/list-continents.md new file mode 100644 index 000000000..7360f173d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/locale/list-continents.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/continents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/locale/list-countries-eu.md b/examples/2.0.x/client-rest/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..2038e634f --- /dev/null +++ b/examples/2.0.x/client-rest/examples/locale/list-countries-eu.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/countries/eu HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/locale/list-countries-phones.md b/examples/2.0.x/client-rest/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..268286470 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/locale/list-countries-phones.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/countries/phones HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/locale/list-countries.md b/examples/2.0.x/client-rest/examples/locale/list-countries.md new file mode 100644 index 000000000..b59569e66 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/locale/list-countries.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/countries HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/locale/list-currencies.md b/examples/2.0.x/client-rest/examples/locale/list-currencies.md new file mode 100644 index 000000000..d4fe982d1 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/locale/list-currencies.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/currencies HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/locale/list-languages.md b/examples/2.0.x/client-rest/examples/locale/list-languages.md new file mode 100644 index 000000000..919c40e45 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/locale/list-languages.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/languages HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/messaging/create-subscriber.md b/examples/2.0.x/client-rest/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..dd3801b41 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/messaging/create-subscriber.md @@ -0,0 +1,13 @@ +```http +POST /v1/messaging/topics/{topicId}/subscribers HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "subscriberId": "", + "targetId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/messaging/delete-subscriber.md b/examples/2.0.x/client-rest/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..782dfc4a7 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/messaging/delete-subscriber.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/messaging/topics/{topicId}/subscribers/{subscriberId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/presences/delete.md b/examples/2.0.x/client-rest/examples/presences/delete.md new file mode 100644 index 000000000..933945dd4 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/presences/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/presences/{presenceId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/presences/get.md b/examples/2.0.x/client-rest/examples/presences/get.md new file mode 100644 index 000000000..64e28d426 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/presences/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/presences/{presenceId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/presences/list.md b/examples/2.0.x/client-rest/examples/presences/list.md new file mode 100644 index 000000000..c0a41e001 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/presences/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/presences HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/presences/update.md b/examples/2.0.x/client-rest/examples/presences/update.md new file mode 100644 index 000000000..bc9e1b05b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/presences/update.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/presences/{presenceId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "status": "", + "expiresAt": "2020-10-15T06:38:00.000+00:00", + "metadata": {}, + "permissions": ["read(\"any\")"], + "purge": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/presences/upsert.md b/examples/2.0.x/client-rest/examples/presences/upsert.md new file mode 100644 index 000000000..417a6481e --- /dev/null +++ b/examples/2.0.x/client-rest/examples/presences/upsert.md @@ -0,0 +1,15 @@ +```http +PUT /v1/presences/{presenceId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "status": "", + "permissions": ["read(\"any\")"], + "expiresAt": "2020-10-15T06:38:00.000+00:00", + "metadata": {} +} +``` diff --git a/examples/2.0.x/client-rest/examples/storage/create-file.md b/examples/2.0.x/client-rest/examples/storage/create-file.md new file mode 100644 index 000000000..ce3b0ba6e --- /dev/null +++ b/examples/2.0.x/client-rest/examples/storage/create-file.md @@ -0,0 +1,31 @@ +```http +POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="fileId" + +"" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="file" + +cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16... + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="permissions[]" + +["read(\"any\")"] + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="folder" + +"photos/2026" + +--cec8e8123c05ba25-- +``` diff --git a/examples/2.0.x/client-rest/examples/storage/delete-file.md b/examples/2.0.x/client-rest/examples/storage/delete-file.md new file mode 100644 index 000000000..b39bc4e41 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/storage/delete-file.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/storage/get-file-download.md b/examples/2.0.x/client-rest/examples/storage/get-file-download.md new file mode 100644 index 000000000..7c754bf4a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/storage/get-file-download.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files/{fileId}/download HTTP/1.1 +Host: cloud.appwrite.io +Accept: */* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/storage/get-file-preview.md b/examples/2.0.x/client-rest/examples/storage/get-file-preview.md new file mode 100644 index 000000000..66b6f4375 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/storage/get-file-preview.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files/{fileId}/preview HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/storage/get-file-view.md b/examples/2.0.x/client-rest/examples/storage/get-file-view.md new file mode 100644 index 000000000..74f391013 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/storage/get-file-view.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files/{fileId}/view HTTP/1.1 +Host: cloud.appwrite.io +Accept: */* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/storage/get-file.md b/examples/2.0.x/client-rest/examples/storage/get-file.md new file mode 100644 index 000000000..a2bbc4b2d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/storage/get-file.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/storage/list-files.md b/examples/2.0.x/client-rest/examples/storage/list-files.md new file mode 100644 index 000000000..3a4635c25 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/storage/list-files.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/storage/update-file.md b/examples/2.0.x/client-rest/examples/storage/update-file.md new file mode 100644 index 000000000..1d3f64af4 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/storage/update-file.md @@ -0,0 +1,13 @@ +```http +PUT /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "name": "", + "permissions": ["read(\"any\")"] +} +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/create-operations.md b/examples/2.0.x/client-rest/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..bce829213 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/tablesdb/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "operations": [ + { + "action": "create", + "databaseId": "", + "tableId": "", + "rowId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/create-row.md b/examples/2.0.x/client-rest/examples/tablesdb/create-row.md new file mode 100644 index 000000000..6d600f4be --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/create-row.md @@ -0,0 +1,21 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "rowId": "", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/create-transaction.md b/examples/2.0.x/client-rest/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..3c3b850e1 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/tablesdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/client-rest/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..9e82b17b6 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "value": 1, + "min": 0, + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/delete-row.md b/examples/2.0.x/client-rest/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..92055773a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/delete-row.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/delete-transaction.md b/examples/2.0.x/client-rest/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..cb4f8e8c5 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tablesdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/get-row.md b/examples/2.0.x/client-rest/examples/tablesdb/get-row.md new file mode 100644 index 000000000..3c4a3218b --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/get-row.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/get-transaction.md b/examples/2.0.x/client-rest/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..1a80ec09d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/increment-row-column.md b/examples/2.0.x/client-rest/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..964d0187f --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/increment-row-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "value": 1, + "max": 100, + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/list-rows.md b/examples/2.0.x/client-rest/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..b9ac91c06 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/list-rows.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/list-transactions.md b/examples/2.0.x/client-rest/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..3358791af --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/update-row.md b/examples/2.0.x/client-rest/examples/tablesdb/update-row.md new file mode 100644 index 000000000..38b7a5429 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/update-row.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/update-transaction.md b/examples/2.0.x/client-rest/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..41b92502d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/tablesdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/tablesdb/upsert-row.md b/examples/2.0.x/client-rest/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..58e59c123 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/tablesdb/upsert-row.md @@ -0,0 +1,20 @@ +```http +PUT /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/teams/create-membership.md b/examples/2.0.x/client-rest/examples/teams/create-membership.md new file mode 100644 index 000000000..acbb9d24c --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/create-membership.md @@ -0,0 +1,17 @@ +```http +POST /v1/teams/{teamId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "email": "email@example.com", + "userId": "", + "phone": "+12065550100", + "roles": [], + "url": "https://example.com", + "name": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/teams/create.md b/examples/2.0.x/client-rest/examples/teams/create.md new file mode 100644 index 000000000..0cac39156 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/create.md @@ -0,0 +1,14 @@ +```http +POST /v1/teams HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "teamId": "", + "name": "", + "roles": [] +} +``` diff --git a/examples/2.0.x/client-rest/examples/teams/delete-membership.md b/examples/2.0.x/client-rest/examples/teams/delete-membership.md new file mode 100644 index 000000000..4867caf91 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/delete-membership.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/teams/delete.md b/examples/2.0.x/client-rest/examples/teams/delete.md new file mode 100644 index 000000000..230618bce --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/teams/get-membership.md b/examples/2.0.x/client-rest/examples/teams/get-membership.md new file mode 100644 index 000000000..c6ce455b5 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/get-membership.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/teams/get-prefs.md b/examples/2.0.x/client-rest/examples/teams/get-prefs.md new file mode 100644 index 000000000..d095e5a09 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/get-prefs.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams/{teamId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/teams/get.md b/examples/2.0.x/client-rest/examples/teams/get.md new file mode 100644 index 000000000..196fec42a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/teams/list-memberships.md b/examples/2.0.x/client-rest/examples/teams/list-memberships.md new file mode 100644 index 000000000..aab0c9d4c --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/list-memberships.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams/{teamId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/teams/list.md b/examples/2.0.x/client-rest/examples/teams/list.md new file mode 100644 index 000000000..acfa096fd --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/teams/update-membership-status.md b/examples/2.0.x/client-rest/examples/teams/update-membership-status.md new file mode 100644 index 000000000..f185b0197 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/update-membership-status.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/teams/{teamId}/memberships/{membershipId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "userId": "", + "secret": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/teams/update-membership.md b/examples/2.0.x/client-rest/examples/teams/update-membership.md new file mode 100644 index 000000000..2e7725816 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/update-membership.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "roles": [] +} +``` diff --git a/examples/2.0.x/client-rest/examples/teams/update-name.md b/examples/2.0.x/client-rest/examples/teams/update-name.md new file mode 100644 index 000000000..91fb4b145 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/update-name.md @@ -0,0 +1,12 @@ +```http +PUT /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "name": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/teams/update-prefs.md b/examples/2.0.x/client-rest/examples/teams/update-prefs.md new file mode 100644 index 000000000..b75b21f25 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/teams/update-prefs.md @@ -0,0 +1,12 @@ +```http +PUT /v1/teams/{teamId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "prefs": {} +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/create-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..97fba9e4a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "documentId": "", + "data": { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + }, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-rest/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..7ad3d0670 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/vectorsdb/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "operations": [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/create-query.md b/examples/2.0.x/client-rest/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..9eebb305d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/create-query.md @@ -0,0 +1,15 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/query HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "queries": [], + "transactionId": "", + "total": false, + "ttl": 0 +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-rest/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..50915dfc1 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/vectorsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..6380db120 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/delete-document.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-rest/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..6d65fcf3f --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/get-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..f45584471 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/get-document.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-rest/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..c75b0f3b3 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-rest/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..7a71b311d --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/list-documents.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-rest/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..ae17b9673 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/update-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..8575c4f0a --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/update-document.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-rest/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..cb67d33a9 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/client-rest/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-rest/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..a5ac42587 --- /dev/null +++ b/examples/2.0.x/client-rest/examples/vectorsdb/upsert-document.md @@ -0,0 +1,14 @@ +```http +PUT /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "" +} +``` diff --git a/examples/2.0.x/client-web/examples/account/create-anonymous-session.md b/examples/2.0.x/client-web/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..45b612e0f --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-anonymous-session.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createAnonymousSession(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-email-password-session.md b/examples/2.0.x/client-web/examples/account/create-email-password-session.md new file mode 100644 index 000000000..6093aa240 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-email-password-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-email-token.md b/examples/2.0.x/client-web/examples/account/create-email-token.md new file mode 100644 index 000000000..a90e93161 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-email-token.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailToken({ + userId: '', + email: 'email@example.com', + phrase: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-email-verification.md b/examples/2.0.x/client-web/examples/account/create-email-verification.md new file mode 100644 index 000000000..7b7edd983 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-email-verification.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailVerification({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-jwt.md b/examples/2.0.x/client-web/examples/account/create-jwt.md new file mode 100644 index 000000000..c17d32c41 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-jwt.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createJWT({ + duration: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-magic-url-token.md b/examples/2.0.x/client-web/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..b1d50a01d --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-magic-url-token.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMagicURLToken({ + userId: '', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-mfa-authenticator.md b/examples/2.0.x/client-web/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..70fa31738 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-mfa-authenticator.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticatorType } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAAuthenticator({ + type: AuthenticatorType.Totp, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-mfa-challenge.md b/examples/2.0.x/client-web/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..b59204a81 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-mfa-challenge.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticationFactor } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAChallenge({ + factor: AuthenticationFactor.Email, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/client-web/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..a8b9532a7 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-o-auth-2-session.md b/examples/2.0.x/client-web/examples/account/create-o-auth-2-session.md new file mode 100644 index 000000000..869e0f375 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-o-auth-2-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, OAuthProvider } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +account.createOAuth2Session({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +}); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-o-auth-2-token.md b/examples/2.0.x/client-web/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..1cb7dd5a9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-o-auth-2-token.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, OAuthProvider } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +}); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-phone-token.md b/examples/2.0.x/client-web/examples/account/create-phone-token.md new file mode 100644 index 000000000..b212cf658 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-phone-token.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneToken({ + userId: '', + phone: '+12065550100', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-phone-verification.md b/examples/2.0.x/client-web/examples/account/create-phone-verification.md new file mode 100644 index 000000000..9e12b6db6 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-phone-verification.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneVerification(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-push-target.md b/examples/2.0.x/client-web/examples/account/create-push-target.md new file mode 100644 index 000000000..915780cd9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-push-target.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPushTarget({ + targetId: '', + identifier: '', + providerId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-recovery.md b/examples/2.0.x/client-web/examples/account/create-recovery.md new file mode 100644 index 000000000..3cae042ba --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-recovery.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-session.md b/examples/2.0.x/client-web/examples/account/create-session.md new file mode 100644 index 000000000..6fba52485 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create-verification.md b/examples/2.0.x/client-web/examples/account/create-verification.md new file mode 100644 index 000000000..58e2a9aa1 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create-verification.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createVerification({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/create.md b/examples/2.0.x/client-web/examples/account/create.md new file mode 100644 index 000000000..c9872ec6d --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/create.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.create({ + userId: '', + email: 'email@example.com', + password: 'password', + name: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/delete-identity.md b/examples/2.0.x/client-web/examples/account/delete-identity.md new file mode 100644 index 000000000..def2ad629 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/delete-identity.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteIdentity({ + identityId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/client-web/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..e785c0ff0 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticatorType } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteMFAAuthenticator({ + type: AuthenticatorType.Totp, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/delete-push-target.md b/examples/2.0.x/client-web/examples/account/delete-push-target.md new file mode 100644 index 000000000..38aaab18e --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/delete-push-target.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deletePushTarget({ + targetId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/delete-session.md b/examples/2.0.x/client-web/examples/account/delete-session.md new file mode 100644 index 000000000..2547e38ac --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/delete-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/delete-sessions.md b/examples/2.0.x/client-web/examples/account/delete-sessions.md new file mode 100644 index 000000000..1bd929a8a --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/delete-sessions.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSessions(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/client-web/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..07c4eb784 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/get-prefs.md b/examples/2.0.x/client-web/examples/account/get-prefs.md new file mode 100644 index 000000000..81feeeabe --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/get-prefs.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getPrefs(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/get-session.md b/examples/2.0.x/client-web/examples/account/get-session.md new file mode 100644 index 000000000..f32fb12ce --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/get-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/get.md b/examples/2.0.x/client-web/examples/account/get.md new file mode 100644 index 000000000..bf3175473 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/get.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.get(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/list-identities.md b/examples/2.0.x/client-web/examples/account/list-identities.md new file mode 100644 index 000000000..015e94963 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/list-identities.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listIdentities({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/list-mfa-factors.md b/examples/2.0.x/client-web/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..9a151cc00 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/list-mfa-factors.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listMFAFactors(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/list-sessions.md b/examples/2.0.x/client-web/examples/account/list-sessions.md new file mode 100644 index 000000000..d07cf48e5 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/list-sessions.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listSessions(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-email-verification.md b/examples/2.0.x/client-web/examples/account/update-email-verification.md new file mode 100644 index 000000000..34b5f4ad6 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-email-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmailVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-email.md b/examples/2.0.x/client-web/examples/account/update-email.md new file mode 100644 index 000000000..e18c3f82b --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-email.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmail({ + email: 'email@example.com', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-magic-url-session.md b/examples/2.0.x/client-web/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..2b5f59a95 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-magic-url-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMagicURLSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-mfa-authenticator.md b/examples/2.0.x/client-web/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..0f350d051 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-mfa-authenticator.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, AuthenticatorType } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAAuthenticator({ + type: AuthenticatorType.Totp, + otp: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-mfa-challenge.md b/examples/2.0.x/client-web/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..84a764261 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-mfa-challenge.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAChallenge({ + challengeId: '', + otp: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/client-web/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..039640fb1 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-mfa.md b/examples/2.0.x/client-web/examples/account/update-mfa.md new file mode 100644 index 000000000..75c011371 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-mfa.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFA({ + mfa: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-name.md b/examples/2.0.x/client-web/examples/account/update-name.md new file mode 100644 index 000000000..41d3b27f5 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-name.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateName({ + name: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-password.md b/examples/2.0.x/client-web/examples/account/update-password.md new file mode 100644 index 000000000..b4a002ee8 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-password.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePassword({ + password: 'password', + oldPassword: 'password', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-phone-session.md b/examples/2.0.x/client-web/examples/account/update-phone-session.md new file mode 100644 index 000000000..5238cf412 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-phone-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-phone-verification.md b/examples/2.0.x/client-web/examples/account/update-phone-verification.md new file mode 100644 index 000000000..e2980824d --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-phone-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-phone.md b/examples/2.0.x/client-web/examples/account/update-phone.md new file mode 100644 index 000000000..e564e2ef7 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-phone.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhone({ + phone: '+12065550100', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-prefs.md b/examples/2.0.x/client-web/examples/account/update-prefs.md new file mode 100644 index 000000000..ab1b9ffc3 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-prefs.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePrefs({ + prefs: { + language: 'en', + timezone: 'UTC', + darkTheme: true, + }, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-push-target.md b/examples/2.0.x/client-web/examples/account/update-push-target.md new file mode 100644 index 000000000..83bf217b5 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-push-target.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePushTarget({ + targetId: '', + identifier: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-recovery.md b/examples/2.0.x/client-web/examples/account/update-recovery.md new file mode 100644 index 000000000..a1ca9cf42 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-recovery.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateRecovery({ + userId: '', + secret: '', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-session.md b/examples/2.0.x/client-web/examples/account/update-session.md new file mode 100644 index 000000000..7b7e88d5b --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-status.md b/examples/2.0.x/client-web/examples/account/update-status.md new file mode 100644 index 000000000..d2ace3ff1 --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-status.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateStatus(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/account/update-verification.md b/examples/2.0.x/client-web/examples/account/update-verification.md new file mode 100644 index 000000000..c732ca82c --- /dev/null +++ b/examples/2.0.x/client-web/examples/account/update-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-browser.md b/examples/2.0.x/client-web/examples/avatars/get-browser.md new file mode 100644 index 000000000..a446f4dc8 --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-browser.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, Browser } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getBrowser({ + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-credit-card.md b/examples/2.0.x/client-web/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..a644fda19 --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-credit-card.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, CreditCard } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard({ + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-favicon.md b/examples/2.0.x/client-web/examples/avatars/get-favicon.md new file mode 100644 index 000000000..8036a9f5a --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-favicon.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Avatars } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFavicon({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-flag.md b/examples/2.0.x/client-web/examples/avatars/get-flag.md new file mode 100644 index 000000000..5264199ee --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-flag.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, Flag } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFlag({ + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-image.md b/examples/2.0.x/client-web/examples/avatars/get-image.md new file mode 100644 index 000000000..d5cd7300a --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-image.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Avatars } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-initials.md b/examples/2.0.x/client-web/examples/avatars/get-initials.md new file mode 100644 index 000000000..03c6f9b15 --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-initials.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getInitials({ + name: '', // optional + width: 0, // optional + height: 0, // optional + background: 'FFFFFF', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-photo.md b/examples/2.0.x/client-web/examples/avatars/get-photo.md new file mode 100644 index 000000000..1b0567a33 --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-photo.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Avatars } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getPhoto({ + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '', // optional + name: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-qr.md b/examples/2.0.x/client-web/examples/avatars/get-qr.md new file mode 100644 index 000000000..59cda9cf8 --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-qr.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getQR({ + text: '', + size: 1, // optional + margin: 0, // optional + download: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/avatars/get-screenshot.md b/examples/2.0.x/client-web/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..680d225e4 --- /dev/null +++ b/examples/2.0.x/client-web/examples/avatars/get-screenshot.md @@ -0,0 +1,48 @@ +```javascript +import { + Client, + Avatars, + BrowserTheme, + Timezone, + BrowserPermission, + ImageFormat, +} from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getScreenshot({ + url: 'https://example.com', + headers: { + Authorization: 'Bearer token123', + 'X-Custom-Header': 'value', + }, // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: BrowserTheme.Dark, // optional + userAgent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + fullpage: true, // optional + locale: 'en-US', // optional + timezone: Timezone.AfricaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [ + BrowserPermission.Geolocation, + BrowserPermission.Notifications, + ], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: ImageFormat.Jpeg, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/create-document.md b/examples/2.0.x/client-web/examples/databases/create-document.md new file mode 100644 index 000000000..822dd49fc --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/create-operations.md b/examples/2.0.x/client-web/examples/databases/create-operations.md new file mode 100644 index 000000000..ff5876bd3 --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/create-transaction.md b/examples/2.0.x/client-web/examples/databases/create-transaction.md new file mode 100644 index 000000000..075d33b05 --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/decrement-document-attribute.md b/examples/2.0.x/client-web/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..bc5a24bc0 --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/delete-document.md b/examples/2.0.x/client-web/examples/databases/delete-document.md new file mode 100644 index 000000000..a5e123f48 --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/delete-transaction.md b/examples/2.0.x/client-web/examples/databases/delete-transaction.md new file mode 100644 index 000000000..b7f177969 --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/get-document.md b/examples/2.0.x/client-web/examples/databases/get-document.md new file mode 100644 index 000000000..4d900ffbb --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/get-transaction.md b/examples/2.0.x/client-web/examples/databases/get-transaction.md new file mode 100644 index 000000000..13d5c189d --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/increment-document-attribute.md b/examples/2.0.x/client-web/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..38fdeee00 --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/list-documents.md b/examples/2.0.x/client-web/examples/databases/list-documents.md new file mode 100644 index 000000000..e10300a9d --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/list-transactions.md b/examples/2.0.x/client-web/examples/databases/list-transactions.md new file mode 100644 index 000000000..bb8ae2e1f --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/update-document.md b/examples/2.0.x/client-web/examples/databases/update-document.md new file mode 100644 index 000000000..026b9fe1f --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/update-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/update-transaction.md b/examples/2.0.x/client-web/examples/databases/update-transaction.md new file mode 100644 index 000000000..f7ddf24a1 --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/databases/upsert-document.md b/examples/2.0.x/client-web/examples/databases/upsert-document.md new file mode 100644 index 000000000..02ef19b1b --- /dev/null +++ b/examples/2.0.x/client-web/examples/databases/upsert-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/create-document.md b/examples/2.0.x/client-web/examples/documentsdb/create-document.md new file mode 100644 index 000000000..b33c8780f --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/create-documents.md b/examples/2.0.x/client-web/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..c2830b94d --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/create-operations.md b/examples/2.0.x/client-web/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..371f4cf3a --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/create-transaction.md b/examples/2.0.x/client-web/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..5eaf00656 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/client-web/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..75f4b0382 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/delete-document.md b/examples/2.0.x/client-web/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..e8b7e18b7 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/delete-transaction.md b/examples/2.0.x/client-web/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..97c1fe6f6 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/get-document.md b/examples/2.0.x/client-web/examples/documentsdb/get-document.md new file mode 100644 index 000000000..daedc268c --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/get-transaction.md b/examples/2.0.x/client-web/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..75cdd78f8 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/client-web/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..493b8a682 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/list-documents.md b/examples/2.0.x/client-web/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..26081239d --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/list-transactions.md b/examples/2.0.x/client-web/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..161d38804 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/update-document.md b/examples/2.0.x/client-web/examples/documentsdb/update-document.md new file mode 100644 index 000000000..5acecac7b --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/update-transaction.md b/examples/2.0.x/client-web/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..5f8d74dfb --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/documentsdb/upsert-document.md b/examples/2.0.x/client-web/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..3e10833c8 --- /dev/null +++ b/examples/2.0.x/client-web/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/functions/create-execution.md b/examples/2.0.x/client-web/examples/functions/create-execution.md new file mode 100644 index 000000000..d746df9a0 --- /dev/null +++ b/examples/2.0.x/client-web/examples/functions/create-execution.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Functions, ExecutionMethod } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createExecution({ + functionId: '', + body: '', // optional + async: false, // optional + xpath: '', // optional + method: ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/functions/get-execution.md b/examples/2.0.x/client-web/examples/functions/get-execution.md new file mode 100644 index 000000000..a8c5064eb --- /dev/null +++ b/examples/2.0.x/client-web/examples/functions/get-execution.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getExecution({ + functionId: '', + executionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/functions/list-executions.md b/examples/2.0.x/client-web/examples/functions/list-executions.md new file mode 100644 index 000000000..95f7cd2f3 --- /dev/null +++ b/examples/2.0.x/client-web/examples/functions/list-executions.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Functions } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listExecutions({ + functionId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/graphql/mutation.md b/examples/2.0.x/client-web/examples/graphql/mutation.md new file mode 100644 index 000000000..abd27e3d4 --- /dev/null +++ b/examples/2.0.x/client-web/examples/graphql/mutation.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Graphql } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.mutation({ + query: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/graphql/query.md b/examples/2.0.x/client-web/examples/graphql/query.md new file mode 100644 index 000000000..21b353fc9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/graphql/query.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Graphql } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.query({ + query: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/locale/get.md b/examples/2.0.x/client-web/examples/locale/get.md new file mode 100644 index 000000000..f0bd78be1 --- /dev/null +++ b/examples/2.0.x/client-web/examples/locale/get.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.get(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/locale/list-codes.md b/examples/2.0.x/client-web/examples/locale/list-codes.md new file mode 100644 index 000000000..dce429ef9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/locale/list-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/locale/list-continents.md b/examples/2.0.x/client-web/examples/locale/list-continents.md new file mode 100644 index 000000000..4fde4252d --- /dev/null +++ b/examples/2.0.x/client-web/examples/locale/list-continents.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listContinents(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/locale/list-countries-eu.md b/examples/2.0.x/client-web/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..917245469 --- /dev/null +++ b/examples/2.0.x/client-web/examples/locale/list-countries-eu.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesEU(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/locale/list-countries-phones.md b/examples/2.0.x/client-web/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..95ef6e533 --- /dev/null +++ b/examples/2.0.x/client-web/examples/locale/list-countries-phones.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesPhones(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/locale/list-countries.md b/examples/2.0.x/client-web/examples/locale/list-countries.md new file mode 100644 index 000000000..7d37e8011 --- /dev/null +++ b/examples/2.0.x/client-web/examples/locale/list-countries.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountries(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/locale/list-currencies.md b/examples/2.0.x/client-web/examples/locale/list-currencies.md new file mode 100644 index 000000000..b123b1789 --- /dev/null +++ b/examples/2.0.x/client-web/examples/locale/list-currencies.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCurrencies(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/locale/list-languages.md b/examples/2.0.x/client-web/examples/locale/list-languages.md new file mode 100644 index 000000000..c9abd5dc5 --- /dev/null +++ b/examples/2.0.x/client-web/examples/locale/list-languages.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listLanguages(); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/messaging/create-subscriber.md b/examples/2.0.x/client-web/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..6ff4eddc9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/messaging/create-subscriber.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSubscriber({ + topicId: '', + subscriberId: '', + targetId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/messaging/delete-subscriber.md b/examples/2.0.x/client-web/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..e933009bd --- /dev/null +++ b/examples/2.0.x/client-web/examples/messaging/delete-subscriber.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Messaging } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteSubscriber({ + topicId: '', + subscriberId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/presences/delete.md b/examples/2.0.x/client-web/examples/presences/delete.md new file mode 100644 index 000000000..5c0d638e4 --- /dev/null +++ b/examples/2.0.x/client-web/examples/presences/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Presences } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.delete({ + presenceId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/presences/get.md b/examples/2.0.x/client-web/examples/presences/get.md new file mode 100644 index 000000000..6290f7edc --- /dev/null +++ b/examples/2.0.x/client-web/examples/presences/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Presences } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.get({ + presenceId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/presences/list.md b/examples/2.0.x/client-web/examples/presences/list.md new file mode 100644 index 000000000..c9ac96b8c --- /dev/null +++ b/examples/2.0.x/client-web/examples/presences/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Presences } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.list({ + queries: [], // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/presences/update.md b/examples/2.0.x/client-web/examples/presences/update.md new file mode 100644 index 000000000..44dc92f8b --- /dev/null +++ b/examples/2.0.x/client-web/examples/presences/update.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Presences, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.update({ + presenceId: '', + status: '', // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional + permissions: [Permission.read(Role.any())], // optional + purge: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/presences/upsert.md b/examples/2.0.x/client-web/examples/presences/upsert.md new file mode 100644 index 000000000..7e03206f8 --- /dev/null +++ b/examples/2.0.x/client-web/examples/presences/upsert.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Presences, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const presences = new Presences(client); + +const result = await presences.upsert({ + presenceId: '', + status: '', + permissions: [Permission.read(Role.any())], // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/create-file.md b/examples/2.0.x/client-web/examples/storage/create-file.md new file mode 100644 index 000000000..f4828d988 --- /dev/null +++ b/examples/2.0.x/client-web/examples/storage/create-file.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Storage, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createFile({ + bucketId: '', + fileId: '', + file: document.getElementById('uploader').files[0], + permissions: [Permission.read(Role.any())], // optional + folder: 'photos/2026', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/delete-file.md b/examples/2.0.x/client-web/examples/storage/delete-file.md new file mode 100644 index 000000000..c1ad65046 --- /dev/null +++ b/examples/2.0.x/client-web/examples/storage/delete-file.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Storage } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteFile({ + bucketId: '', + fileId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/get-file-download.md b/examples/2.0.x/client-web/examples/storage/get-file-download.md new file mode 100644 index 000000000..bd2a7e60f --- /dev/null +++ b/examples/2.0.x/client-web/examples/storage/get-file-download.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Storage } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileDownload({ + bucketId: '', + fileId: '', + token: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/get-file-preview.md b/examples/2.0.x/client-web/examples/storage/get-file-preview.md new file mode 100644 index 000000000..710256165 --- /dev/null +++ b/examples/2.0.x/client-web/examples/storage/get-file-preview.md @@ -0,0 +1,28 @@ +```javascript +import { Client, Storage, ImageGravity, ImageFormat } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFilePreview({ + bucketId: '', + fileId: '', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: 'FFFFFF', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: 'FFFFFF', // optional + output: ImageFormat.Jpg, // optional + token: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/get-file-view.md b/examples/2.0.x/client-web/examples/storage/get-file-view.md new file mode 100644 index 000000000..ba86f7c3d --- /dev/null +++ b/examples/2.0.x/client-web/examples/storage/get-file-view.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Storage } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileView({ + bucketId: '', + fileId: '', + token: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/get-file.md b/examples/2.0.x/client-web/examples/storage/get-file.md new file mode 100644 index 000000000..8045f09ce --- /dev/null +++ b/examples/2.0.x/client-web/examples/storage/get-file.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Storage } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getFile({ + bucketId: '', + fileId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/list-files.md b/examples/2.0.x/client-web/examples/storage/list-files.md new file mode 100644 index 000000000..d80afccfe --- /dev/null +++ b/examples/2.0.x/client-web/examples/storage/list-files.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Storage } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listFiles({ + bucketId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/storage/update-file.md b/examples/2.0.x/client-web/examples/storage/update-file.md new file mode 100644 index 000000000..fb1383909 --- /dev/null +++ b/examples/2.0.x/client-web/examples/storage/update-file.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Storage, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateFile({ + bucketId: '', + fileId: '', + name: '', // optional + permissions: [Permission.read(Role.any())], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/create-operations.md b/examples/2.0.x/client-web/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..10dff2ce9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + tableId: '', + rowId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/create-row.md b/examples/2.0.x/client-web/examples/tablesdb/create-row.md new file mode 100644 index 000000000..9902804ef --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/create-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/create-transaction.md b/examples/2.0.x/client-web/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..df28475ce --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/client-web/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..c8587f481 --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.decrementRowColumn({ + databaseId: '', + tableId: '', + rowId: '', + column: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/delete-row.md b/examples/2.0.x/client-web/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..19321d966 --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/delete-row.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteRow({ + databaseId: '', + tableId: '', + rowId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/delete-transaction.md b/examples/2.0.x/client-web/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..c0c2da7bf --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/get-row.md b/examples/2.0.x/client-web/examples/tablesdb/get-row.md new file mode 100644 index 000000000..4940f56b4 --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/get-row.md @@ -0,0 +1,19 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getRow({ + databaseId: '', + tableId: '', + rowId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/get-transaction.md b/examples/2.0.x/client-web/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..e940f421c --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/increment-row-column.md b/examples/2.0.x/client-web/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..c4e7954c7 --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/increment-row-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.incrementRowColumn({ + databaseId: '', + tableId: '', + rowId: '', + column: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/list-rows.md b/examples/2.0.x/client-web/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..9a73c4536 --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/list-rows.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listRows({ + databaseId: '', + tableId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/list-transactions.md b/examples/2.0.x/client-web/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..20f0dba5c --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/update-row.md b/examples/2.0.x/client-web/examples/tablesdb/update-row.md new file mode 100644 index 000000000..633e3803f --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/update-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/update-transaction.md b/examples/2.0.x/client-web/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..c64ea2ad3 --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/tablesdb/upsert-row.md b/examples/2.0.x/client-web/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..d7543441c --- /dev/null +++ b/examples/2.0.x/client-web/examples/tablesdb/upsert-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.upsertRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/create-membership.md b/examples/2.0.x/client-web/examples/teams/create-membership.md new file mode 100644 index 000000000..d8f15f3d9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/create-membership.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.createMembership({ + teamId: '', + roles: [], + email: 'email@example.com', // optional + userId: '', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/create.md b/examples/2.0.x/client-web/examples/teams/create.md new file mode 100644 index 000000000..00668a7ff --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.create({ + teamId: '', + name: '', + roles: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/delete-membership.md b/examples/2.0.x/client-web/examples/teams/delete-membership.md new file mode 100644 index 000000000..f32057373 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/delete-membership.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteMembership({ + teamId: '', + membershipId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/delete.md b/examples/2.0.x/client-web/examples/teams/delete.md new file mode 100644 index 000000000..92900b3ff --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.delete({ + teamId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/get-membership.md b/examples/2.0.x/client-web/examples/teams/get-membership.md new file mode 100644 index 000000000..a09e27dfe --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/get-membership.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getMembership({ + teamId: '', + membershipId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/get-prefs.md b/examples/2.0.x/client-web/examples/teams/get-prefs.md new file mode 100644 index 000000000..2023c9fb0 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/get-prefs.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getPrefs({ + teamId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/get.md b/examples/2.0.x/client-web/examples/teams/get.md new file mode 100644 index 000000000..71fc061f9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.get({ + teamId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/list-memberships.md b/examples/2.0.x/client-web/examples/teams/list-memberships.md new file mode 100644 index 000000000..b27331277 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/list-memberships.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listMemberships({ + teamId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/list.md b/examples/2.0.x/client-web/examples/teams/list.md new file mode 100644 index 000000000..9f4140450 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.list({ + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/update-membership-status.md b/examples/2.0.x/client-web/examples/teams/update-membership-status.md new file mode 100644 index 000000000..e00392291 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/update-membership-status.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembershipStatus({ + teamId: '', + membershipId: '', + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/update-membership.md b/examples/2.0.x/client-web/examples/teams/update-membership.md new file mode 100644 index 000000000..a568e3041 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/update-membership.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembership({ + teamId: '', + membershipId: '', + roles: [], +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/update-name.md b/examples/2.0.x/client-web/examples/teams/update-name.md new file mode 100644 index 000000000..d0661b293 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/update-name.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateName({ + teamId: '', + name: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/teams/update-prefs.md b/examples/2.0.x/client-web/examples/teams/update-prefs.md new file mode 100644 index 000000000..08b944c07 --- /dev/null +++ b/examples/2.0.x/client-web/examples/teams/update-prefs.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updatePrefs({ + teamId: '', + prefs: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/create-document.md b/examples/2.0.x/client-web/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..f68aeef8c --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + embeddings: [0.12, -0.55, 0.88, 1.02], + metadata: { + key: 'value', + }, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/create-operations.md b/examples/2.0.x/client-web/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..35fb3d34b --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/create-query.md b/examples/2.0.x/client-web/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..e5de0f427 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createQuery({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/create-transaction.md b/examples/2.0.x/client-web/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..7ae265b50 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/delete-document.md b/examples/2.0.x/client-web/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..c7ccff599 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/client-web/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..c03b17dd6 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/get-document.md b/examples/2.0.x/client-web/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..ce4ffc24b --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/get-transaction.md b/examples/2.0.x/client-web/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..73f9d58a1 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/list-documents.md b/examples/2.0.x/client-web/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..99a76f3a5 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/list-transactions.md b/examples/2.0.x/client-web/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..a39afbc15 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/update-document.md b/examples/2.0.x/client-web/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..56453ccbb --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/update-transaction.md b/examples/2.0.x/client-web/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..c3e229fa9 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/client-web/examples/vectorsdb/upsert-document.md b/examples/2.0.x/client-web/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..a7143a960 --- /dev/null +++ b/examples/2.0.x/client-web/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-anonymous-session.md b/examples/2.0.x/console-cli/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..49dd12f6a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-anonymous-session.md @@ -0,0 +1,3 @@ +```bash +appwrite account create-anonymous-session +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-email-password-session.md b/examples/2.0.x/console-cli/examples/account/create-email-password-session.md new file mode 100644 index 000000000..ed0658917 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-email-password-session.md @@ -0,0 +1,5 @@ +```bash +appwrite account create-email-password-session \ + --email email@example.com \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-email-token.md b/examples/2.0.x/console-cli/examples/account/create-email-token.md new file mode 100644 index 000000000..a3b3c6c19 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-email-token.md @@ -0,0 +1,5 @@ +```bash +appwrite account create-email-token \ + --user-id '' \ + --email email@example.com +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-email-verification.md b/examples/2.0.x/console-cli/examples/account/create-email-verification.md new file mode 100644 index 000000000..c2a163663 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-email-verification.md @@ -0,0 +1,4 @@ +```bash +appwrite account create-email-verification \ + --url https://example.com +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-jwt.md b/examples/2.0.x/console-cli/examples/account/create-jwt.md new file mode 100644 index 000000000..71e806a0c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-jwt.md @@ -0,0 +1,3 @@ +```bash +appwrite account create-jwt +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-magic-url-token.md b/examples/2.0.x/console-cli/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..0608b1ddc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-magic-url-token.md @@ -0,0 +1,5 @@ +```bash +appwrite account create-magic-url-token \ + --user-id '' \ + --email email@example.com +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-mfa-authenticator.md b/examples/2.0.x/console-cli/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..50edfe7c8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-mfa-authenticator.md @@ -0,0 +1,4 @@ +```bash +appwrite account create-mfa-authenticator \ + --type totp +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-mfa-challenge.md b/examples/2.0.x/console-cli/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..10b45c59c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-mfa-challenge.md @@ -0,0 +1,4 @@ +```bash +appwrite account create-mfa-challenge \ + --factor email +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/console-cli/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..9b4ec5a53 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,3 @@ +```bash +appwrite account create-mfa-recovery-codes +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-o-auth-2-session.md b/examples/2.0.x/console-cli/examples/account/create-o-auth-2-session.md new file mode 100644 index 000000000..d0e18ffe2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-o-auth-2-session.md @@ -0,0 +1,4 @@ +```bash +appwrite account create-o-auth-2-session \ + --provider amazon +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-o-auth-2-token.md b/examples/2.0.x/console-cli/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..d634cdbe9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-o-auth-2-token.md @@ -0,0 +1,4 @@ +```bash +appwrite account create-o-auth-2-token \ + --provider amazon +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-phone-token.md b/examples/2.0.x/console-cli/examples/account/create-phone-token.md new file mode 100644 index 000000000..302181178 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-phone-token.md @@ -0,0 +1,5 @@ +```bash +appwrite account create-phone-token \ + --user-id '' \ + --phone +12065550100 +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-phone-verification.md b/examples/2.0.x/console-cli/examples/account/create-phone-verification.md new file mode 100644 index 000000000..913a29d4d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-phone-verification.md @@ -0,0 +1,3 @@ +```bash +appwrite account create-phone-verification +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-push-target.md b/examples/2.0.x/console-cli/examples/account/create-push-target.md new file mode 100644 index 000000000..21eef9778 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-push-target.md @@ -0,0 +1,5 @@ +```bash +appwrite account create-push-target \ + --target-id '' \ + --identifier '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-recovery.md b/examples/2.0.x/console-cli/examples/account/create-recovery.md new file mode 100644 index 000000000..0b2a43f98 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-recovery.md @@ -0,0 +1,5 @@ +```bash +appwrite account create-recovery \ + --email email@example.com \ + --url https://example.com +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-session.md b/examples/2.0.x/console-cli/examples/account/create-session.md new file mode 100644 index 000000000..aa043b71f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-session.md @@ -0,0 +1,5 @@ +```bash +appwrite account create-session \ + --user-id '' \ + --secret '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/create-verification.md b/examples/2.0.x/console-cli/examples/account/create-verification.md new file mode 100644 index 000000000..f06a4ab90 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create-verification.md @@ -0,0 +1,4 @@ +```bash +appwrite account create-verification \ + --url https://example.com +``` diff --git a/examples/2.0.x/console-cli/examples/account/create.md b/examples/2.0.x/console-cli/examples/account/create.md new file mode 100644 index 000000000..980bf5533 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/create.md @@ -0,0 +1,6 @@ +```bash +appwrite account create \ + --user-id '' \ + --email email@example.com \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/account/delete-identity.md b/examples/2.0.x/console-cli/examples/account/delete-identity.md new file mode 100644 index 000000000..915953cc2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/delete-identity.md @@ -0,0 +1,4 @@ +```bash +appwrite account delete-identity \ + --identity-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/console-cli/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..441afcda4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,4 @@ +```bash +appwrite account delete-mfa-authenticator \ + --type totp +``` diff --git a/examples/2.0.x/console-cli/examples/account/delete-push-target.md b/examples/2.0.x/console-cli/examples/account/delete-push-target.md new file mode 100644 index 000000000..b6bf04c77 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/delete-push-target.md @@ -0,0 +1,4 @@ +```bash +appwrite account delete-push-target \ + --target-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/delete-session.md b/examples/2.0.x/console-cli/examples/account/delete-session.md new file mode 100644 index 000000000..fd7680ac8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/delete-session.md @@ -0,0 +1,4 @@ +```bash +appwrite account delete-session \ + --session-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/delete-sessions.md b/examples/2.0.x/console-cli/examples/account/delete-sessions.md new file mode 100644 index 000000000..45e5ac4ce --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/delete-sessions.md @@ -0,0 +1,3 @@ +```bash +appwrite account delete-sessions +``` diff --git a/examples/2.0.x/console-cli/examples/account/delete.md b/examples/2.0.x/console-cli/examples/account/delete.md new file mode 100644 index 000000000..c36a9a65d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/delete.md @@ -0,0 +1,3 @@ +```bash +appwrite account delete +``` diff --git a/examples/2.0.x/console-cli/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/console-cli/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..ca5e236b4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,3 @@ +```bash +appwrite account get-mfa-recovery-codes +``` diff --git a/examples/2.0.x/console-cli/examples/account/get-prefs.md b/examples/2.0.x/console-cli/examples/account/get-prefs.md new file mode 100644 index 000000000..fa4fa6949 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/get-prefs.md @@ -0,0 +1,3 @@ +```bash +appwrite account get-prefs +``` diff --git a/examples/2.0.x/console-cli/examples/account/get-session.md b/examples/2.0.x/console-cli/examples/account/get-session.md new file mode 100644 index 000000000..346cd9768 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/get-session.md @@ -0,0 +1,4 @@ +```bash +appwrite account get-session \ + --session-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/get.md b/examples/2.0.x/console-cli/examples/account/get.md new file mode 100644 index 000000000..010ec709b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/get.md @@ -0,0 +1,3 @@ +```bash +appwrite account get +``` diff --git a/examples/2.0.x/console-cli/examples/account/list-identities.md b/examples/2.0.x/console-cli/examples/account/list-identities.md new file mode 100644 index 000000000..ecc5d6853 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/list-identities.md @@ -0,0 +1,4 @@ +```bash +appwrite account list-identities \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/account/list-mfa-factors.md b/examples/2.0.x/console-cli/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..9edf379ca --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/list-mfa-factors.md @@ -0,0 +1,3 @@ +```bash +appwrite account list-mfa-factors +``` diff --git a/examples/2.0.x/console-cli/examples/account/list-sessions.md b/examples/2.0.x/console-cli/examples/account/list-sessions.md new file mode 100644 index 000000000..f71db5dab --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/list-sessions.md @@ -0,0 +1,3 @@ +```bash +appwrite account list-sessions +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-email-verification.md b/examples/2.0.x/console-cli/examples/account/update-email-verification.md new file mode 100644 index 000000000..3a0e6062d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-email-verification.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-email-verification \ + --user-id '' \ + --secret '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-email.md b/examples/2.0.x/console-cli/examples/account/update-email.md new file mode 100644 index 000000000..e4b69338e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-email.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-email \ + --email email@example.com \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-magic-url-session.md b/examples/2.0.x/console-cli/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..f39fe608f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-magic-url-session.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-magic-url-session \ + --user-id '' \ + --secret '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-mfa-authenticator.md b/examples/2.0.x/console-cli/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..a8f1dd28e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-mfa-authenticator.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-mfa-authenticator \ + --type totp \ + --otp '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-mfa-challenge.md b/examples/2.0.x/console-cli/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..daf37c655 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-mfa-challenge.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-mfa-challenge \ + --challenge-id '' \ + --otp '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/console-cli/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..21fce3884 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,3 @@ +```bash +appwrite account update-mfa-recovery-codes +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-mfa.md b/examples/2.0.x/console-cli/examples/account/update-mfa.md new file mode 100644 index 000000000..77b324179 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-mfa.md @@ -0,0 +1,4 @@ +```bash +appwrite account update-mfa \ + --mfa false +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-name.md b/examples/2.0.x/console-cli/examples/account/update-name.md new file mode 100644 index 000000000..b36aaab57 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-name.md @@ -0,0 +1,4 @@ +```bash +appwrite account update-name \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-password.md b/examples/2.0.x/console-cli/examples/account/update-password.md new file mode 100644 index 000000000..b7df48645 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-password.md @@ -0,0 +1,4 @@ +```bash +appwrite account update-password \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-phone-session.md b/examples/2.0.x/console-cli/examples/account/update-phone-session.md new file mode 100644 index 000000000..7672fae91 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-phone-session.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-phone-session \ + --user-id '' \ + --secret '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-phone-verification.md b/examples/2.0.x/console-cli/examples/account/update-phone-verification.md new file mode 100644 index 000000000..c4d6c864d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-phone-verification.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-phone-verification \ + --user-id '' \ + --secret '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-phone.md b/examples/2.0.x/console-cli/examples/account/update-phone.md new file mode 100644 index 000000000..8de216c48 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-phone.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-phone \ + --phone +12065550100 \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-prefs.md b/examples/2.0.x/console-cli/examples/account/update-prefs.md new file mode 100644 index 000000000..80fc7d8f6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-prefs.md @@ -0,0 +1,4 @@ +```bash +appwrite account update-prefs \ + --prefs '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-push-target.md b/examples/2.0.x/console-cli/examples/account/update-push-target.md new file mode 100644 index 000000000..1d4799b28 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-push-target.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-push-target \ + --target-id '' \ + --identifier '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-recovery.md b/examples/2.0.x/console-cli/examples/account/update-recovery.md new file mode 100644 index 000000000..6d6934067 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-recovery.md @@ -0,0 +1,6 @@ +```bash +appwrite account update-recovery \ + --user-id '' \ + --secret '' \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-session.md b/examples/2.0.x/console-cli/examples/account/update-session.md new file mode 100644 index 000000000..d15bb6df0 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-session.md @@ -0,0 +1,4 @@ +```bash +appwrite account update-session \ + --session-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-status.md b/examples/2.0.x/console-cli/examples/account/update-status.md new file mode 100644 index 000000000..c6abeaa88 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-status.md @@ -0,0 +1,3 @@ +```bash +appwrite account update-status +``` diff --git a/examples/2.0.x/console-cli/examples/account/update-verification.md b/examples/2.0.x/console-cli/examples/account/update-verification.md new file mode 100644 index 000000000..3f7f6374c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/account/update-verification.md @@ -0,0 +1,5 @@ +```bash +appwrite account update-verification \ + --user-id '' \ + --secret '' +``` diff --git a/examples/2.0.x/console-cli/examples/advisor/delete-report.md b/examples/2.0.x/console-cli/examples/advisor/delete-report.md new file mode 100644 index 000000000..624041c22 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/advisor/delete-report.md @@ -0,0 +1,4 @@ +```bash +appwrite advisor delete-report \ + --report-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/advisor/get-insight.md b/examples/2.0.x/console-cli/examples/advisor/get-insight.md new file mode 100644 index 000000000..9f9490e82 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/advisor/get-insight.md @@ -0,0 +1,5 @@ +```bash +appwrite advisor get-insight \ + --report-id '' \ + --insight-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/advisor/get-report.md b/examples/2.0.x/console-cli/examples/advisor/get-report.md new file mode 100644 index 000000000..dae03a589 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/advisor/get-report.md @@ -0,0 +1,4 @@ +```bash +appwrite advisor get-report \ + --report-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/advisor/list-insights.md b/examples/2.0.x/console-cli/examples/advisor/list-insights.md new file mode 100644 index 000000000..4b6c2a803 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/advisor/list-insights.md @@ -0,0 +1,5 @@ +```bash +appwrite advisor list-insights \ + --report-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/advisor/list-reports.md b/examples/2.0.x/console-cli/examples/advisor/list-reports.md new file mode 100644 index 000000000..50abda665 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/advisor/list-reports.md @@ -0,0 +1,4 @@ +```bash +appwrite advisor list-reports \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/console/get-email-template.md b/examples/2.0.x/console-cli/examples/console/get-email-template.md new file mode 100644 index 000000000..a9af0b406 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/console/get-email-template.md @@ -0,0 +1,4 @@ +```bash +appwrite console get-email-template \ + --template-id verification +``` diff --git a/examples/2.0.x/console-cli/examples/console/get-resource.md b/examples/2.0.x/console-cli/examples/console/get-resource.md new file mode 100644 index 000000000..2be0926bc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/console/get-resource.md @@ -0,0 +1,5 @@ +```bash +appwrite console get-resource \ + --value '' \ + --type rules +``` diff --git a/examples/2.0.x/console-cli/examples/console/list-o-auth-2-providers.md b/examples/2.0.x/console-cli/examples/console/list-o-auth-2-providers.md new file mode 100644 index 000000000..72ed54aec --- /dev/null +++ b/examples/2.0.x/console-cli/examples/console/list-o-auth-2-providers.md @@ -0,0 +1,3 @@ +```bash +appwrite console list-o-auth-2-providers +``` diff --git a/examples/2.0.x/console-cli/examples/console/list-organization-scopes.md b/examples/2.0.x/console-cli/examples/console/list-organization-scopes.md new file mode 100644 index 000000000..66d090216 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/console/list-organization-scopes.md @@ -0,0 +1,3 @@ +```bash +appwrite console list-organization-scopes +``` diff --git a/examples/2.0.x/console-cli/examples/console/list-project-scopes.md b/examples/2.0.x/console-cli/examples/console/list-project-scopes.md new file mode 100644 index 000000000..e216d24fc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/console/list-project-scopes.md @@ -0,0 +1,3 @@ +```bash +appwrite console list-project-scopes +``` diff --git a/examples/2.0.x/console-cli/examples/console/variables.md b/examples/2.0.x/console-cli/examples/console/variables.md new file mode 100644 index 000000000..044ea4bc7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/console/variables.md @@ -0,0 +1,3 @@ +```bash +appwrite console variables +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-big-int-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..b6723191d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-big-int-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-big-int-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-boolean-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..fdeca8e82 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-boolean-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-boolean-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-collection.md b/examples/2.0.x/console-cli/examples/databases/create-collection.md new file mode 100644 index 000000000..69b1a2374 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-collection.md @@ -0,0 +1,6 @@ +```bash +appwrite databases create-collection \ + --database-id '' \ + --collection-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-datetime-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..2bd727d69 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-datetime-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-datetime-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-document.md b/examples/2.0.x/console-cli/examples/databases/create-document.md new file mode 100644 index 000000000..d14a8498a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-document.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --data '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-documents.md b/examples/2.0.x/console-cli/examples/databases/create-documents.md new file mode 100644 index 000000000..1c9fbfb26 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite databases create-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-email-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..d28ab7bb9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-email-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-email-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-enum-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..b8bef3823 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-enum-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases create-enum-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --elements "active" "inactive" \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-float-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..9d992c0cc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-float-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-float-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-index.md b/examples/2.0.x/console-cli/examples/databases/create-index.md new file mode 100644 index 000000000..266472713 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-index.md @@ -0,0 +1,8 @@ +```bash +appwrite databases create-index \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --type key \ + --attributes one two three +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-integer-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..072a08148 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-integer-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-integer-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-ip-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..8e7371074 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-ip-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-ip-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-line-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..371c418d5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-line-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-line-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-longtext-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..e8126d52e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-longtext-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-longtext-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..cd391c731 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-mediumtext-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-operations.md b/examples/2.0.x/console-cli/examples/databases/create-operations.md new file mode 100644 index 000000000..6f32b8d4d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-operations.md @@ -0,0 +1,4 @@ +```bash +appwrite databases create-operations \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-point-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..e16557a17 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-point-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-point-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-polygon-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..82066257b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-polygon-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-polygon-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-relationship-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..d9842ec8f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-relationship-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-relationship-attribute \ + --database-id '' \ + --collection-id '' \ + --related-collection-id '' \ + --type oneToOne +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-string-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..acbd165e0 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-string-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases create-string-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --size 1 \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-text-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..9836c002a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-text-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-text-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-transaction.md b/examples/2.0.x/console-cli/examples/databases/create-transaction.md new file mode 100644 index 000000000..21449ce88 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-transaction.md @@ -0,0 +1,3 @@ +```bash +appwrite databases create-transaction +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-url-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..2dc8eeaf5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-url-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-url-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create-varchar-attribute.md b/examples/2.0.x/console-cli/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..4aed5c58e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create-varchar-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases create-varchar-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --size 1 \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/create.md b/examples/2.0.x/console-cli/examples/databases/create.md new file mode 100644 index 000000000..1830c72a7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/create.md @@ -0,0 +1,5 @@ +```bash +appwrite databases create \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/decrement-document-attribute.md b/examples/2.0.x/console-cli/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..7cc5cf66d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/decrement-document-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases decrement-document-attribute \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --attribute '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/delete-attribute.md b/examples/2.0.x/console-cli/examples/databases/delete-attribute.md new file mode 100644 index 000000000..bdf44635d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/delete-attribute.md @@ -0,0 +1,6 @@ +```bash +appwrite databases delete-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/delete-collection.md b/examples/2.0.x/console-cli/examples/databases/delete-collection.md new file mode 100644 index 000000000..3f486af26 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/delete-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite databases delete-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/delete-document.md b/examples/2.0.x/console-cli/examples/databases/delete-document.md new file mode 100644 index 000000000..d80be7f12 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/delete-document.md @@ -0,0 +1,6 @@ +```bash +appwrite databases delete-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/delete-documents.md b/examples/2.0.x/console-cli/examples/databases/delete-documents.md new file mode 100644 index 000000000..ae1395c4a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/delete-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite databases delete-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/delete-index.md b/examples/2.0.x/console-cli/examples/databases/delete-index.md new file mode 100644 index 000000000..f21ded857 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/delete-index.md @@ -0,0 +1,6 @@ +```bash +appwrite databases delete-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/delete-transaction.md b/examples/2.0.x/console-cli/examples/databases/delete-transaction.md new file mode 100644 index 000000000..675c906f6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/delete-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite databases delete-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/delete.md b/examples/2.0.x/console-cli/examples/databases/delete.md new file mode 100644 index 000000000..c0696d2ec --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite databases delete \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/get-attribute.md b/examples/2.0.x/console-cli/examples/databases/get-attribute.md new file mode 100644 index 000000000..86d555d60 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/get-attribute.md @@ -0,0 +1,6 @@ +```bash +appwrite databases get-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/get-collection.md b/examples/2.0.x/console-cli/examples/databases/get-collection.md new file mode 100644 index 000000000..247101dfe --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/get-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite databases get-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/get-document.md b/examples/2.0.x/console-cli/examples/databases/get-document.md new file mode 100644 index 000000000..fd99f5ab4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/get-document.md @@ -0,0 +1,6 @@ +```bash +appwrite databases get-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/get-index.md b/examples/2.0.x/console-cli/examples/databases/get-index.md new file mode 100644 index 000000000..f55d80af4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/get-index.md @@ -0,0 +1,6 @@ +```bash +appwrite databases get-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/get-transaction.md b/examples/2.0.x/console-cli/examples/databases/get-transaction.md new file mode 100644 index 000000000..de860ecde --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/get-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite databases get-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/get.md b/examples/2.0.x/console-cli/examples/databases/get.md new file mode 100644 index 000000000..1965bb84f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/get.md @@ -0,0 +1,4 @@ +```bash +appwrite databases get \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/increment-document-attribute.md b/examples/2.0.x/console-cli/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..1d1017e52 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/increment-document-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases increment-document-attribute \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --attribute '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/list-attributes.md b/examples/2.0.x/console-cli/examples/databases/list-attributes.md new file mode 100644 index 000000000..2f3fe4660 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/list-attributes.md @@ -0,0 +1,6 @@ +```bash +appwrite databases list-attributes \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/list-collections.md b/examples/2.0.x/console-cli/examples/databases/list-collections.md new file mode 100644 index 000000000..37aa24c52 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/list-collections.md @@ -0,0 +1,5 @@ +```bash +appwrite databases list-collections \ + --database-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/list-documents.md b/examples/2.0.x/console-cli/examples/databases/list-documents.md new file mode 100644 index 000000000..ea414b29d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/list-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite databases list-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/list-indexes.md b/examples/2.0.x/console-cli/examples/databases/list-indexes.md new file mode 100644 index 000000000..956d9e71d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/list-indexes.md @@ -0,0 +1,6 @@ +```bash +appwrite databases list-indexes \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/list-transactions.md b/examples/2.0.x/console-cli/examples/databases/list-transactions.md new file mode 100644 index 000000000..f74d48bc0 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/list-transactions.md @@ -0,0 +1,4 @@ +```bash +appwrite databases list-transactions \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/list.md b/examples/2.0.x/console-cli/examples/databases/list.md new file mode 100644 index 000000000..dd8c3bb09 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/list.md @@ -0,0 +1,4 @@ +```bash +appwrite databases list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-big-int-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..a371e6fe7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-big-int-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-big-int-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 0 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-boolean-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..af3960fb3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-boolean-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-boolean-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-collection.md b/examples/2.0.x/console-cli/examples/databases/update-collection.md new file mode 100644 index 000000000..fbc6eea05 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite databases update-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-datetime-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..9e78e4a6c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-datetime-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-datetime-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 2020-10-15T06:38:00.000+00:00 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-document.md b/examples/2.0.x/console-cli/examples/databases/update-document.md new file mode 100644 index 000000000..91a131e31 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-document.md @@ -0,0 +1,6 @@ +```bash +appwrite databases update-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-documents.md b/examples/2.0.x/console-cli/examples/databases/update-documents.md new file mode 100644 index 000000000..cfd729d86 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite databases update-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-email-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..1e29ab6c6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-email-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-email-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default email@example.com +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-enum-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..95dac92a6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-enum-attribute.md @@ -0,0 +1,9 @@ +```bash +appwrite databases update-enum-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --elements "active" "inactive" \ + --required false \ + --default active +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-float-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..84949cc50 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-float-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-float-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 10.5 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-integer-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..0239677f5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-integer-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-integer-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 10 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-ip-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..7fe37561b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-ip-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-ip-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 192.0.2.0 +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-line-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..ca4a53f7f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-line-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases update-line-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-longtext-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..27cb4aac4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-longtext-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-longtext-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..27d4569bc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-mediumtext-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-point-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..9a0332913 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-point-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases update-point-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-polygon-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..9b461b8b8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-polygon-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases update-polygon-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-relationship-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..d4b291b23 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-relationship-attribute.md @@ -0,0 +1,6 @@ +```bash +appwrite databases update-relationship-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-string-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..8db9c724f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-string-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-string-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-text-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..d52e97644 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-text-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-text-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-transaction.md b/examples/2.0.x/console-cli/examples/databases/update-transaction.md new file mode 100644 index 000000000..75d9c193c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite databases update-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-url-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..a5e8548ae --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-url-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-url-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default https://example.com +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update-varchar-attribute.md b/examples/2.0.x/console-cli/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..1e726a42b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update-varchar-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-varchar-attribute \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/update.md b/examples/2.0.x/console-cli/examples/databases/update.md new file mode 100644 index 000000000..9821c4f72 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/update.md @@ -0,0 +1,4 @@ +```bash +appwrite databases update \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/upsert-document.md b/examples/2.0.x/console-cli/examples/databases/upsert-document.md new file mode 100644 index 000000000..78a12cc90 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/upsert-document.md @@ -0,0 +1,6 @@ +```bash +appwrite databases upsert-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/databases/upsert-documents.md b/examples/2.0.x/console-cli/examples/databases/upsert-documents.md new file mode 100644 index 000000000..1bb53704a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/databases/upsert-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite databases upsert-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-collection.md b/examples/2.0.x/console-cli/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..8f980b403 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-collection.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb create-collection \ + --database-id '' \ + --collection-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-document.md b/examples/2.0.x/console-cli/examples/documentsdb/create-document.md new file mode 100644 index 000000000..68d4ecf7c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-document.md @@ -0,0 +1,7 @@ +```bash +appwrite documentsdb create-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --data '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..ddaa05eaa --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb create-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-index.md b/examples/2.0.x/console-cli/examples/documentsdb/create-index.md new file mode 100644 index 000000000..1fa9238a3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-index.md @@ -0,0 +1,8 @@ +```bash +appwrite documentsdb create-index \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --type key \ + --attributes one two three +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create-transaction.md b/examples/2.0.x/console-cli/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..88689b617 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create-transaction.md @@ -0,0 +1,3 @@ +```bash +appwrite documentsdb create-transaction +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/create.md b/examples/2.0.x/console-cli/examples/documentsdb/create.md new file mode 100644 index 000000000..bb9289c3e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/create.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb create \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/console-cli/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..47ed69d7f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite documentsdb decrement-document-attribute \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --attribute '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-collection.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..b625997af --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb delete-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-document.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..43ceaa13c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-document.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb delete-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..0d1b48540 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb delete-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-index.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..056d9ea03 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-index.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb delete-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete-transaction.md b/examples/2.0.x/console-cli/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..0f40b7a15 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb delete-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/delete.md b/examples/2.0.x/console-cli/examples/documentsdb/delete.md new file mode 100644 index 000000000..4af9f935d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb delete \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-collection.md b/examples/2.0.x/console-cli/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..ff54073e4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb get-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-document.md b/examples/2.0.x/console-cli/examples/documentsdb/get-document.md new file mode 100644 index 000000000..ff1958b31 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-document.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb get-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-index.md b/examples/2.0.x/console-cli/examples/documentsdb/get-index.md new file mode 100644 index 000000000..2a75462cb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-index.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb get-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get-transaction.md b/examples/2.0.x/console-cli/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..1006a8b36 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb get-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/get.md b/examples/2.0.x/console-cli/examples/documentsdb/get.md new file mode 100644 index 000000000..7edadf333 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/get.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb get \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/console-cli/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..508e8abfb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite documentsdb increment-document-attribute \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --attribute '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-collections.md b/examples/2.0.x/console-cli/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..1dec21a43 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-collections.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb list-collections \ + --database-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..83eca6e83 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb list-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-indexes.md b/examples/2.0.x/console-cli/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..e7b7d269d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-indexes.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb list-indexes \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list-transactions.md b/examples/2.0.x/console-cli/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..187f2055c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list-transactions.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb list-transactions \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/list.md b/examples/2.0.x/console-cli/examples/documentsdb/list.md new file mode 100644 index 000000000..6838fea75 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/list.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update-collection.md b/examples/2.0.x/console-cli/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..d6ff0d6c9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update-collection.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb update-collection \ + --database-id '' \ + --collection-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update-document.md b/examples/2.0.x/console-cli/examples/documentsdb/update-document.md new file mode 100644 index 000000000..4548c5609 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update-document.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb update-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..e84b6ca07 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb update-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update-transaction.md b/examples/2.0.x/console-cli/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..5ae411cc3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite documentsdb update-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/update.md b/examples/2.0.x/console-cli/examples/documentsdb/update.md new file mode 100644 index 000000000..c6ac2440f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/update.md @@ -0,0 +1,5 @@ +```bash +appwrite documentsdb update \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/upsert-document.md b/examples/2.0.x/console-cli/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..7f65bbd64 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/upsert-document.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb upsert-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/documentsdb/upsert-documents.md b/examples/2.0.x/console-cli/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..646977ad2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/documentsdb/upsert-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite documentsdb upsert-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/console-cli/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..b66166f8e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,4 @@ +```bash +appwrite embeddings create-text-embeddings \ + --texts one two three +``` diff --git a/examples/2.0.x/console-cli/examples/functions/create-deployment.md b/examples/2.0.x/console-cli/examples/functions/create-deployment.md new file mode 100644 index 000000000..de08a42d1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/create-deployment.md @@ -0,0 +1,6 @@ +```bash +appwrite functions create-deployment \ + --function-id '' \ + --code 'path/to/file.png' \ + --activate false +``` diff --git a/examples/2.0.x/console-cli/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/console-cli/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..d0f88178c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite functions create-duplicate-deployment \ + --function-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/create-execution.md b/examples/2.0.x/console-cli/examples/functions/create-execution.md new file mode 100644 index 000000000..4970e45b2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/create-execution.md @@ -0,0 +1,4 @@ +```bash +appwrite functions create-execution \ + --function-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/create-template-deployment.md b/examples/2.0.x/console-cli/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..987726b5c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/create-template-deployment.md @@ -0,0 +1,9 @@ +```bash +appwrite functions create-template-deployment \ + --function-id '' \ + --repository '' \ + --owner '' \ + --root-directory '' \ + --type commit \ + --reference '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/create-variable.md b/examples/2.0.x/console-cli/examples/functions/create-variable.md new file mode 100644 index 000000000..4c176c5b5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/create-variable.md @@ -0,0 +1,7 @@ +```bash +appwrite functions create-variable \ + --function-id '' \ + --variable-id '' \ + --key '' \ + --value '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/create-vcs-deployment.md b/examples/2.0.x/console-cli/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..64b27f2df --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/create-vcs-deployment.md @@ -0,0 +1,6 @@ +```bash +appwrite functions create-vcs-deployment \ + --function-id '' \ + --type branch \ + --reference '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/create.md b/examples/2.0.x/console-cli/examples/functions/create.md new file mode 100644 index 000000000..52a7d7f98 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/create.md @@ -0,0 +1,6 @@ +```bash +appwrite functions create \ + --function-id '' \ + --name '' \ + --runtime node-14.5 +``` diff --git a/examples/2.0.x/console-cli/examples/functions/delete-deployment.md b/examples/2.0.x/console-cli/examples/functions/delete-deployment.md new file mode 100644 index 000000000..e093b3a95 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/delete-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite functions delete-deployment \ + --function-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/delete-execution.md b/examples/2.0.x/console-cli/examples/functions/delete-execution.md new file mode 100644 index 000000000..214846f92 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/delete-execution.md @@ -0,0 +1,5 @@ +```bash +appwrite functions delete-execution \ + --function-id '' \ + --execution-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/delete-variable.md b/examples/2.0.x/console-cli/examples/functions/delete-variable.md new file mode 100644 index 000000000..6542e2f1d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/delete-variable.md @@ -0,0 +1,5 @@ +```bash +appwrite functions delete-variable \ + --function-id '' \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/delete.md b/examples/2.0.x/console-cli/examples/functions/delete.md new file mode 100644 index 000000000..cff038bfe --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite functions delete \ + --function-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/get-deployment-download.md b/examples/2.0.x/console-cli/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..fa1f2febb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/get-deployment-download.md @@ -0,0 +1,5 @@ +```bash +appwrite functions get-deployment-download \ + --function-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/get-deployment.md b/examples/2.0.x/console-cli/examples/functions/get-deployment.md new file mode 100644 index 000000000..9facb61f2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/get-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite functions get-deployment \ + --function-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/get-execution.md b/examples/2.0.x/console-cli/examples/functions/get-execution.md new file mode 100644 index 000000000..aca14de37 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/get-execution.md @@ -0,0 +1,5 @@ +```bash +appwrite functions get-execution \ + --function-id '' \ + --execution-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/get-template.md b/examples/2.0.x/console-cli/examples/functions/get-template.md new file mode 100644 index 000000000..457958789 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/get-template.md @@ -0,0 +1,4 @@ +```bash +appwrite functions get-template \ + --template-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/get-variable.md b/examples/2.0.x/console-cli/examples/functions/get-variable.md new file mode 100644 index 000000000..569207329 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/get-variable.md @@ -0,0 +1,5 @@ +```bash +appwrite functions get-variable \ + --function-id '' \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/get.md b/examples/2.0.x/console-cli/examples/functions/get.md new file mode 100644 index 000000000..046829d49 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/get.md @@ -0,0 +1,4 @@ +```bash +appwrite functions get \ + --function-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/list-deployments.md b/examples/2.0.x/console-cli/examples/functions/list-deployments.md new file mode 100644 index 000000000..c09738530 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/list-deployments.md @@ -0,0 +1,5 @@ +```bash +appwrite functions list-deployments \ + --function-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/functions/list-executions.md b/examples/2.0.x/console-cli/examples/functions/list-executions.md new file mode 100644 index 000000000..c1652af62 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/list-executions.md @@ -0,0 +1,5 @@ +```bash +appwrite functions list-executions \ + --function-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/functions/list-runtimes.md b/examples/2.0.x/console-cli/examples/functions/list-runtimes.md new file mode 100644 index 000000000..0e07f8c61 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/list-runtimes.md @@ -0,0 +1,3 @@ +```bash +appwrite functions list-runtimes +``` diff --git a/examples/2.0.x/console-cli/examples/functions/list-specifications.md b/examples/2.0.x/console-cli/examples/functions/list-specifications.md new file mode 100644 index 000000000..912985f02 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/list-specifications.md @@ -0,0 +1,3 @@ +```bash +appwrite functions list-specifications +``` diff --git a/examples/2.0.x/console-cli/examples/functions/list-templates.md b/examples/2.0.x/console-cli/examples/functions/list-templates.md new file mode 100644 index 000000000..d93e21480 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/list-templates.md @@ -0,0 +1,3 @@ +```bash +appwrite functions list-templates +``` diff --git a/examples/2.0.x/console-cli/examples/functions/list-variables.md b/examples/2.0.x/console-cli/examples/functions/list-variables.md new file mode 100644 index 000000000..4b1537220 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/list-variables.md @@ -0,0 +1,5 @@ +```bash +appwrite functions list-variables \ + --function-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/functions/list.md b/examples/2.0.x/console-cli/examples/functions/list.md new file mode 100644 index 000000000..9542b5c7a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/list.md @@ -0,0 +1,4 @@ +```bash +appwrite functions list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/functions/update-deployment-status.md b/examples/2.0.x/console-cli/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..11c578e37 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/update-deployment-status.md @@ -0,0 +1,5 @@ +```bash +appwrite functions update-deployment-status \ + --function-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/update-function-deployment.md b/examples/2.0.x/console-cli/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..d2c04d719 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/update-function-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite functions update-function-deployment \ + --function-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/update-variable.md b/examples/2.0.x/console-cli/examples/functions/update-variable.md new file mode 100644 index 000000000..a6738a8d3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/update-variable.md @@ -0,0 +1,5 @@ +```bash +appwrite functions update-variable \ + --function-id '' \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/functions/update.md b/examples/2.0.x/console-cli/examples/functions/update.md new file mode 100644 index 000000000..21e879ffd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/functions/update.md @@ -0,0 +1,5 @@ +```bash +appwrite functions update \ + --function-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/graphql/mutation.md b/examples/2.0.x/console-cli/examples/graphql/mutation.md new file mode 100644 index 000000000..4666d3020 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/graphql/mutation.md @@ -0,0 +1,4 @@ +```bash +appwrite graphql mutation \ + --query '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/graphql/query.md b/examples/2.0.x/console-cli/examples/graphql/query.md new file mode 100644 index 000000000..9285fbdf6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/graphql/query.md @@ -0,0 +1,4 @@ +```bash +appwrite graphql query \ + --query '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/locale/get.md b/examples/2.0.x/console-cli/examples/locale/get.md new file mode 100644 index 000000000..3c4da34ab --- /dev/null +++ b/examples/2.0.x/console-cli/examples/locale/get.md @@ -0,0 +1,3 @@ +```bash +appwrite locale get +``` diff --git a/examples/2.0.x/console-cli/examples/locale/list-codes.md b/examples/2.0.x/console-cli/examples/locale/list-codes.md new file mode 100644 index 000000000..2bb6e6bad --- /dev/null +++ b/examples/2.0.x/console-cli/examples/locale/list-codes.md @@ -0,0 +1,3 @@ +```bash +appwrite locale list-codes +``` diff --git a/examples/2.0.x/console-cli/examples/locale/list-continents.md b/examples/2.0.x/console-cli/examples/locale/list-continents.md new file mode 100644 index 000000000..74dae6a27 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/locale/list-continents.md @@ -0,0 +1,3 @@ +```bash +appwrite locale list-continents +``` diff --git a/examples/2.0.x/console-cli/examples/locale/list-countries-eu.md b/examples/2.0.x/console-cli/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..e3e0f876d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/locale/list-countries-eu.md @@ -0,0 +1,3 @@ +```bash +appwrite locale list-countries-eu +``` diff --git a/examples/2.0.x/console-cli/examples/locale/list-countries-phones.md b/examples/2.0.x/console-cli/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..1ac104ca5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/locale/list-countries-phones.md @@ -0,0 +1,3 @@ +```bash +appwrite locale list-countries-phones +``` diff --git a/examples/2.0.x/console-cli/examples/locale/list-countries.md b/examples/2.0.x/console-cli/examples/locale/list-countries.md new file mode 100644 index 000000000..8c0f01bc8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/locale/list-countries.md @@ -0,0 +1,3 @@ +```bash +appwrite locale list-countries +``` diff --git a/examples/2.0.x/console-cli/examples/locale/list-currencies.md b/examples/2.0.x/console-cli/examples/locale/list-currencies.md new file mode 100644 index 000000000..bf087d51c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/locale/list-currencies.md @@ -0,0 +1,3 @@ +```bash +appwrite locale list-currencies +``` diff --git a/examples/2.0.x/console-cli/examples/locale/list-languages.md b/examples/2.0.x/console-cli/examples/locale/list-languages.md new file mode 100644 index 000000000..69e5ea4c3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/locale/list-languages.md @@ -0,0 +1,3 @@ +```bash +appwrite locale list-languages +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-apns-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..983f6e0c6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-apns-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-apns-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-email.md b/examples/2.0.x/console-cli/examples/messaging/create-email.md new file mode 100644 index 000000000..a1622aeed --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-email.md @@ -0,0 +1,6 @@ +```bash +appwrite messaging create-email \ + --message-id '' \ + --subject '' \ + --content '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-fcm-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..453bbfa7c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-fcm-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-fcm-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..82e482d01 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-mailgun-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..015fccea1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-msg-91-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-push.md b/examples/2.0.x/console-cli/examples/messaging/create-push.md new file mode 100644 index 000000000..2591798af --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-push.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging create-push \ + --message-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-resend-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..ddd6b7e5f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-resend-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-resend-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..d894b580b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-sendgrid-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-ses-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..36e952f01 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-ses-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-ses-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-sms.md b/examples/2.0.x/console-cli/examples/messaging/create-sms.md new file mode 100644 index 000000000..78fc4014f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-sms.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-sms \ + --message-id '' \ + --content '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-smtp-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..737368730 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-smtp-provider.md @@ -0,0 +1,6 @@ +```bash +appwrite messaging create-smtp-provider \ + --provider-id '' \ + --name '' \ + --host '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-subscriber.md b/examples/2.0.x/console-cli/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..1a46edfc2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-subscriber.md @@ -0,0 +1,6 @@ +```bash +appwrite messaging create-subscriber \ + --topic-id '' \ + --subscriber-id '' \ + --target-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-telesign-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..66fbfe6b1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-telesign-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-telesign-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..d9460dfc3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-textmagic-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-topic.md b/examples/2.0.x/console-cli/examples/messaging/create-topic.md new file mode 100644 index 000000000..01300546d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-topic.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-topic \ + --topic-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-twilio-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..80a1efad7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-twilio-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-twilio-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/create-vonage-provider.md b/examples/2.0.x/console-cli/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..27cec656e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/create-vonage-provider.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging create-vonage-provider \ + --provider-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/delete-provider.md b/examples/2.0.x/console-cli/examples/messaging/delete-provider.md new file mode 100644 index 000000000..6069fa9c3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/delete-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging delete-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/delete-subscriber.md b/examples/2.0.x/console-cli/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..befa626bb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/delete-subscriber.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging delete-subscriber \ + --topic-id '' \ + --subscriber-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/delete-topic.md b/examples/2.0.x/console-cli/examples/messaging/delete-topic.md new file mode 100644 index 000000000..0c73d69d6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/delete-topic.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging delete-topic \ + --topic-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/delete.md b/examples/2.0.x/console-cli/examples/messaging/delete.md new file mode 100644 index 000000000..46f67d378 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging delete \ + --message-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/get-message.md b/examples/2.0.x/console-cli/examples/messaging/get-message.md new file mode 100644 index 000000000..41d3a8b7c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/get-message.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging get-message \ + --message-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/get-provider.md b/examples/2.0.x/console-cli/examples/messaging/get-provider.md new file mode 100644 index 000000000..5b77fb6e6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/get-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging get-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/get-subscriber.md b/examples/2.0.x/console-cli/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..c65df5ecf --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/get-subscriber.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging get-subscriber \ + --topic-id '' \ + --subscriber-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/get-topic.md b/examples/2.0.x/console-cli/examples/messaging/get-topic.md new file mode 100644 index 000000000..089a693b1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/get-topic.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging get-topic \ + --topic-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/list-messages.md b/examples/2.0.x/console-cli/examples/messaging/list-messages.md new file mode 100644 index 000000000..fbbdea826 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/list-messages.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging list-messages \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/list-providers.md b/examples/2.0.x/console-cli/examples/messaging/list-providers.md new file mode 100644 index 000000000..787ee524a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/list-providers.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging list-providers \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/list-subscribers.md b/examples/2.0.x/console-cli/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..ce26b127b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/list-subscribers.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging list-subscribers \ + --topic-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/list-targets.md b/examples/2.0.x/console-cli/examples/messaging/list-targets.md new file mode 100644 index 000000000..95e2f2cc5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/list-targets.md @@ -0,0 +1,5 @@ +```bash +appwrite messaging list-targets \ + --message-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/list-topics.md b/examples/2.0.x/console-cli/examples/messaging/list-topics.md new file mode 100644 index 000000000..3cb2a5dd2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/list-topics.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging list-topics \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-apns-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..c09eab950 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-apns-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-apns-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-email.md b/examples/2.0.x/console-cli/examples/messaging/update-email.md new file mode 100644 index 000000000..aa96d4a0b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-email.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-email \ + --message-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-fcm-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..09e614643 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-fcm-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-fcm-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..b8d9a0b3f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-mailgun-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..34f5de178 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-msg-91-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-push.md b/examples/2.0.x/console-cli/examples/messaging/update-push.md new file mode 100644 index 000000000..c4b315e79 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-push.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-push \ + --message-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-resend-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..ba2561d76 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-resend-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-resend-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..11fffbd22 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-sendgrid-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-ses-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..f47e9cd9a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-ses-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-ses-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-sms.md b/examples/2.0.x/console-cli/examples/messaging/update-sms.md new file mode 100644 index 000000000..c6130ad8c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-sms.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-sms \ + --message-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-smtp-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..1282b1805 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-smtp-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-smtp-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-telesign-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..1baed4ad8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-telesign-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-telesign-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..dc8277eb1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-textmagic-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-topic.md b/examples/2.0.x/console-cli/examples/messaging/update-topic.md new file mode 100644 index 000000000..f1858f883 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-topic.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-topic \ + --topic-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-twilio-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..3aa7eee2f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-twilio-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-twilio-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/messaging/update-vonage-provider.md b/examples/2.0.x/console-cli/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..7a166a95f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/messaging/update-vonage-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite messaging update-vonage-provider \ + --provider-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/create-appwrite-migration.md b/examples/2.0.x/console-cli/examples/migrations/create-appwrite-migration.md new file mode 100644 index 000000000..a1710b861 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/create-appwrite-migration.md @@ -0,0 +1,7 @@ +```bash +appwrite migrations create-appwrite-migration \ + --resources one two three \ + --endpoint https://example.com \ + --project-id '' \ + --api-key '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/create-csv-export.md b/examples/2.0.x/console-cli/examples/migrations/create-csv-export.md new file mode 100644 index 000000000..a43a5e102 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/create-csv-export.md @@ -0,0 +1,7 @@ +```bash +appwrite migrations create-csv-export \ + --database-id '' \ + --collection-id '' \ + --filename '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/create-csv-import.md b/examples/2.0.x/console-cli/examples/migrations/create-csv-import.md new file mode 100644 index 000000000..cdc10231b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/create-csv-import.md @@ -0,0 +1,7 @@ +```bash +appwrite migrations create-csv-import \ + --bucket-id '' \ + --file-id '' \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/create-firebase-migration.md b/examples/2.0.x/console-cli/examples/migrations/create-firebase-migration.md new file mode 100644 index 000000000..363df68e7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/create-firebase-migration.md @@ -0,0 +1,5 @@ +```bash +appwrite migrations create-firebase-migration \ + --resources one two three \ + --service-account '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/create-json-export.md b/examples/2.0.x/console-cli/examples/migrations/create-json-export.md new file mode 100644 index 000000000..b2a6a2a2c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/create-json-export.md @@ -0,0 +1,7 @@ +```bash +appwrite migrations create-json-export \ + --database-id '' \ + --collection-id '' \ + --filename '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/create-json-import.md b/examples/2.0.x/console-cli/examples/migrations/create-json-import.md new file mode 100644 index 000000000..b01e3beb9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/create-json-import.md @@ -0,0 +1,7 @@ +```bash +appwrite migrations create-json-import \ + --bucket-id '' \ + --file-id '' \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/create-n-host-migration.md b/examples/2.0.x/console-cli/examples/migrations/create-n-host-migration.md new file mode 100644 index 000000000..880dec867 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/create-n-host-migration.md @@ -0,0 +1,10 @@ +```bash +appwrite migrations create-n-host-migration \ + --resources one two three \ + --subdomain '' \ + --region '' \ + --admin-secret '' \ + --database '' \ + --username '' \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/create-supabase-migration.md b/examples/2.0.x/console-cli/examples/migrations/create-supabase-migration.md new file mode 100644 index 000000000..67befd133 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/create-supabase-migration.md @@ -0,0 +1,9 @@ +```bash +appwrite migrations create-supabase-migration \ + --resources one two three \ + --endpoint https://example.com \ + --api-key '' \ + --database-host '' \ + --username '' \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/delete.md b/examples/2.0.x/console-cli/examples/migrations/delete.md new file mode 100644 index 000000000..d84c00147 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite migrations delete \ + --migration-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/get-appwrite-report.md b/examples/2.0.x/console-cli/examples/migrations/get-appwrite-report.md new file mode 100644 index 000000000..2c9c039f7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/get-appwrite-report.md @@ -0,0 +1,7 @@ +```bash +appwrite migrations get-appwrite-report \ + --resources one two three \ + --endpoint https://example.com \ + --project-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/get-firebase-report.md b/examples/2.0.x/console-cli/examples/migrations/get-firebase-report.md new file mode 100644 index 000000000..ebd4da56d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/get-firebase-report.md @@ -0,0 +1,5 @@ +```bash +appwrite migrations get-firebase-report \ + --resources one two three \ + --service-account '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/get-n-host-report.md b/examples/2.0.x/console-cli/examples/migrations/get-n-host-report.md new file mode 100644 index 000000000..29a308a51 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/get-n-host-report.md @@ -0,0 +1,10 @@ +```bash +appwrite migrations get-n-host-report \ + --resources one two three \ + --subdomain '' \ + --region '' \ + --admin-secret '' \ + --database '' \ + --username '' \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/get-supabase-report.md b/examples/2.0.x/console-cli/examples/migrations/get-supabase-report.md new file mode 100644 index 000000000..421c62a94 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/get-supabase-report.md @@ -0,0 +1,9 @@ +```bash +appwrite migrations get-supabase-report \ + --resources one two three \ + --endpoint https://example.com \ + --api-key '' \ + --database-host '' \ + --username '' \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/get.md b/examples/2.0.x/console-cli/examples/migrations/get.md new file mode 100644 index 000000000..6375d3ceb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/get.md @@ -0,0 +1,4 @@ +```bash +appwrite migrations get \ + --migration-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/list.md b/examples/2.0.x/console-cli/examples/migrations/list.md new file mode 100644 index 000000000..7aa5c19f4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/list.md @@ -0,0 +1,4 @@ +```bash +appwrite migrations list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/migrations/retry.md b/examples/2.0.x/console-cli/examples/migrations/retry.md new file mode 100644 index 000000000..47c2bdfab --- /dev/null +++ b/examples/2.0.x/console-cli/examples/migrations/retry.md @@ -0,0 +1,4 @@ +```bash +appwrite migrations retry \ + --migration-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/notifications/list.md b/examples/2.0.x/console-cli/examples/notifications/list.md new file mode 100644 index 000000000..3e5a8452c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/notifications/list.md @@ -0,0 +1,4 @@ +```bash +appwrite notifications list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/notifications/update.md b/examples/2.0.x/console-cli/examples/notifications/update.md new file mode 100644 index 000000000..eb94723d8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/notifications/update.md @@ -0,0 +1,5 @@ +```bash +appwrite notifications update \ + --notification-id '' \ + --read false +``` diff --git a/examples/2.0.x/console-cli/examples/organization/create-project.md b/examples/2.0.x/console-cli/examples/organization/create-project.md new file mode 100644 index 000000000..bf3e7c00c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/organization/create-project.md @@ -0,0 +1,5 @@ +```bash +appwrite organization create-project \ + --project-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/organization/delete-project.md b/examples/2.0.x/console-cli/examples/organization/delete-project.md new file mode 100644 index 000000000..3adffb749 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/organization/delete-project.md @@ -0,0 +1,4 @@ +```bash +appwrite organization delete-project \ + --project-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/organization/get-project.md b/examples/2.0.x/console-cli/examples/organization/get-project.md new file mode 100644 index 000000000..b646de3ef --- /dev/null +++ b/examples/2.0.x/console-cli/examples/organization/get-project.md @@ -0,0 +1,4 @@ +```bash +appwrite organization get-project \ + --project-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/organization/list-projects.md b/examples/2.0.x/console-cli/examples/organization/list-projects.md new file mode 100644 index 000000000..e9562a36a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/organization/list-projects.md @@ -0,0 +1,4 @@ +```bash +appwrite organization list-projects \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/organization/update-project.md b/examples/2.0.x/console-cli/examples/organization/update-project.md new file mode 100644 index 000000000..967236421 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/organization/update-project.md @@ -0,0 +1,5 @@ +```bash +appwrite organization update-project \ + --project-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/presences/delete.md b/examples/2.0.x/console-cli/examples/presences/delete.md new file mode 100644 index 000000000..10b3e84b2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/presences/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite presences delete \ + --presence-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/presences/get.md b/examples/2.0.x/console-cli/examples/presences/get.md new file mode 100644 index 000000000..745f34d00 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/presences/get.md @@ -0,0 +1,4 @@ +```bash +appwrite presences get \ + --presence-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/presences/list.md b/examples/2.0.x/console-cli/examples/presences/list.md new file mode 100644 index 000000000..83c776663 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/presences/list.md @@ -0,0 +1,4 @@ +```bash +appwrite presences list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/presences/update.md b/examples/2.0.x/console-cli/examples/presences/update.md new file mode 100644 index 000000000..1e3ddfa6a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/presences/update.md @@ -0,0 +1,4 @@ +```bash +appwrite presences update \ + --presence-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/presences/upsert.md b/examples/2.0.x/console-cli/examples/presences/upsert.md new file mode 100644 index 000000000..810a64732 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/presences/upsert.md @@ -0,0 +1,5 @@ +```bash +appwrite presences upsert \ + --presence-id '' \ + --status '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-android-platform.md b/examples/2.0.x/console-cli/examples/project/create-android-platform.md new file mode 100644 index 000000000..8bbbf384f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-android-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project create-android-platform \ + --platform-id '' \ + --name '' \ + --application-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-apple-platform.md b/examples/2.0.x/console-cli/examples/project/create-apple-platform.md new file mode 100644 index 000000000..a901050c3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-apple-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project create-apple-platform \ + --platform-id '' \ + --name '' \ + --bundle-identifier '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-ephemeral-key.md b/examples/2.0.x/console-cli/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..d4ab3852b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-ephemeral-key.md @@ -0,0 +1,5 @@ +```bash +appwrite project create-ephemeral-key \ + --scopes one two three \ + --duration 600 +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-key.md b/examples/2.0.x/console-cli/examples/project/create-key.md new file mode 100644 index 000000000..46a879046 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-key.md @@ -0,0 +1,6 @@ +```bash +appwrite project create-key \ + --key-id '' \ + --name '' \ + --scopes one two three +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-linux-platform.md b/examples/2.0.x/console-cli/examples/project/create-linux-platform.md new file mode 100644 index 000000000..beb8f9240 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-linux-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project create-linux-platform \ + --platform-id '' \ + --name '' \ + --package-name '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-mock-phone.md b/examples/2.0.x/console-cli/examples/project/create-mock-phone.md new file mode 100644 index 000000000..3fb1f7bf1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-mock-phone.md @@ -0,0 +1,5 @@ +```bash +appwrite project create-mock-phone \ + --number +12065550100 \ + --otp '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-smtp-test.md b/examples/2.0.x/console-cli/examples/project/create-smtp-test.md new file mode 100644 index 000000000..01393020b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-smtp-test.md @@ -0,0 +1,4 @@ +```bash +appwrite project create-smtp-test \ + --emails one two three +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-variable.md b/examples/2.0.x/console-cli/examples/project/create-variable.md new file mode 100644 index 000000000..e269a7d26 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-variable.md @@ -0,0 +1,6 @@ +```bash +appwrite project create-variable \ + --variable-id '' \ + --key '' \ + --value '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-web-platform.md b/examples/2.0.x/console-cli/examples/project/create-web-platform.md new file mode 100644 index 000000000..acd9dd12a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-web-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project create-web-platform \ + --platform-id '' \ + --name '' \ + --hostname app.example.com +``` diff --git a/examples/2.0.x/console-cli/examples/project/create-windows-platform.md b/examples/2.0.x/console-cli/examples/project/create-windows-platform.md new file mode 100644 index 000000000..80a9ada87 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/create-windows-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project create-windows-platform \ + --platform-id '' \ + --name '' \ + --package-identifier-name '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/delete-key.md b/examples/2.0.x/console-cli/examples/project/delete-key.md new file mode 100644 index 000000000..40a519d00 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/delete-key.md @@ -0,0 +1,4 @@ +```bash +appwrite project delete-key \ + --key-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/delete-mock-phone.md b/examples/2.0.x/console-cli/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..7e817c34c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/delete-mock-phone.md @@ -0,0 +1,4 @@ +```bash +appwrite project delete-mock-phone \ + --number +12065550100 +``` diff --git a/examples/2.0.x/console-cli/examples/project/delete-platform.md b/examples/2.0.x/console-cli/examples/project/delete-platform.md new file mode 100644 index 000000000..d9e3a2e7c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/delete-platform.md @@ -0,0 +1,4 @@ +```bash +appwrite project delete-platform \ + --platform-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/delete-variable.md b/examples/2.0.x/console-cli/examples/project/delete-variable.md new file mode 100644 index 000000000..b6dcdd953 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/delete-variable.md @@ -0,0 +1,4 @@ +```bash +appwrite project delete-variable \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/delete.md b/examples/2.0.x/console-cli/examples/project/delete.md new file mode 100644 index 000000000..376dee039 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/delete.md @@ -0,0 +1,3 @@ +```bash +appwrite project delete +``` diff --git a/examples/2.0.x/console-cli/examples/project/get-email-template.md b/examples/2.0.x/console-cli/examples/project/get-email-template.md new file mode 100644 index 000000000..f9219fd71 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/get-email-template.md @@ -0,0 +1,4 @@ +```bash +appwrite project get-email-template \ + --template-id verification +``` diff --git a/examples/2.0.x/console-cli/examples/project/get-key.md b/examples/2.0.x/console-cli/examples/project/get-key.md new file mode 100644 index 000000000..3cc64f5bf --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/get-key.md @@ -0,0 +1,4 @@ +```bash +appwrite project get-key \ + --key-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/get-mock-phone.md b/examples/2.0.x/console-cli/examples/project/get-mock-phone.md new file mode 100644 index 000000000..a4437830b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/get-mock-phone.md @@ -0,0 +1,4 @@ +```bash +appwrite project get-mock-phone \ + --number +12065550100 +``` diff --git a/examples/2.0.x/console-cli/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/console-cli/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..1c54d95c9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,4 @@ +```bash +appwrite project get-o-auth-2-provider \ + --provider-id amazon +``` diff --git a/examples/2.0.x/console-cli/examples/project/get-platform.md b/examples/2.0.x/console-cli/examples/project/get-platform.md new file mode 100644 index 000000000..3bd70b1d2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/get-platform.md @@ -0,0 +1,4 @@ +```bash +appwrite project get-platform \ + --platform-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/get-policy.md b/examples/2.0.x/console-cli/examples/project/get-policy.md new file mode 100644 index 000000000..3ad505055 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/get-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project get-policy \ + --policy-id password-dictionary +``` diff --git a/examples/2.0.x/console-cli/examples/project/get-variable.md b/examples/2.0.x/console-cli/examples/project/get-variable.md new file mode 100644 index 000000000..c2de87ac3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/get-variable.md @@ -0,0 +1,4 @@ +```bash +appwrite project get-variable \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/get.md b/examples/2.0.x/console-cli/examples/project/get.md new file mode 100644 index 000000000..a1a1b4b5f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/get.md @@ -0,0 +1,3 @@ +```bash +appwrite project get +``` diff --git a/examples/2.0.x/console-cli/examples/project/list-email-templates.md b/examples/2.0.x/console-cli/examples/project/list-email-templates.md new file mode 100644 index 000000000..ea26ea338 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/list-email-templates.md @@ -0,0 +1,4 @@ +```bash +appwrite project list-email-templates \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/project/list-keys.md b/examples/2.0.x/console-cli/examples/project/list-keys.md new file mode 100644 index 000000000..ce3e44e3b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/list-keys.md @@ -0,0 +1,4 @@ +```bash +appwrite project list-keys \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/project/list-mock-phones.md b/examples/2.0.x/console-cli/examples/project/list-mock-phones.md new file mode 100644 index 000000000..16a0b9304 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/list-mock-phones.md @@ -0,0 +1,4 @@ +```bash +appwrite project list-mock-phones \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/console-cli/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..fe4d21d13 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,4 @@ +```bash +appwrite project list-o-auth-2-providers \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/project/list-platforms.md b/examples/2.0.x/console-cli/examples/project/list-platforms.md new file mode 100644 index 000000000..0c61bb5f2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/list-platforms.md @@ -0,0 +1,4 @@ +```bash +appwrite project list-platforms \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/project/list-policies.md b/examples/2.0.x/console-cli/examples/project/list-policies.md new file mode 100644 index 000000000..61aa6d4bd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/list-policies.md @@ -0,0 +1,4 @@ +```bash +appwrite project list-policies \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/project/list-variables.md b/examples/2.0.x/console-cli/examples/project/list-variables.md new file mode 100644 index 000000000..5ab4c9d9e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/list-variables.md @@ -0,0 +1,4 @@ +```bash +appwrite project list-variables \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-android-platform.md b/examples/2.0.x/console-cli/examples/project/update-android-platform.md new file mode 100644 index 000000000..41e0aa643 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-android-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project update-android-platform \ + --platform-id '' \ + --name '' \ + --application-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-apple-platform.md b/examples/2.0.x/console-cli/examples/project/update-apple-platform.md new file mode 100644 index 000000000..ecbc3ab35 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-apple-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project update-apple-platform \ + --platform-id '' \ + --name '' \ + --bundle-identifier '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-auth-method.md b/examples/2.0.x/console-cli/examples/project/update-auth-method.md new file mode 100644 index 000000000..45ca9a749 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-auth-method.md @@ -0,0 +1,5 @@ +```bash +appwrite project update-auth-method \ + --method-id email-password \ + --enabled false +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-email-template.md b/examples/2.0.x/console-cli/examples/project/update-email-template.md new file mode 100644 index 000000000..4b1d0976f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-email-template.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-email-template \ + --template-id verification +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-key.md b/examples/2.0.x/console-cli/examples/project/update-key.md new file mode 100644 index 000000000..bb7159140 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-key.md @@ -0,0 +1,6 @@ +```bash +appwrite project update-key \ + --key-id '' \ + --name '' \ + --scopes one two three +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-labels.md b/examples/2.0.x/console-cli/examples/project/update-labels.md new file mode 100644 index 000000000..df4703c72 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-labels.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-labels \ + --labels one two three +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-linux-platform.md b/examples/2.0.x/console-cli/examples/project/update-linux-platform.md new file mode 100644 index 000000000..a6c5f7b8b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-linux-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project update-linux-platform \ + --platform-id '' \ + --name '' \ + --package-name '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/console-cli/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..e700fd9de --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-membership-privacy-policy +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/console-cli/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..3757cdd2d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-mfa-factors-policy +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-mock-phone.md b/examples/2.0.x/console-cli/examples/project/update-mock-phone.md new file mode 100644 index 000000000..e32ea9175 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-mock-phone.md @@ -0,0 +1,5 @@ +```bash +appwrite project update-mock-phone \ + --number +12065550100 \ + --otp '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..fd478a992 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-amazon +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..6b74296b4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-apple +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..025140f8a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-appwrite +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..84fc78203 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-auth-0 +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..9eaf8366c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-authentik +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..fb1146551 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-autodesk +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..685fa8d2e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-bitbucket +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..48426eb37 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-bitly +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-box.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..e9ad37c7a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-box.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-box +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..1c631d20c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-cloudflare +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..36897064c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-dailymotion +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..83362d114 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-discord +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..d34026f39 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-disqus +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..d2c2ee970 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-dropbox +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..c8ed2e1c6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-etsy +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..a9d50ec4e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-facebook +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..a689ce49d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-figma +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..f22e1e407 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-fusion-auth +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..a3b08096d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-git-hub +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..fd883f2c6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-gitlab +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-google.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..aab34410d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-google.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-google +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..1f3b22943 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-hugging-face +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..39ca172b2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-keycloak +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..ed41a4c38 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-kick +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..f2bfef2bc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-linkedin +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..1eb97419c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-microsoft +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..249e6bc04 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-notion +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..70446b62f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-oidc +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..e98bb24bd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-okta +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..56afb4c0c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-paypal-sandbox +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..2a84b3507 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-paypal +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..0e6ec3a8a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-podio +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..b28867c24 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-resend +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..b4832b0c6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-salesforce +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..039856987 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-slack +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..3d9d8efe3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-spotify +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..cc317881e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-stripe +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..cf13b34b5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-tradeshift-sandbox +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..1bf3e8896 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-tradeshift +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..cb4f970dc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-twitch +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..51db13835 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-word-press +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..1cac8450a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-yahoo +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..8d3670559 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-yandex +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..54dd7d072 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-zoho +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..ee5bbf743 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2-zoom +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-o-auth-2x.md b/examples/2.0.x/console-cli/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..e1b988ddf --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-o-auth-2x.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-o-auth-2x +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/console-cli/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..37b9a564e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-password-dictionary-policy \ + --enabled false +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-password-history-policy.md b/examples/2.0.x/console-cli/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..4d5fa257a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-password-history-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-password-history-policy \ + --total 1 +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/console-cli/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..5adb1391a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-password-personal-data-policy \ + --enabled false +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-password-strength-policy.md b/examples/2.0.x/console-cli/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..baa7ca9f5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-password-strength-policy.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-password-strength-policy +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-protocol.md b/examples/2.0.x/console-cli/examples/project/update-protocol.md new file mode 100644 index 000000000..ff486476e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-protocol.md @@ -0,0 +1,5 @@ +```bash +appwrite project update-protocol \ + --protocol-id rest \ + --enabled false +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-service.md b/examples/2.0.x/console-cli/examples/project/update-service.md new file mode 100644 index 000000000..778224817 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-service.md @@ -0,0 +1,5 @@ +```bash +appwrite project update-service \ + --service-id account \ + --enabled false +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-session-alert-policy.md b/examples/2.0.x/console-cli/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..67e666be0 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-session-alert-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-session-alert-policy \ + --enabled false +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-session-duration-policy.md b/examples/2.0.x/console-cli/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..a454de14c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-session-duration-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-session-duration-policy \ + --duration 60 +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/console-cli/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..14a54b82b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-session-invalidation-policy \ + --enabled false +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-session-limit-policy.md b/examples/2.0.x/console-cli/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..b706a9eb9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-session-limit-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-session-limit-policy \ + --total 1 +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-smtp.md b/examples/2.0.x/console-cli/examples/project/update-smtp.md new file mode 100644 index 000000000..bb7cd389d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-smtp.md @@ -0,0 +1,3 @@ +```bash +appwrite project update-smtp +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-user-limit-policy.md b/examples/2.0.x/console-cli/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..fcdecd602 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-user-limit-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-user-limit-policy \ + --total 0 +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-variable.md b/examples/2.0.x/console-cli/examples/project/update-variable.md new file mode 100644 index 000000000..d1b03cadf --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-variable.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-variable \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-web-platform.md b/examples/2.0.x/console-cli/examples/project/update-web-platform.md new file mode 100644 index 000000000..3b770fad3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-web-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project update-web-platform \ + --platform-id '' \ + --name '' \ + --hostname app.example.com +``` diff --git a/examples/2.0.x/console-cli/examples/project/update-windows-platform.md b/examples/2.0.x/console-cli/examples/project/update-windows-platform.md new file mode 100644 index 000000000..b9853e947 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/project/update-windows-platform.md @@ -0,0 +1,6 @@ +```bash +appwrite project update-windows-platform \ + --platform-id '' \ + --name '' \ + --package-identifier-name '' +``` diff --git a/examples/2.0.x/console-cli/examples/projects/create-schedule.md b/examples/2.0.x/console-cli/examples/projects/create-schedule.md new file mode 100644 index 000000000..26de3e6b7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/create-schedule.md @@ -0,0 +1,7 @@ +```bash +appwrite projects create-schedule \ + --project-id '' \ + --resource-type function \ + --resource-id '' \ + --schedule '0 0 * * *' +``` diff --git a/examples/2.0.x/console-cli/examples/projects/delete-dev-key.md b/examples/2.0.x/console-cli/examples/projects/delete-dev-key.md new file mode 100644 index 000000000..5b94d084e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/delete-dev-key.md @@ -0,0 +1,5 @@ +```bash +appwrite projects delete-dev-key \ + --project-id '' \ + --key-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/projects/get-dev-key.md b/examples/2.0.x/console-cli/examples/projects/get-dev-key.md new file mode 100644 index 000000000..66894cb78 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/get-dev-key.md @@ -0,0 +1,5 @@ +```bash +appwrite projects get-dev-key \ + --project-id '' \ + --key-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/projects/get-schedule.md b/examples/2.0.x/console-cli/examples/projects/get-schedule.md new file mode 100644 index 000000000..a5e0030f9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/get-schedule.md @@ -0,0 +1,5 @@ +```bash +appwrite projects get-schedule \ + --project-id '' \ + --schedule-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/projects/list-dev-keys.md b/examples/2.0.x/console-cli/examples/projects/list-dev-keys.md new file mode 100644 index 000000000..27271c959 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/list-dev-keys.md @@ -0,0 +1,5 @@ +```bash +appwrite projects list-dev-keys \ + --project-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/projects/list-schedules.md b/examples/2.0.x/console-cli/examples/projects/list-schedules.md new file mode 100644 index 000000000..fc3d3f4bb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/list-schedules.md @@ -0,0 +1,5 @@ +```bash +appwrite projects list-schedules \ + --project-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/projects/list-stages.md b/examples/2.0.x/console-cli/examples/projects/list-stages.md new file mode 100644 index 000000000..7d4a2bc47 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/list-stages.md @@ -0,0 +1,4 @@ +```bash +appwrite projects list-stages \ + --project-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/projects/update-dev-key.md b/examples/2.0.x/console-cli/examples/projects/update-dev-key.md new file mode 100644 index 000000000..a8cdc6909 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/update-dev-key.md @@ -0,0 +1,7 @@ +```bash +appwrite projects update-dev-key \ + --project-id '' \ + --key-id '' \ + --name '' \ + --expire 2020-10-15T06:38:00.000+00:00 +``` diff --git a/examples/2.0.x/console-cli/examples/projects/update-stage.md b/examples/2.0.x/console-cli/examples/projects/update-stage.md new file mode 100644 index 000000000..c3d9e5016 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/update-stage.md @@ -0,0 +1,5 @@ +```bash +appwrite projects update-stage \ + --project-id '' \ + --stage-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/projects/update-team.md b/examples/2.0.x/console-cli/examples/projects/update-team.md new file mode 100644 index 000000000..2e097c52e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/projects/update-team.md @@ -0,0 +1,5 @@ +```bash +appwrite projects update-team \ + --project-id '' \ + --team-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/proxy/create-api-rule.md b/examples/2.0.x/console-cli/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..54c672f4e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/proxy/create-api-rule.md @@ -0,0 +1,4 @@ +```bash +appwrite proxy create-api-rule \ + --domain example.com +``` diff --git a/examples/2.0.x/console-cli/examples/proxy/create-function-rule.md b/examples/2.0.x/console-cli/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..60e985d4a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/proxy/create-function-rule.md @@ -0,0 +1,5 @@ +```bash +appwrite proxy create-function-rule \ + --domain example.com \ + --function-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/proxy/create-redirect-rule.md b/examples/2.0.x/console-cli/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..f01b2a8a6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/proxy/create-redirect-rule.md @@ -0,0 +1,8 @@ +```bash +appwrite proxy create-redirect-rule \ + --domain example.com \ + --url https://example.com \ + --status-code 301 \ + --resource-id '' \ + --resource-type site +``` diff --git a/examples/2.0.x/console-cli/examples/proxy/create-site-rule.md b/examples/2.0.x/console-cli/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..2f92f789d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/proxy/create-site-rule.md @@ -0,0 +1,5 @@ +```bash +appwrite proxy create-site-rule \ + --domain example.com \ + --site-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/proxy/delete-rule.md b/examples/2.0.x/console-cli/examples/proxy/delete-rule.md new file mode 100644 index 000000000..57ad3bfa2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/proxy/delete-rule.md @@ -0,0 +1,4 @@ +```bash +appwrite proxy delete-rule \ + --rule-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/proxy/get-rule.md b/examples/2.0.x/console-cli/examples/proxy/get-rule.md new file mode 100644 index 000000000..ec3a65fc5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/proxy/get-rule.md @@ -0,0 +1,4 @@ +```bash +appwrite proxy get-rule \ + --rule-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/proxy/list-rules.md b/examples/2.0.x/console-cli/examples/proxy/list-rules.md new file mode 100644 index 000000000..219fdfc76 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/proxy/list-rules.md @@ -0,0 +1,4 @@ +```bash +appwrite proxy list-rules \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/proxy/update-rule-status.md b/examples/2.0.x/console-cli/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..dfec60623 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/proxy/update-rule-status.md @@ -0,0 +1,4 @@ +```bash +appwrite proxy update-rule-status \ + --rule-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/create-deployment.md b/examples/2.0.x/console-cli/examples/sites/create-deployment.md new file mode 100644 index 000000000..1a357aea2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/create-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite sites create-deployment \ + --site-id '' \ + --code 'path/to/file.png' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/console-cli/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..5bfaee5d8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite sites create-duplicate-deployment \ + --site-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/create-template-deployment.md b/examples/2.0.x/console-cli/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..85cf64bfe --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/create-template-deployment.md @@ -0,0 +1,9 @@ +```bash +appwrite sites create-template-deployment \ + --site-id '' \ + --repository '' \ + --owner '' \ + --root-directory '' \ + --type branch \ + --reference '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/create-variable.md b/examples/2.0.x/console-cli/examples/sites/create-variable.md new file mode 100644 index 000000000..96c315229 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/create-variable.md @@ -0,0 +1,7 @@ +```bash +appwrite sites create-variable \ + --site-id '' \ + --variable-id '' \ + --key '' \ + --value '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/create-vcs-deployment.md b/examples/2.0.x/console-cli/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..8e90c68a9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/create-vcs-deployment.md @@ -0,0 +1,6 @@ +```bash +appwrite sites create-vcs-deployment \ + --site-id '' \ + --type branch \ + --reference '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/create.md b/examples/2.0.x/console-cli/examples/sites/create.md new file mode 100644 index 000000000..b35ddb107 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/create.md @@ -0,0 +1,7 @@ +```bash +appwrite sites create \ + --site-id '' \ + --name '' \ + --framework analog \ + --build-runtime node-14.5 +``` diff --git a/examples/2.0.x/console-cli/examples/sites/delete-deployment.md b/examples/2.0.x/console-cli/examples/sites/delete-deployment.md new file mode 100644 index 000000000..0ce19d756 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/delete-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite sites delete-deployment \ + --site-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/delete-log.md b/examples/2.0.x/console-cli/examples/sites/delete-log.md new file mode 100644 index 000000000..4b169297a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/delete-log.md @@ -0,0 +1,5 @@ +```bash +appwrite sites delete-log \ + --site-id '' \ + --log-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/delete-variable.md b/examples/2.0.x/console-cli/examples/sites/delete-variable.md new file mode 100644 index 000000000..d732c6115 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/delete-variable.md @@ -0,0 +1,5 @@ +```bash +appwrite sites delete-variable \ + --site-id '' \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/delete.md b/examples/2.0.x/console-cli/examples/sites/delete.md new file mode 100644 index 000000000..0abffe51d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite sites delete \ + --site-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/get-deployment-download.md b/examples/2.0.x/console-cli/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..2a033d018 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/get-deployment-download.md @@ -0,0 +1,5 @@ +```bash +appwrite sites get-deployment-download \ + --site-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/get-deployment.md b/examples/2.0.x/console-cli/examples/sites/get-deployment.md new file mode 100644 index 000000000..ed21bff46 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/get-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite sites get-deployment \ + --site-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/get-log.md b/examples/2.0.x/console-cli/examples/sites/get-log.md new file mode 100644 index 000000000..d0fc1cc08 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/get-log.md @@ -0,0 +1,5 @@ +```bash +appwrite sites get-log \ + --site-id '' \ + --log-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/get-template.md b/examples/2.0.x/console-cli/examples/sites/get-template.md new file mode 100644 index 000000000..eaf573d96 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/get-template.md @@ -0,0 +1,4 @@ +```bash +appwrite sites get-template \ + --template-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/get-variable.md b/examples/2.0.x/console-cli/examples/sites/get-variable.md new file mode 100644 index 000000000..4f9c4cc90 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/get-variable.md @@ -0,0 +1,5 @@ +```bash +appwrite sites get-variable \ + --site-id '' \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/get.md b/examples/2.0.x/console-cli/examples/sites/get.md new file mode 100644 index 000000000..e800e72e2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/get.md @@ -0,0 +1,4 @@ +```bash +appwrite sites get \ + --site-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/list-deployments.md b/examples/2.0.x/console-cli/examples/sites/list-deployments.md new file mode 100644 index 000000000..7ff8a22fa --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/list-deployments.md @@ -0,0 +1,5 @@ +```bash +appwrite sites list-deployments \ + --site-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/sites/list-frameworks.md b/examples/2.0.x/console-cli/examples/sites/list-frameworks.md new file mode 100644 index 000000000..809b725f6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/list-frameworks.md @@ -0,0 +1,3 @@ +```bash +appwrite sites list-frameworks +``` diff --git a/examples/2.0.x/console-cli/examples/sites/list-logs.md b/examples/2.0.x/console-cli/examples/sites/list-logs.md new file mode 100644 index 000000000..9b060e155 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/list-logs.md @@ -0,0 +1,5 @@ +```bash +appwrite sites list-logs \ + --site-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/sites/list-specifications.md b/examples/2.0.x/console-cli/examples/sites/list-specifications.md new file mode 100644 index 000000000..6107240c3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/list-specifications.md @@ -0,0 +1,3 @@ +```bash +appwrite sites list-specifications +``` diff --git a/examples/2.0.x/console-cli/examples/sites/list-templates.md b/examples/2.0.x/console-cli/examples/sites/list-templates.md new file mode 100644 index 000000000..46d6629eb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/list-templates.md @@ -0,0 +1,3 @@ +```bash +appwrite sites list-templates +``` diff --git a/examples/2.0.x/console-cli/examples/sites/list-variables.md b/examples/2.0.x/console-cli/examples/sites/list-variables.md new file mode 100644 index 000000000..480cfcfd2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/list-variables.md @@ -0,0 +1,5 @@ +```bash +appwrite sites list-variables \ + --site-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/sites/list.md b/examples/2.0.x/console-cli/examples/sites/list.md new file mode 100644 index 000000000..025a917dd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/list.md @@ -0,0 +1,4 @@ +```bash +appwrite sites list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/sites/update-deployment-status.md b/examples/2.0.x/console-cli/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..bf0a8d1a5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/update-deployment-status.md @@ -0,0 +1,5 @@ +```bash +appwrite sites update-deployment-status \ + --site-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/update-site-deployment.md b/examples/2.0.x/console-cli/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..396ff8b7f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/update-site-deployment.md @@ -0,0 +1,5 @@ +```bash +appwrite sites update-site-deployment \ + --site-id '' \ + --deployment-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/update-variable.md b/examples/2.0.x/console-cli/examples/sites/update-variable.md new file mode 100644 index 000000000..c667eca16 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/update-variable.md @@ -0,0 +1,5 @@ +```bash +appwrite sites update-variable \ + --site-id '' \ + --variable-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/sites/update.md b/examples/2.0.x/console-cli/examples/sites/update.md new file mode 100644 index 000000000..9f7a455b5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/sites/update.md @@ -0,0 +1,6 @@ +```bash +appwrite sites update \ + --site-id '' \ + --name '' \ + --framework analog +``` diff --git a/examples/2.0.x/console-cli/examples/storage/create-bucket.md b/examples/2.0.x/console-cli/examples/storage/create-bucket.md new file mode 100644 index 000000000..0baa69676 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/create-bucket.md @@ -0,0 +1,5 @@ +```bash +appwrite storage create-bucket \ + --bucket-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/create-file.md b/examples/2.0.x/console-cli/examples/storage/create-file.md new file mode 100644 index 000000000..c5b90a5c3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/create-file.md @@ -0,0 +1,6 @@ +```bash +appwrite storage create-file \ + --bucket-id '' \ + --file-id '' \ + --file 'path/to/file.png' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/delete-bucket.md b/examples/2.0.x/console-cli/examples/storage/delete-bucket.md new file mode 100644 index 000000000..8c7b37152 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/delete-bucket.md @@ -0,0 +1,4 @@ +```bash +appwrite storage delete-bucket \ + --bucket-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/delete-file.md b/examples/2.0.x/console-cli/examples/storage/delete-file.md new file mode 100644 index 000000000..637b5de3c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/delete-file.md @@ -0,0 +1,5 @@ +```bash +appwrite storage delete-file \ + --bucket-id '' \ + --file-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/get-bucket.md b/examples/2.0.x/console-cli/examples/storage/get-bucket.md new file mode 100644 index 000000000..0faabb102 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/get-bucket.md @@ -0,0 +1,4 @@ +```bash +appwrite storage get-bucket \ + --bucket-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/get-file-download.md b/examples/2.0.x/console-cli/examples/storage/get-file-download.md new file mode 100644 index 000000000..dd8880eab --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/get-file-download.md @@ -0,0 +1,5 @@ +```bash +appwrite storage get-file-download \ + --bucket-id '' \ + --file-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/get-file-preview.md b/examples/2.0.x/console-cli/examples/storage/get-file-preview.md new file mode 100644 index 000000000..e088ab221 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/get-file-preview.md @@ -0,0 +1,5 @@ +```bash +appwrite storage get-file-preview \ + --bucket-id '' \ + --file-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/get-file-view.md b/examples/2.0.x/console-cli/examples/storage/get-file-view.md new file mode 100644 index 000000000..92409c4aa --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/get-file-view.md @@ -0,0 +1,5 @@ +```bash +appwrite storage get-file-view \ + --bucket-id '' \ + --file-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/get-file.md b/examples/2.0.x/console-cli/examples/storage/get-file.md new file mode 100644 index 000000000..f8271b5b4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/get-file.md @@ -0,0 +1,5 @@ +```bash +appwrite storage get-file \ + --bucket-id '' \ + --file-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/list-buckets.md b/examples/2.0.x/console-cli/examples/storage/list-buckets.md new file mode 100644 index 000000000..3208c83d6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/list-buckets.md @@ -0,0 +1,4 @@ +```bash +appwrite storage list-buckets \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/storage/list-files.md b/examples/2.0.x/console-cli/examples/storage/list-files.md new file mode 100644 index 000000000..d6e297341 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/list-files.md @@ -0,0 +1,5 @@ +```bash +appwrite storage list-files \ + --bucket-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/storage/update-bucket.md b/examples/2.0.x/console-cli/examples/storage/update-bucket.md new file mode 100644 index 000000000..8c11b683f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/update-bucket.md @@ -0,0 +1,5 @@ +```bash +appwrite storage update-bucket \ + --bucket-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/storage/update-file.md b/examples/2.0.x/console-cli/examples/storage/update-file.md new file mode 100644 index 000000000..50cda08e3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/storage/update-file.md @@ -0,0 +1,5 @@ +```bash +appwrite storage update-file \ + --bucket-id '' \ + --file-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..f1e9c85c5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-big-int-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..7ead222a6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-boolean-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..da3632a4a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-datetime-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-email-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..5d2b7cb2a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-email-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-email-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-enum-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..0b1bb126c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-enum-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb create-enum-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --elements "active" "inactive" \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-float-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..4021c25ee --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-float-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-float-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-index.md b/examples/2.0.x/console-cli/examples/tablesdb/create-index.md new file mode 100644 index 000000000..e65d50ea7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-index.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb create-index \ + --database-id '' \ + --table-id '' \ + --key '' \ + --type key \ + --columns one two three +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-integer-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..b647af7e3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-integer-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-integer-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-ip-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..9b05de2e1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-ip-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-ip-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-line-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..6f484b321 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-line-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-line-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..00655468e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-longtext-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..348b4c0d6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-mediumtext-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-operations.md b/examples/2.0.x/console-cli/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..9b4428e2d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-operations.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb create-operations \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-point-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..7f0754ef0 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-point-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-point-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..03bc4192c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-polygon-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..8ec22c10f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-relationship-column \ + --database-id '' \ + --table-id '' \ + --related-table-id '' \ + --type oneToOne +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-row.md b/examples/2.0.x/console-cli/examples/tablesdb/create-row.md new file mode 100644 index 000000000..c44e11505 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-row.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-row \ + --database-id '' \ + --table-id '' \ + --row-id '' \ + --data '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-rows.md b/examples/2.0.x/console-cli/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..6e02c78dc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-rows.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb create-rows \ + --database-id '' \ + --table-id '' \ + --rows one two three +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-string-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..33c99a9df --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-string-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb create-string-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --size 1 \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-table.md b/examples/2.0.x/console-cli/examples/tablesdb/create-table.md new file mode 100644 index 000000000..7707bd1c1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-table.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb create-table \ + --database-id '' \ + --table-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-text-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..773c9c36e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-text-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-text-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-transaction.md b/examples/2.0.x/console-cli/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..149932ed0 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-transaction.md @@ -0,0 +1,3 @@ +```bash +appwrite tablesdb create-transaction +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-url-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..b01d7b965 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-url-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb create-url-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/console-cli/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..4049c3956 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb create-varchar-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --size 1 \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/create.md b/examples/2.0.x/console-cli/examples/tablesdb/create.md new file mode 100644 index 000000000..b096dd66d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/create.md @@ -0,0 +1,5 @@ +```bash +appwrite tablesdb create \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/console-cli/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..40a4df3ee --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb decrement-row-column \ + --database-id '' \ + --table-id '' \ + --row-id '' \ + --column '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/delete-column.md b/examples/2.0.x/console-cli/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..a98ca510b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/delete-column.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb delete-column \ + --database-id '' \ + --table-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/delete-index.md b/examples/2.0.x/console-cli/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..9e741898f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/delete-index.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb delete-index \ + --database-id '' \ + --table-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/delete-row.md b/examples/2.0.x/console-cli/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..f5a8cefca --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/delete-row.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb delete-row \ + --database-id '' \ + --table-id '' \ + --row-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/delete-rows.md b/examples/2.0.x/console-cli/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..9f1f22c5b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/delete-rows.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb delete-rows \ + --database-id '' \ + --table-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/delete-table.md b/examples/2.0.x/console-cli/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..e0f265e22 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/delete-table.md @@ -0,0 +1,5 @@ +```bash +appwrite tablesdb delete-table \ + --database-id '' \ + --table-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/delete-transaction.md b/examples/2.0.x/console-cli/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..94efd46ab --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/delete-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb delete-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/delete.md b/examples/2.0.x/console-cli/examples/tablesdb/delete.md new file mode 100644 index 000000000..39e8acfa7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb delete \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/get-column.md b/examples/2.0.x/console-cli/examples/tablesdb/get-column.md new file mode 100644 index 000000000..09edc5371 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/get-column.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb get-column \ + --database-id '' \ + --table-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/get-index.md b/examples/2.0.x/console-cli/examples/tablesdb/get-index.md new file mode 100644 index 000000000..42b525ac7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/get-index.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb get-index \ + --database-id '' \ + --table-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/get-row.md b/examples/2.0.x/console-cli/examples/tablesdb/get-row.md new file mode 100644 index 000000000..c5968fed8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/get-row.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb get-row \ + --database-id '' \ + --table-id '' \ + --row-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/get-table.md b/examples/2.0.x/console-cli/examples/tablesdb/get-table.md new file mode 100644 index 000000000..e2a41bc66 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/get-table.md @@ -0,0 +1,5 @@ +```bash +appwrite tablesdb get-table \ + --database-id '' \ + --table-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/get-transaction.md b/examples/2.0.x/console-cli/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..5d378a5d1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/get-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb get-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/get.md b/examples/2.0.x/console-cli/examples/tablesdb/get.md new file mode 100644 index 000000000..ccf78a8d2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/get.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb get \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/increment-row-column.md b/examples/2.0.x/console-cli/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..1d0cd9288 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/increment-row-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb increment-row-column \ + --database-id '' \ + --table-id '' \ + --row-id '' \ + --column '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/list-columns.md b/examples/2.0.x/console-cli/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..7fb2fdce8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/list-columns.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb list-columns \ + --database-id '' \ + --table-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/list-indexes.md b/examples/2.0.x/console-cli/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..fc6e57c75 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/list-indexes.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb list-indexes \ + --database-id '' \ + --table-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/list-rows.md b/examples/2.0.x/console-cli/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..df1493de5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/list-rows.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb list-rows \ + --database-id '' \ + --table-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/list-tables.md b/examples/2.0.x/console-cli/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..1381c2558 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/list-tables.md @@ -0,0 +1,5 @@ +```bash +appwrite tablesdb list-tables \ + --database-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/list-transactions.md b/examples/2.0.x/console-cli/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..58802bf7b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/list-transactions.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb list-transactions \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/list.md b/examples/2.0.x/console-cli/examples/tablesdb/list.md new file mode 100644 index 000000000..97db8a14b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/list.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..4166589c6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-big-int-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 0 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..3f060bf71 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-boolean-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..27087b030 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-datetime-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 2020-10-15T06:38:00.000+00:00 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-email-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..6068c567c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-email-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-email-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default email@example.com +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-enum-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..b1acb10b7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-enum-column.md @@ -0,0 +1,9 @@ +```bash +appwrite tablesdb update-enum-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --elements "active" "inactive" \ + --required false \ + --default active +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-float-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..a6ca8d8eb --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-float-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-float-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 10.5 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-integer-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..ee9ca7f8f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-integer-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-integer-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 10 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-ip-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..4cf98de9c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-ip-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-ip-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 192.0.2.0 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-line-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..e4bb8acbf --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-line-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb update-line-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..c65db39b3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-longtext-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..da61b0d5e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-mediumtext-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-point-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..c1608cc4a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-point-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb update-point-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..30ac311a1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tablesdb update-polygon-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..057fe25c4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb update-relationship-column \ + --database-id '' \ + --table-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-row.md b/examples/2.0.x/console-cli/examples/tablesdb/update-row.md new file mode 100644 index 000000000..0fd5d107c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-row.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb update-row \ + --database-id '' \ + --table-id '' \ + --row-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-rows.md b/examples/2.0.x/console-cli/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..2e18af7e7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-rows.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb update-rows \ + --database-id '' \ + --table-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-string-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..04a5c67b1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-string-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-string-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-table.md b/examples/2.0.x/console-cli/examples/tablesdb/update-table.md new file mode 100644 index 000000000..930ef0662 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-table.md @@ -0,0 +1,5 @@ +```bash +appwrite tablesdb update-table \ + --database-id '' \ + --table-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-text-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..075d5b346 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-text-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-text-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-transaction.md b/examples/2.0.x/console-cli/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..74a235453 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb update-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-url-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..a25b355d9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-url-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-url-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default https://example.com +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/console-cli/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..28667f42e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tablesdb update-varchar-column \ + --database-id '' \ + --table-id '' \ + --key '' \ + --required false \ + --default 'Hello World' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/update.md b/examples/2.0.x/console-cli/examples/tablesdb/update.md new file mode 100644 index 000000000..e7364a75b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/update.md @@ -0,0 +1,4 @@ +```bash +appwrite tablesdb update \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/upsert-row.md b/examples/2.0.x/console-cli/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..37e8aae96 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/upsert-row.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb upsert-row \ + --database-id '' \ + --table-id '' \ + --row-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tablesdb/upsert-rows.md b/examples/2.0.x/console-cli/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..2a435ca54 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tablesdb/upsert-rows.md @@ -0,0 +1,6 @@ +```bash +appwrite tablesdb upsert-rows \ + --database-id '' \ + --table-id '' \ + --rows one two three +``` diff --git a/examples/2.0.x/console-cli/examples/teams/create-membership.md b/examples/2.0.x/console-cli/examples/teams/create-membership.md new file mode 100644 index 000000000..1105702d5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/create-membership.md @@ -0,0 +1,5 @@ +```bash +appwrite teams create-membership \ + --team-id '' \ + --roles one two three +``` diff --git a/examples/2.0.x/console-cli/examples/teams/create.md b/examples/2.0.x/console-cli/examples/teams/create.md new file mode 100644 index 000000000..c89888c11 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/create.md @@ -0,0 +1,5 @@ +```bash +appwrite teams create \ + --team-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/teams/delete-membership.md b/examples/2.0.x/console-cli/examples/teams/delete-membership.md new file mode 100644 index 000000000..2d763ec35 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/delete-membership.md @@ -0,0 +1,5 @@ +```bash +appwrite teams delete-membership \ + --team-id '' \ + --membership-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/teams/delete.md b/examples/2.0.x/console-cli/examples/teams/delete.md new file mode 100644 index 000000000..22e23d6f9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite teams delete \ + --team-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/teams/get-membership.md b/examples/2.0.x/console-cli/examples/teams/get-membership.md new file mode 100644 index 000000000..407d83835 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/get-membership.md @@ -0,0 +1,5 @@ +```bash +appwrite teams get-membership \ + --team-id '' \ + --membership-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/teams/get-prefs.md b/examples/2.0.x/console-cli/examples/teams/get-prefs.md new file mode 100644 index 000000000..b40a1bc2d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/get-prefs.md @@ -0,0 +1,4 @@ +```bash +appwrite teams get-prefs \ + --team-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/teams/get.md b/examples/2.0.x/console-cli/examples/teams/get.md new file mode 100644 index 000000000..f76d49fb1 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/get.md @@ -0,0 +1,4 @@ +```bash +appwrite teams get \ + --team-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/teams/list-memberships.md b/examples/2.0.x/console-cli/examples/teams/list-memberships.md new file mode 100644 index 000000000..d0d76584a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/list-memberships.md @@ -0,0 +1,5 @@ +```bash +appwrite teams list-memberships \ + --team-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/teams/list.md b/examples/2.0.x/console-cli/examples/teams/list.md new file mode 100644 index 000000000..8a783324a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/list.md @@ -0,0 +1,4 @@ +```bash +appwrite teams list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/teams/update-membership-status.md b/examples/2.0.x/console-cli/examples/teams/update-membership-status.md new file mode 100644 index 000000000..6cfbe941e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/update-membership-status.md @@ -0,0 +1,7 @@ +```bash +appwrite teams update-membership-status \ + --team-id '' \ + --membership-id '' \ + --user-id '' \ + --secret '' +``` diff --git a/examples/2.0.x/console-cli/examples/teams/update-membership.md b/examples/2.0.x/console-cli/examples/teams/update-membership.md new file mode 100644 index 000000000..b885d3fd4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/update-membership.md @@ -0,0 +1,6 @@ +```bash +appwrite teams update-membership \ + --team-id '' \ + --membership-id '' \ + --roles one two three +``` diff --git a/examples/2.0.x/console-cli/examples/teams/update-name.md b/examples/2.0.x/console-cli/examples/teams/update-name.md new file mode 100644 index 000000000..4c2587643 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/update-name.md @@ -0,0 +1,5 @@ +```bash +appwrite teams update-name \ + --team-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/teams/update-prefs.md b/examples/2.0.x/console-cli/examples/teams/update-prefs.md new file mode 100644 index 000000000..dd9b45cba --- /dev/null +++ b/examples/2.0.x/console-cli/examples/teams/update-prefs.md @@ -0,0 +1,5 @@ +```bash +appwrite teams update-prefs \ + --team-id '' \ + --prefs '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/tokens/create-file-token.md b/examples/2.0.x/console-cli/examples/tokens/create-file-token.md new file mode 100644 index 000000000..a2278ca63 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tokens/create-file-token.md @@ -0,0 +1,5 @@ +```bash +appwrite tokens create-file-token \ + --bucket-id '' \ + --file-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tokens/delete.md b/examples/2.0.x/console-cli/examples/tokens/delete.md new file mode 100644 index 000000000..368543d5d --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tokens/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite tokens delete \ + --token-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tokens/get.md b/examples/2.0.x/console-cli/examples/tokens/get.md new file mode 100644 index 000000000..5d431d8e4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tokens/get.md @@ -0,0 +1,4 @@ +```bash +appwrite tokens get \ + --token-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/tokens/list.md b/examples/2.0.x/console-cli/examples/tokens/list.md new file mode 100644 index 000000000..ac160c95f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tokens/list.md @@ -0,0 +1,6 @@ +```bash +appwrite tokens list \ + --bucket-id '' \ + --file-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/tokens/update.md b/examples/2.0.x/console-cli/examples/tokens/update.md new file mode 100644 index 000000000..1da862381 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/tokens/update.md @@ -0,0 +1,4 @@ +```bash +appwrite tokens update \ + --token-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/usage/list-events.md b/examples/2.0.x/console-cli/examples/usage/list-events.md new file mode 100644 index 000000000..2e7eeb56a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/usage/list-events.md @@ -0,0 +1,4 @@ +```bash +appwrite usage list-events \ + --metrics one two three +``` diff --git a/examples/2.0.x/console-cli/examples/usage/list-gauges.md b/examples/2.0.x/console-cli/examples/usage/list-gauges.md new file mode 100644 index 000000000..377bcc660 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/usage/list-gauges.md @@ -0,0 +1,4 @@ +```bash +appwrite usage list-gauges \ + --metrics one two three +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-argon-2-user.md b/examples/2.0.x/console-cli/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..a1af340f8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-argon-2-user.md @@ -0,0 +1,6 @@ +```bash +appwrite users create-argon-2-user \ + --user-id '' \ + --email email@example.com \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-bcrypt-user.md b/examples/2.0.x/console-cli/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..1ef7456ae --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-bcrypt-user.md @@ -0,0 +1,6 @@ +```bash +appwrite users create-bcrypt-user \ + --user-id '' \ + --email email@example.com \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-jwt.md b/examples/2.0.x/console-cli/examples/users/create-jwt.md new file mode 100644 index 000000000..13c8d8d40 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-jwt.md @@ -0,0 +1,4 @@ +```bash +appwrite users create-jwt \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-md-5-user.md b/examples/2.0.x/console-cli/examples/users/create-md-5-user.md new file mode 100644 index 000000000..3d475e336 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-md-5-user.md @@ -0,0 +1,6 @@ +```bash +appwrite users create-md-5-user \ + --user-id '' \ + --email email@example.com \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/console-cli/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..387f7f432 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,4 @@ +```bash +appwrite users create-mfa-recovery-codes \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-ph-pass-user.md b/examples/2.0.x/console-cli/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..89ce92e56 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-ph-pass-user.md @@ -0,0 +1,6 @@ +```bash +appwrite users create-ph-pass-user \ + --user-id '' \ + --email email@example.com \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/console-cli/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..820bda8c3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,9 @@ +```bash +appwrite users create-scrypt-modified-user \ + --user-id '' \ + --email email@example.com \ + --password password \ + --password-salt '' \ + --password-salt-separator '' \ + --password-signer-key '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-scrypt-user.md b/examples/2.0.x/console-cli/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..5a06135e4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-scrypt-user.md @@ -0,0 +1,11 @@ +```bash +appwrite users create-scrypt-user \ + --user-id '' \ + --email email@example.com \ + --password password \ + --password-salt '' \ + --password-cpu 8 \ + --password-memory 65536 \ + --password-parallel 1 \ + --password-length 64 +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-session.md b/examples/2.0.x/console-cli/examples/users/create-session.md new file mode 100644 index 000000000..f9a4f2315 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-session.md @@ -0,0 +1,4 @@ +```bash +appwrite users create-session \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-sha-user.md b/examples/2.0.x/console-cli/examples/users/create-sha-user.md new file mode 100644 index 000000000..a7251a7e9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-sha-user.md @@ -0,0 +1,6 @@ +```bash +appwrite users create-sha-user \ + --user-id '' \ + --email email@example.com \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-target.md b/examples/2.0.x/console-cli/examples/users/create-target.md new file mode 100644 index 000000000..6f7a1eac9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-target.md @@ -0,0 +1,7 @@ +```bash +appwrite users create-target \ + --user-id '' \ + --target-id '' \ + --provider-type email \ + --identifier '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/create-token.md b/examples/2.0.x/console-cli/examples/users/create-token.md new file mode 100644 index 000000000..1c3ed3b97 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create-token.md @@ -0,0 +1,4 @@ +```bash +appwrite users create-token \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/create.md b/examples/2.0.x/console-cli/examples/users/create.md new file mode 100644 index 000000000..54e253253 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/create.md @@ -0,0 +1,4 @@ +```bash +appwrite users create \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/delete-identity.md b/examples/2.0.x/console-cli/examples/users/delete-identity.md new file mode 100644 index 000000000..e87bde4d2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/delete-identity.md @@ -0,0 +1,4 @@ +```bash +appwrite users delete-identity \ + --identity-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/console-cli/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..b3e818345 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,5 @@ +```bash +appwrite users delete-mfa-authenticator \ + --user-id '' \ + --type totp +``` diff --git a/examples/2.0.x/console-cli/examples/users/delete-session.md b/examples/2.0.x/console-cli/examples/users/delete-session.md new file mode 100644 index 000000000..d7050f693 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/delete-session.md @@ -0,0 +1,5 @@ +```bash +appwrite users delete-session \ + --user-id '' \ + --session-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/delete-sessions.md b/examples/2.0.x/console-cli/examples/users/delete-sessions.md new file mode 100644 index 000000000..70d2db43a --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/delete-sessions.md @@ -0,0 +1,4 @@ +```bash +appwrite users delete-sessions \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/delete-target.md b/examples/2.0.x/console-cli/examples/users/delete-target.md new file mode 100644 index 000000000..9c1a74d36 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/delete-target.md @@ -0,0 +1,5 @@ +```bash +appwrite users delete-target \ + --user-id '' \ + --target-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/delete.md b/examples/2.0.x/console-cli/examples/users/delete.md new file mode 100644 index 000000000..e2f4ac223 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite users delete \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/get-mfa-challenge.md b/examples/2.0.x/console-cli/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..5b75c59a9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/get-mfa-challenge.md @@ -0,0 +1,5 @@ +```bash +appwrite users get-mfa-challenge \ + --user-id '' \ + --challenge-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/console-cli/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..35ad080ba --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,4 @@ +```bash +appwrite users get-mfa-recovery-codes \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/get-prefs.md b/examples/2.0.x/console-cli/examples/users/get-prefs.md new file mode 100644 index 000000000..dd4f7fb09 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/get-prefs.md @@ -0,0 +1,4 @@ +```bash +appwrite users get-prefs \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/get-target.md b/examples/2.0.x/console-cli/examples/users/get-target.md new file mode 100644 index 000000000..0120f25ee --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/get-target.md @@ -0,0 +1,5 @@ +```bash +appwrite users get-target \ + --user-id '' \ + --target-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/get.md b/examples/2.0.x/console-cli/examples/users/get.md new file mode 100644 index 000000000..50a5c748e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/get.md @@ -0,0 +1,4 @@ +```bash +appwrite users get \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/list-identities.md b/examples/2.0.x/console-cli/examples/users/list-identities.md new file mode 100644 index 000000000..49032aa1b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/list-identities.md @@ -0,0 +1,4 @@ +```bash +appwrite users list-identities \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/users/list-memberships.md b/examples/2.0.x/console-cli/examples/users/list-memberships.md new file mode 100644 index 000000000..12ee4aaf2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/list-memberships.md @@ -0,0 +1,5 @@ +```bash +appwrite users list-memberships \ + --user-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/users/list-mfa-factors.md b/examples/2.0.x/console-cli/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..2e03ae190 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/list-mfa-factors.md @@ -0,0 +1,4 @@ +```bash +appwrite users list-mfa-factors \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/list-sessions.md b/examples/2.0.x/console-cli/examples/users/list-sessions.md new file mode 100644 index 000000000..edfe8c314 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/list-sessions.md @@ -0,0 +1,4 @@ +```bash +appwrite users list-sessions \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/list-targets.md b/examples/2.0.x/console-cli/examples/users/list-targets.md new file mode 100644 index 000000000..257667b7e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/list-targets.md @@ -0,0 +1,5 @@ +```bash +appwrite users list-targets \ + --user-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/users/list.md b/examples/2.0.x/console-cli/examples/users/list.md new file mode 100644 index 000000000..7d1e4bc2e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/list.md @@ -0,0 +1,4 @@ +```bash +appwrite users list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-email-verification.md b/examples/2.0.x/console-cli/examples/users/update-email-verification.md new file mode 100644 index 000000000..68a53d9ec --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-email-verification.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-email-verification \ + --user-id '' \ + --email-verification false +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-email.md b/examples/2.0.x/console-cli/examples/users/update-email.md new file mode 100644 index 000000000..40d38ae73 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-email.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-email \ + --user-id '' \ + --email email@example.com +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-impersonator.md b/examples/2.0.x/console-cli/examples/users/update-impersonator.md new file mode 100644 index 000000000..1669722ab --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-impersonator.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-impersonator \ + --user-id '' \ + --impersonator false +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-labels.md b/examples/2.0.x/console-cli/examples/users/update-labels.md new file mode 100644 index 000000000..68f7fc081 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-labels.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-labels \ + --user-id '' \ + --labels one two three +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/console-cli/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..c3f7c72a8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,4 @@ +```bash +appwrite users update-mfa-recovery-codes \ + --user-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-mfa.md b/examples/2.0.x/console-cli/examples/users/update-mfa.md new file mode 100644 index 000000000..68c09a524 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-mfa.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-mfa \ + --user-id '' \ + --mfa false +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-name.md b/examples/2.0.x/console-cli/examples/users/update-name.md new file mode 100644 index 000000000..fc6be3c42 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-name.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-name \ + --user-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-password.md b/examples/2.0.x/console-cli/examples/users/update-password.md new file mode 100644 index 000000000..df9d36405 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-password.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-password \ + --user-id '' \ + --password password +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-phone-verification.md b/examples/2.0.x/console-cli/examples/users/update-phone-verification.md new file mode 100644 index 000000000..c161f06fd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-phone-verification.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-phone-verification \ + --user-id '' \ + --phone-verification false +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-phone.md b/examples/2.0.x/console-cli/examples/users/update-phone.md new file mode 100644 index 000000000..5392a9696 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-phone.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-phone \ + --user-id '' \ + --number +12065550100 +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-prefs.md b/examples/2.0.x/console-cli/examples/users/update-prefs.md new file mode 100644 index 000000000..b7942f73f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-prefs.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-prefs \ + --user-id '' \ + --prefs '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-status.md b/examples/2.0.x/console-cli/examples/users/update-status.md new file mode 100644 index 000000000..5312d0c71 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-status.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-status \ + --user-id '' \ + --status false +``` diff --git a/examples/2.0.x/console-cli/examples/users/update-target.md b/examples/2.0.x/console-cli/examples/users/update-target.md new file mode 100644 index 000000000..5eeb2b028 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/users/update-target.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-target \ + --user-id '' \ + --target-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/create-repository-detection.md b/examples/2.0.x/console-cli/examples/vcs/create-repository-detection.md new file mode 100644 index 000000000..6e295a5ed --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/create-repository-detection.md @@ -0,0 +1,6 @@ +```bash +appwrite vcs create-repository-detection \ + --installation-id '' \ + --provider-repository-id '' \ + --type runtime +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/create-repository.md b/examples/2.0.x/console-cli/examples/vcs/create-repository.md new file mode 100644 index 000000000..320123caf --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/create-repository.md @@ -0,0 +1,6 @@ +```bash +appwrite vcs create-repository \ + --installation-id '' \ + --name '' \ + --private false +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/delete-installation.md b/examples/2.0.x/console-cli/examples/vcs/delete-installation.md new file mode 100644 index 000000000..ae83d46ef --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/delete-installation.md @@ -0,0 +1,4 @@ +```bash +appwrite vcs delete-installation \ + --installation-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/get-installation.md b/examples/2.0.x/console-cli/examples/vcs/get-installation.md new file mode 100644 index 000000000..975460006 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/get-installation.md @@ -0,0 +1,4 @@ +```bash +appwrite vcs get-installation \ + --installation-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/get-repository-contents.md b/examples/2.0.x/console-cli/examples/vcs/get-repository-contents.md new file mode 100644 index 000000000..84b9717a7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/get-repository-contents.md @@ -0,0 +1,5 @@ +```bash +appwrite vcs get-repository-contents \ + --installation-id '' \ + --provider-repository-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/get-repository.md b/examples/2.0.x/console-cli/examples/vcs/get-repository.md new file mode 100644 index 000000000..602b20bef --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/get-repository.md @@ -0,0 +1,5 @@ +```bash +appwrite vcs get-repository \ + --installation-id '' \ + --provider-repository-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/list-installations.md b/examples/2.0.x/console-cli/examples/vcs/list-installations.md new file mode 100644 index 000000000..b78449bf8 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/list-installations.md @@ -0,0 +1,4 @@ +```bash +appwrite vcs list-installations \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/list-namespaces.md b/examples/2.0.x/console-cli/examples/vcs/list-namespaces.md new file mode 100644 index 000000000..3c5af9815 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/list-namespaces.md @@ -0,0 +1,5 @@ +```bash +appwrite vcs list-namespaces \ + --installation-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/list-repositories.md b/examples/2.0.x/console-cli/examples/vcs/list-repositories.md new file mode 100644 index 000000000..eba5888f3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/list-repositories.md @@ -0,0 +1,6 @@ +```bash +appwrite vcs list-repositories \ + --installation-id '' \ + --type runtime \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/list-repository-branches.md b/examples/2.0.x/console-cli/examples/vcs/list-repository-branches.md new file mode 100644 index 000000000..a19758b80 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/list-repository-branches.md @@ -0,0 +1,6 @@ +```bash +appwrite vcs list-repository-branches \ + --installation-id '' \ + --provider-repository-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vcs/update-external-deployments.md b/examples/2.0.x/console-cli/examples/vcs/update-external-deployments.md new file mode 100644 index 000000000..e3c8078c3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vcs/update-external-deployments.md @@ -0,0 +1,6 @@ +```bash +appwrite vcs update-external-deployments \ + --installation-id '' \ + --repository-id '' \ + --provider-pull-request-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-collection.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..c03fd786c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-collection.md @@ -0,0 +1,7 @@ +```bash +appwrite vectorsdb create-collection \ + --database-id '' \ + --collection-id '' \ + --name '' \ + --dimension 1 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..4fdd19bd7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-document.md @@ -0,0 +1,7 @@ +```bash +appwrite vectorsdb create-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' \ + --data '{ "key": "value" }' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..a47c7dc0b --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb create-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-index.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..98d47f7de --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-index.md @@ -0,0 +1,8 @@ +```bash +appwrite vectorsdb create-index \ + --database-id '' \ + --collection-id '' \ + --key '' \ + --type hnsw_euclidean \ + --attributes one two three +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-operations.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..6ce4e7c22 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-operations.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb create-operations \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-query.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..582a16dcd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-query.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb create-query \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create-transaction.md b/examples/2.0.x/console-cli/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..490406a3f --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create-transaction.md @@ -0,0 +1,3 @@ +```bash +appwrite vectorsdb create-transaction +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/create.md b/examples/2.0.x/console-cli/examples/vectorsdb/create.md new file mode 100644 index 000000000..a863caa15 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/create.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb create \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-collection.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..9f123c9d5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb delete-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..78029bce2 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-document.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb delete-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..b9a531b73 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb delete-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-index.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..ce3f8a91c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-index.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb delete-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..59062aef5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb delete-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/delete.md b/examples/2.0.x/console-cli/examples/vectorsdb/delete.md new file mode 100644 index 000000000..d681a332c --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb delete \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-collection.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..0759bb8c5 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-collection.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb get-collection \ + --database-id '' \ + --collection-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..17571f5cd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-document.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb get-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-index.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..9444017b9 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-index.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb get-index \ + --database-id '' \ + --collection-id '' \ + --key '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get-transaction.md b/examples/2.0.x/console-cli/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..ca23c4943 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb get-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/get.md b/examples/2.0.x/console-cli/examples/vectorsdb/get.md new file mode 100644 index 000000000..2faaf41a7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/get.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb get \ + --database-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-collections.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..13cae17fd --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-collections.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb list-collections \ + --database-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..3cf9203cc --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb list-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-indexes.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..cec349c74 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-indexes.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb list-indexes \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list-transactions.md b/examples/2.0.x/console-cli/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..526e7a149 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list-transactions.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb list-transactions \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/list.md b/examples/2.0.x/console-cli/examples/vectorsdb/list.md new file mode 100644 index 000000000..4168e0dd6 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/list.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update-collection.md b/examples/2.0.x/console-cli/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..4d962a905 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update-collection.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb update-collection \ + --database-id '' \ + --collection-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..ae1856c10 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update-document.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb update-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..90eebc50e --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb update-documents \ + --database-id '' \ + --collection-id '' \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update-transaction.md b/examples/2.0.x/console-cli/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..cfcb79f80 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update-transaction.md @@ -0,0 +1,4 @@ +```bash +appwrite vectorsdb update-transaction \ + --transaction-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/update.md b/examples/2.0.x/console-cli/examples/vectorsdb/update.md new file mode 100644 index 000000000..4ba16bd63 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/update.md @@ -0,0 +1,5 @@ +```bash +appwrite vectorsdb update \ + --database-id '' \ + --name '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/upsert-document.md b/examples/2.0.x/console-cli/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..74ca86e14 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/upsert-document.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb upsert-document \ + --database-id '' \ + --collection-id '' \ + --document-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/console-cli/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..01ca49d71 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,6 @@ +```bash +appwrite vectorsdb upsert-documents \ + --database-id '' \ + --collection-id '' \ + --documents one two three +``` diff --git a/examples/2.0.x/console-cli/examples/webhooks/create.md b/examples/2.0.x/console-cli/examples/webhooks/create.md new file mode 100644 index 000000000..5683ae0e3 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/webhooks/create.md @@ -0,0 +1,7 @@ +```bash +appwrite webhooks create \ + --webhook-id '' \ + --url https://example.com/webhook \ + --name '' \ + --events one two three +``` diff --git a/examples/2.0.x/console-cli/examples/webhooks/delete.md b/examples/2.0.x/console-cli/examples/webhooks/delete.md new file mode 100644 index 000000000..5c7707ab7 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/webhooks/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite webhooks delete \ + --webhook-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/webhooks/get.md b/examples/2.0.x/console-cli/examples/webhooks/get.md new file mode 100644 index 000000000..135e6b512 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/webhooks/get.md @@ -0,0 +1,4 @@ +```bash +appwrite webhooks get \ + --webhook-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/webhooks/list.md b/examples/2.0.x/console-cli/examples/webhooks/list.md new file mode 100644 index 000000000..bbf2f8ac0 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/webhooks/list.md @@ -0,0 +1,4 @@ +```bash +appwrite webhooks list \ + --limit 25 +``` diff --git a/examples/2.0.x/console-cli/examples/webhooks/update-secret.md b/examples/2.0.x/console-cli/examples/webhooks/update-secret.md new file mode 100644 index 000000000..f42a4eba4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/webhooks/update-secret.md @@ -0,0 +1,4 @@ +```bash +appwrite webhooks update-secret \ + --webhook-id '' +``` diff --git a/examples/2.0.x/console-cli/examples/webhooks/update.md b/examples/2.0.x/console-cli/examples/webhooks/update.md new file mode 100644 index 000000000..5a62554f4 --- /dev/null +++ b/examples/2.0.x/console-cli/examples/webhooks/update.md @@ -0,0 +1,7 @@ +```bash +appwrite webhooks update \ + --webhook-id '' \ + --name '' \ + --url https://example.com/webhook \ + --events one two three +``` diff --git a/examples/2.0.x/console-web/examples/account/create-anonymous-session.md b/examples/2.0.x/console-web/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..baf532b85 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-anonymous-session.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createAnonymousSession(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-email-password-session.md b/examples/2.0.x/console-web/examples/account/create-email-password-session.md new file mode 100644 index 000000000..e962d2a57 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-email-password-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-email-token.md b/examples/2.0.x/console-web/examples/account/create-email-token.md new file mode 100644 index 000000000..7f788612e --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-email-token.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailToken({ + userId: '', + email: 'email@example.com', + phrase: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-email-verification.md b/examples/2.0.x/console-web/examples/account/create-email-verification.md new file mode 100644 index 000000000..fcc08c344 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-email-verification.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailVerification({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-jwt.md b/examples/2.0.x/console-web/examples/account/create-jwt.md new file mode 100644 index 000000000..e107279dd --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-jwt.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createJWT({ + duration: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-magic-url-token.md b/examples/2.0.x/console-web/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..0fbd00ee4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-magic-url-token.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMagicURLToken({ + userId: '', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-mfa-authenticator.md b/examples/2.0.x/console-web/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..8e31d83d1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-mfa-authenticator.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticatorType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAAuthenticator({ + type: AuthenticatorType.Totp, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-mfa-challenge.md b/examples/2.0.x/console-web/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..b8d5ed48f --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-mfa-challenge.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticationFactor } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAChallenge({ + factor: AuthenticationFactor.Email, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/console-web/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..5e0aa3e89 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-o-auth-2-session.md b/examples/2.0.x/console-web/examples/account/create-o-auth-2-session.md new file mode 100644 index 000000000..735fd2eac --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-o-auth-2-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, OAuthProvider } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +account.createOAuth2Session({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +}); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-o-auth-2-token.md b/examples/2.0.x/console-web/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..cf961db67 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-o-auth-2-token.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, OAuthProvider } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +}); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-phone-token.md b/examples/2.0.x/console-web/examples/account/create-phone-token.md new file mode 100644 index 000000000..74b578a88 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-phone-token.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneToken({ + userId: '', + phone: '+12065550100', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-phone-verification.md b/examples/2.0.x/console-web/examples/account/create-phone-verification.md new file mode 100644 index 000000000..9e6c23a68 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-phone-verification.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneVerification(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-push-target.md b/examples/2.0.x/console-web/examples/account/create-push-target.md new file mode 100644 index 000000000..1e26cc917 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-push-target.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createPushTarget({ + targetId: '', + identifier: '', + providerId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-recovery.md b/examples/2.0.x/console-web/examples/account/create-recovery.md new file mode 100644 index 000000000..383d39e9c --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-recovery.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-session.md b/examples/2.0.x/console-web/examples/account/create-session.md new file mode 100644 index 000000000..1918832a0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create-verification.md b/examples/2.0.x/console-web/examples/account/create-verification.md new file mode 100644 index 000000000..772576a64 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create-verification.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.createVerification({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/create.md b/examples/2.0.x/console-web/examples/account/create.md new file mode 100644 index 000000000..06ff6123b --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/create.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.create({ + userId: '', + email: 'email@example.com', + password: 'password', + name: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/delete-identity.md b/examples/2.0.x/console-web/examples/account/delete-identity.md new file mode 100644 index 000000000..12e35d530 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/delete-identity.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteIdentity({ + identityId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/console-web/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..b16e35949 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account, AuthenticatorType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteMFAAuthenticator({ + type: AuthenticatorType.Totp, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/delete-push-target.md b/examples/2.0.x/console-web/examples/account/delete-push-target.md new file mode 100644 index 000000000..8aab3e35e --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/delete-push-target.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deletePushTarget({ + targetId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/delete-session.md b/examples/2.0.x/console-web/examples/account/delete-session.md new file mode 100644 index 000000000..6cdb3d4ac --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/delete-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/delete-sessions.md b/examples/2.0.x/console-web/examples/account/delete-sessions.md new file mode 100644 index 000000000..b363c935c --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/delete-sessions.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSessions(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/delete.md b/examples/2.0.x/console-web/examples/account/delete.md new file mode 100644 index 000000000..025be8e58 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/delete.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.delete(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/console-web/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..e8cfcdaa6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/get-prefs.md b/examples/2.0.x/console-web/examples/account/get-prefs.md new file mode 100644 index 000000000..850d74223 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/get-prefs.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getPrefs(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/get-session.md b/examples/2.0.x/console-web/examples/account/get-session.md new file mode 100644 index 000000000..656077cea --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/get-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/get.md b/examples/2.0.x/console-web/examples/account/get.md new file mode 100644 index 000000000..56f8d3816 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/get.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.get(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/list-identities.md b/examples/2.0.x/console-web/examples/account/list-identities.md new file mode 100644 index 000000000..b3a989d07 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/list-identities.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listIdentities({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/list-mfa-factors.md b/examples/2.0.x/console-web/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..952b0b368 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/list-mfa-factors.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listMFAFactors(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/list-sessions.md b/examples/2.0.x/console-web/examples/account/list-sessions.md new file mode 100644 index 000000000..2270ddfdf --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/list-sessions.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listSessions(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-email-verification.md b/examples/2.0.x/console-web/examples/account/update-email-verification.md new file mode 100644 index 000000000..a70d0af65 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-email-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmailVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-email.md b/examples/2.0.x/console-web/examples/account/update-email.md new file mode 100644 index 000000000..1487da473 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-email.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmail({ + email: 'email@example.com', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-magic-url-session.md b/examples/2.0.x/console-web/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..e0a2cb3c5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-magic-url-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMagicURLSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-mfa-authenticator.md b/examples/2.0.x/console-web/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..19a8daf94 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-mfa-authenticator.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account, AuthenticatorType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAAuthenticator({ + type: AuthenticatorType.Totp, + otp: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-mfa-challenge.md b/examples/2.0.x/console-web/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..39ecea2fa --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-mfa-challenge.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAChallenge({ + challengeId: '', + otp: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/console-web/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..1e75b0962 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFARecoveryCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-mfa.md b/examples/2.0.x/console-web/examples/account/update-mfa.md new file mode 100644 index 000000000..070761fde --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-mfa.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFA({ + mfa: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-name.md b/examples/2.0.x/console-web/examples/account/update-name.md new file mode 100644 index 000000000..40bffbf90 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-name.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateName({ + name: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-password.md b/examples/2.0.x/console-web/examples/account/update-password.md new file mode 100644 index 000000000..3eab92885 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-password.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePassword({ + password: 'password', + oldPassword: 'password', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-phone-session.md b/examples/2.0.x/console-web/examples/account/update-phone-session.md new file mode 100644 index 000000000..f1c43fe45 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-phone-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-phone-verification.md b/examples/2.0.x/console-web/examples/account/update-phone-verification.md new file mode 100644 index 000000000..ad5f9fb2a --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-phone-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-phone.md b/examples/2.0.x/console-web/examples/account/update-phone.md new file mode 100644 index 000000000..b1f625282 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-phone.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhone({ + phone: '+12065550100', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-prefs.md b/examples/2.0.x/console-web/examples/account/update-prefs.md new file mode 100644 index 000000000..41204cbba --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-prefs.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePrefs({ + prefs: { + language: 'en', + timezone: 'UTC', + darkTheme: true, + }, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-push-target.md b/examples/2.0.x/console-web/examples/account/update-push-target.md new file mode 100644 index 000000000..cd8db7d49 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-push-target.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updatePushTarget({ + targetId: '', + identifier: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-recovery.md b/examples/2.0.x/console-web/examples/account/update-recovery.md new file mode 100644 index 000000000..046b6aebf --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-recovery.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateRecovery({ + userId: '', + secret: '', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-session.md b/examples/2.0.x/console-web/examples/account/update-session.md new file mode 100644 index 000000000..9bf22914e --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateSession({ + sessionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-status.md b/examples/2.0.x/console-web/examples/account/update-status.md new file mode 100644 index 000000000..7b93b08d6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-status.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateStatus(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/account/update-verification.md b/examples/2.0.x/console-web/examples/account/update-verification.md new file mode 100644 index 000000000..17de9ec04 --- /dev/null +++ b/examples/2.0.x/console-web/examples/account/update-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.updateVerification({ + userId: '', + secret: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/advisor/delete-report.md b/examples/2.0.x/console-web/examples/advisor/delete-report.md new file mode 100644 index 000000000..376cba72a --- /dev/null +++ b/examples/2.0.x/console-web/examples/advisor/delete-report.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Advisor } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const advisor = new Advisor(client); + +const result = await advisor.deleteReport({ + reportId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/advisor/get-insight.md b/examples/2.0.x/console-web/examples/advisor/get-insight.md new file mode 100644 index 000000000..5ec1b6e36 --- /dev/null +++ b/examples/2.0.x/console-web/examples/advisor/get-insight.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Advisor } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const advisor = new Advisor(client); + +const result = await advisor.getInsight({ + reportId: '', + insightId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/advisor/get-report.md b/examples/2.0.x/console-web/examples/advisor/get-report.md new file mode 100644 index 000000000..4b96bf95f --- /dev/null +++ b/examples/2.0.x/console-web/examples/advisor/get-report.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Advisor } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const advisor = new Advisor(client); + +const result = await advisor.getReport({ + reportId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/advisor/list-insights.md b/examples/2.0.x/console-web/examples/advisor/list-insights.md new file mode 100644 index 000000000..8eb4cbc71 --- /dev/null +++ b/examples/2.0.x/console-web/examples/advisor/list-insights.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Advisor } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const advisor = new Advisor(client); + +const result = await advisor.listInsights({ + reportId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/advisor/list-reports.md b/examples/2.0.x/console-web/examples/advisor/list-reports.md new file mode 100644 index 000000000..e76abbb01 --- /dev/null +++ b/examples/2.0.x/console-web/examples/advisor/list-reports.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Advisor } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const advisor = new Advisor(client); + +const result = await advisor.listReports({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/assistant/chat.md b/examples/2.0.x/console-web/examples/assistant/chat.md new file mode 100644 index 000000000..2131548db --- /dev/null +++ b/examples/2.0.x/console-web/examples/assistant/chat.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Assistant } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const assistant = new Assistant(client); + +const result = await assistant.chat({ + prompt: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-browser.md b/examples/2.0.x/console-web/examples/avatars/get-browser.md new file mode 100644 index 000000000..5dd1daa6e --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-browser.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, Browser } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getBrowser({ + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-credit-card.md b/examples/2.0.x/console-web/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..dd3864861 --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-credit-card.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, CreditCard } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard({ + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-favicon.md b/examples/2.0.x/console-web/examples/avatars/get-favicon.md new file mode 100644 index 000000000..ccb69b0aa --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-favicon.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Avatars } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFavicon({ + url: 'https://example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-flag.md b/examples/2.0.x/console-web/examples/avatars/get-flag.md new file mode 100644 index 000000000..cacde8ff1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-flag.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars, Flag } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFlag({ + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-image.md b/examples/2.0.x/console-web/examples/avatars/get-image.md new file mode 100644 index 000000000..8cf0eaa2a --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-image.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Avatars } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-initials.md b/examples/2.0.x/console-web/examples/avatars/get-initials.md new file mode 100644 index 000000000..ef898edda --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-initials.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getInitials({ + name: '', // optional + width: 0, // optional + height: 0, // optional + background: 'FFFFFF', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-photo.md b/examples/2.0.x/console-web/examples/avatars/get-photo.md new file mode 100644 index 000000000..1ca4ed7ef --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-photo.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Avatars } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getPhoto({ + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '', // optional + name: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-qr.md b/examples/2.0.x/console-web/examples/avatars/get-qr.md new file mode 100644 index 000000000..f64488416 --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-qr.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Avatars } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getQR({ + text: '', + size: 1, // optional + margin: 0, // optional + download: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/avatars/get-screenshot.md b/examples/2.0.x/console-web/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..0869f5422 --- /dev/null +++ b/examples/2.0.x/console-web/examples/avatars/get-screenshot.md @@ -0,0 +1,48 @@ +```javascript +import { + Client, + Avatars, + BrowserTheme, + Timezone, + BrowserPermission, + ImageFormat, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getScreenshot({ + url: 'https://example.com', + headers: { + Authorization: 'Bearer token123', + 'X-Custom-Header': 'value', + }, // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: BrowserTheme.Dark, // optional + userAgent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + fullpage: true, // optional + locale: 'en-US', // optional + timezone: Timezone.AfricaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [ + BrowserPermission.Geolocation, + BrowserPermission.Notifications, + ], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: ImageFormat.Jpeg, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/console/get-email-template.md b/examples/2.0.x/console-web/examples/console/get-email-template.md new file mode 100644 index 000000000..0f1ca8936 --- /dev/null +++ b/examples/2.0.x/console-web/examples/console/get-email-template.md @@ -0,0 +1,21 @@ +```javascript +import { + Client, + Console, + ProjectEmailTemplateId, + ProjectEmailTemplateLocale, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const xconsole = new Console(client); + +const result = await xconsole.getEmailTemplate({ + templateId: ProjectEmailTemplateId.Verification, + locale: ProjectEmailTemplateLocale.Af, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/console/get-resource.md b/examples/2.0.x/console-web/examples/console/get-resource.md new file mode 100644 index 000000000..76bd75a21 --- /dev/null +++ b/examples/2.0.x/console-web/examples/console/get-resource.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Console, ConsoleResourceType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const xconsole = new Console(client); + +const result = await xconsole.getResource({ + value: '', + type: ConsoleResourceType.Rules, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/console/list-o-auth-2-providers.md b/examples/2.0.x/console-web/examples/console/list-o-auth-2-providers.md new file mode 100644 index 000000000..9270d3bb9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/console/list-o-auth-2-providers.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Console } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const xconsole = new Console(client); + +const result = await xconsole.listOAuth2Providers(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/console/list-organization-scopes.md b/examples/2.0.x/console-web/examples/console/list-organization-scopes.md new file mode 100644 index 000000000..e6c927a03 --- /dev/null +++ b/examples/2.0.x/console-web/examples/console/list-organization-scopes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Console } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const xconsole = new Console(client); + +const result = await xconsole.listOrganizationScopes(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/console/list-project-scopes.md b/examples/2.0.x/console-web/examples/console/list-project-scopes.md new file mode 100644 index 000000000..6ae757839 --- /dev/null +++ b/examples/2.0.x/console-web/examples/console/list-project-scopes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Console } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const xconsole = new Console(client); + +const result = await xconsole.listProjectScopes(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/console/variables.md b/examples/2.0.x/console-web/examples/console/variables.md new file mode 100644 index 000000000..60eed5580 --- /dev/null +++ b/examples/2.0.x/console-web/examples/console/variables.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Console } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const xconsole = new Console(client); + +const result = await xconsole.variables(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-big-int-attribute.md b/examples/2.0.x/console-web/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..53071380a --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-big-int-attribute.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createBigIntAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + min: 0, // optional + max: 1000000, // optional + xdefault: 0, // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-boolean-attribute.md b/examples/2.0.x/console-web/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..d2ccb0802 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-boolean-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createBooleanAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: false, // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-collection.md b/examples/2.0.x/console-web/examples/databases/create-collection.md new file mode 100644 index 000000000..65a37a474 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-collection.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createCollection({ + databaseId: '', + collectionId: '', + name: '', + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-datetime-attribute.md b/examples/2.0.x/console-web/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..7d32531ee --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-datetime-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDatetimeAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: '2020-10-15T06:38:00.000+00:00', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-document.md b/examples/2.0.x/console-web/examples/databases/create-document.md new file mode 100644 index 000000000..4e814c977 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-documents.md b/examples/2.0.x/console-web/examples/databases/create-documents.md new file mode 100644 index 000000000..e264c9297 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-email-attribute.md b/examples/2.0.x/console-web/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..20441c045 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-email-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createEmailAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'email@example.com', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-enum-attribute.md b/examples/2.0.x/console-web/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..821034f6f --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-enum-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createEnumAttribute({ + databaseId: '', + collectionId: '', + key: '', + elements: ['active', 'inactive'], + required: false, + xdefault: 'active', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-float-attribute.md b/examples/2.0.x/console-web/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..25e65418e --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-float-attribute.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createFloatAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + min: 0, // optional + max: 100, // optional + xdefault: 10.5, // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-index.md b/examples/2.0.x/console-web/examples/databases/create-index.md new file mode 100644 index 000000000..01a86729b --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-index.md @@ -0,0 +1,26 @@ +```javascript +import { + Client, + Databases, + DatabasesIndexType, + OrderBy, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createIndex({ + databaseId: '', + collectionId: '', + key: '', + type: DatabasesIndexType.Key, + attributes: [], + orders: [OrderBy.Asc], // optional + lengths: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-integer-attribute.md b/examples/2.0.x/console-web/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..18138ec2e --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-integer-attribute.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createIntegerAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + min: 0, // optional + max: 100, // optional + xdefault: 10, // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-ip-attribute.md b/examples/2.0.x/console-web/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..83b9e5bfd --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-ip-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createIpAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: '192.0.2.0', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-line-attribute.md b/examples/2.0.x/console-web/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..e4b532aec --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-line-attribute.md @@ -0,0 +1,23 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createLineAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: [ + [1, 2], + [3, 4], + [5, 6], + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-longtext-attribute.md b/examples/2.0.x/console-web/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..2fc6a4adb --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-longtext-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createLongtextAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/console-web/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..d32095bfc --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createMediumtextAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-operations.md b/examples/2.0.x/console-web/examples/databases/create-operations.md new file mode 100644 index 000000000..91dc151a2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-point-attribute.md b/examples/2.0.x/console-web/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..9a40ca1fa --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-point-attribute.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createPointAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: [1, 2], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-polygon-attribute.md b/examples/2.0.x/console-web/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..c1e0165f5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-polygon-attribute.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createPolygonAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: [ + [ + [1, 2], + [3, 4], + [5, 6], + [1, 2], + ], + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-relationship-attribute.md b/examples/2.0.x/console-web/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..b5bc81da2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-relationship-attribute.md @@ -0,0 +1,27 @@ +```javascript +import { + Client, + Databases, + RelationshipType, + RelationMutate, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createRelationshipAttribute({ + databaseId: '', + collectionId: '', + relatedCollectionId: '', + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate.Cascade, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-string-attribute.md b/examples/2.0.x/console-web/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..62a5c5e2f --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-string-attribute.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createStringAttribute({ + databaseId: '', + collectionId: '', + key: '', + size: 1, + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-text-attribute.md b/examples/2.0.x/console-web/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..c79b9cf67 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-text-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createTextAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-transaction.md b/examples/2.0.x/console-web/examples/databases/create-transaction.md new file mode 100644 index 000000000..ea5dff969 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-url-attribute.md b/examples/2.0.x/console-web/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..1c44cb9e5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-url-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createUrlAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'https://example.com', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create-varchar-attribute.md b/examples/2.0.x/console-web/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..ed35bd747 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create-varchar-attribute.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createVarcharAttribute({ + databaseId: '', + collectionId: '', + key: '', + size: 1, + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/create.md b/examples/2.0.x/console-web/examples/databases/create.md new file mode 100644 index 000000000..bac0e977f --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.create({ + databaseId: '', + name: '', + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/decrement-document-attribute.md b/examples/2.0.x/console-web/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..275bfb039 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/delete-attribute.md b/examples/2.0.x/console-web/examples/databases/delete-attribute.md new file mode 100644 index 000000000..a3f89d4db --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/delete-attribute.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteAttribute({ + databaseId: '', + collectionId: '', + key: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/delete-collection.md b/examples/2.0.x/console-web/examples/databases/delete-collection.md new file mode 100644 index 000000000..8a5962a8a --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/delete-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteCollection({ + databaseId: '', + collectionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/delete-document.md b/examples/2.0.x/console-web/examples/databases/delete-document.md new file mode 100644 index 000000000..d5e12a18f --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/delete-documents.md b/examples/2.0.x/console-web/examples/databases/delete-documents.md new file mode 100644 index 000000000..fd68feeb7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/delete-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/delete-index.md b/examples/2.0.x/console-web/examples/databases/delete-index.md new file mode 100644 index 000000000..f1bd34fbe --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/delete-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteIndex({ + databaseId: '', + collectionId: '', + key: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/delete-transaction.md b/examples/2.0.x/console-web/examples/databases/delete-transaction.md new file mode 100644 index 000000000..680800e0e --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/delete.md b/examples/2.0.x/console-web/examples/databases/delete.md new file mode 100644 index 000000000..30228d97b --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.delete({ + databaseId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/get-attribute.md b/examples/2.0.x/console-web/examples/databases/get-attribute.md new file mode 100644 index 000000000..e81686823 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/get-attribute.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getAttribute({ + databaseId: '', + collectionId: '', + key: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/get-collection.md b/examples/2.0.x/console-web/examples/databases/get-collection.md new file mode 100644 index 000000000..7d696f170 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/get-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getCollection({ + databaseId: '', + collectionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/get-document.md b/examples/2.0.x/console-web/examples/databases/get-document.md new file mode 100644 index 000000000..d525527d6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/get-index.md b/examples/2.0.x/console-web/examples/databases/get-index.md new file mode 100644 index 000000000..58ce1ea4b --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/get-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getIndex({ + databaseId: '', + collectionId: '', + key: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/get-transaction.md b/examples/2.0.x/console-web/examples/databases/get-transaction.md new file mode 100644 index 000000000..3a3a2e90a --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/get.md b/examples/2.0.x/console-web/examples/databases/get.md new file mode 100644 index 000000000..b0a7e7c84 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.get({ + databaseId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/increment-document-attribute.md b/examples/2.0.x/console-web/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..733e98c06 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/list-attributes.md b/examples/2.0.x/console-web/examples/databases/list-attributes.md new file mode 100644 index 000000000..33ebc0b9d --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/list-attributes.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listAttributes({ + databaseId: '', + collectionId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/list-collections.md b/examples/2.0.x/console-web/examples/databases/list-collections.md new file mode 100644 index 000000000..c06ed1339 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/list-collections.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listCollections({ + databaseId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/list-documents.md b/examples/2.0.x/console-web/examples/databases/list-documents.md new file mode 100644 index 000000000..830c6ca3b --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/list-indexes.md b/examples/2.0.x/console-web/examples/databases/list-indexes.md new file mode 100644 index 000000000..d537a018d --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/list-indexes.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listIndexes({ + databaseId: '', + collectionId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/list-transactions.md b/examples/2.0.x/console-web/examples/databases/list-transactions.md new file mode 100644 index 000000000..37f2fde74 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/list.md b/examples/2.0.x/console-web/examples/databases/list.md new file mode 100644 index 000000000..0b8497585 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.list({ + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-big-int-attribute.md b/examples/2.0.x/console-web/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..aa19ca5b9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-big-int-attribute.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateBigIntAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 0, + min: 0, // optional + max: 1000000, // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-boolean-attribute.md b/examples/2.0.x/console-web/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..c3fb91724 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-boolean-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateBooleanAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: false, + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-collection.md b/examples/2.0.x/console-web/examples/databases/update-collection.md new file mode 100644 index 000000000..c54a45f81 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-collection.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateCollection({ + databaseId: '', + collectionId: '', + name: '', // optional + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-datetime-attribute.md b/examples/2.0.x/console-web/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..38b6a4ad2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-datetime-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDatetimeAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: '2020-10-15T06:38:00.000+00:00', + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-document.md b/examples/2.0.x/console-web/examples/databases/update-document.md new file mode 100644 index 000000000..1aeec1ca1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-documents.md b/examples/2.0.x/console-web/examples/databases/update-documents.md new file mode 100644 index 000000000..949f35812 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-documents.md @@ -0,0 +1,25 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocuments({ + databaseId: '', + collectionId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-email-attribute.md b/examples/2.0.x/console-web/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..4a9cfc5c1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-email-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateEmailAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'email@example.com', + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-enum-attribute.md b/examples/2.0.x/console-web/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..ffe1b42fd --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-enum-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateEnumAttribute({ + databaseId: '', + collectionId: '', + key: '', + elements: ['active', 'inactive'], + required: false, + xdefault: 'active', + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-float-attribute.md b/examples/2.0.x/console-web/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..07b91e97a --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-float-attribute.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateFloatAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 10.5, + min: 0, // optional + max: 100, // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-integer-attribute.md b/examples/2.0.x/console-web/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..1dad2fd7e --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-integer-attribute.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateIntegerAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 10, + min: 0, // optional + max: 100, // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-ip-attribute.md b/examples/2.0.x/console-web/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..91e86d48c --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-ip-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateIpAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: '192.0.2.0', + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-line-attribute.md b/examples/2.0.x/console-web/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..1e43c8e50 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-line-attribute.md @@ -0,0 +1,24 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateLineAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: [ + [1, 2], + [3, 4], + [5, 6], + ], // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-longtext-attribute.md b/examples/2.0.x/console-web/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..6b30dc5f0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-longtext-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateLongtextAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'Hello World', + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/console-web/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..1e8ec3e3d --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateMediumtextAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'Hello World', + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-point-attribute.md b/examples/2.0.x/console-web/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..faa33befa --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-point-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updatePointAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: [1, 2], // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-polygon-attribute.md b/examples/2.0.x/console-web/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..c9d40a4dc --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-polygon-attribute.md @@ -0,0 +1,27 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updatePolygonAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: [ + [ + [1, 2], + [3, 4], + [5, 6], + [1, 2], + ], + ], // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-relationship-attribute.md b/examples/2.0.x/console-web/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..40c7c5264 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-relationship-attribute.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Databases, RelationMutate } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateRelationshipAttribute({ + databaseId: '', + collectionId: '', + key: '', + onDelete: RelationMutate.Cascade, // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-string-attribute.md b/examples/2.0.x/console-web/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..3fbbd6667 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-string-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateStringAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'Hello World', + size: 1, // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-text-attribute.md b/examples/2.0.x/console-web/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..8441402a2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-text-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateTextAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'Hello World', + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-transaction.md b/examples/2.0.x/console-web/examples/databases/update-transaction.md new file mode 100644 index 000000000..4e30b4692 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-url-attribute.md b/examples/2.0.x/console-web/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..be0192fdb --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-url-attribute.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateUrlAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'https://example.com', + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update-varchar-attribute.md b/examples/2.0.x/console-web/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..aaa7d3926 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update-varchar-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateVarcharAttribute({ + databaseId: '', + collectionId: '', + key: '', + required: false, + xdefault: 'Hello World', + size: 1, // optional + newKey: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/update.md b/examples/2.0.x/console-web/examples/databases/update.md new file mode 100644 index 000000000..dcf5ad0c9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/update.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.update({ + databaseId: '', + name: '', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/upsert-document.md b/examples/2.0.x/console-web/examples/databases/upsert-document.md new file mode 100644 index 000000000..ec7e32b0f --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/upsert-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Databases, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/databases/upsert-documents.md b/examples/2.0.x/console-web/examples/databases/upsert-documents.md new file mode 100644 index 000000000..5ee9d710e --- /dev/null +++ b/examples/2.0.x/console-web/examples/databases/upsert-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/create-collection.md b/examples/2.0.x/console-web/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..36938f25f --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/create-collection.md @@ -0,0 +1,22 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createCollection({ + databaseId: '', + collectionId: '', + name: '', + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/create-document.md b/examples/2.0.x/console-web/examples/documentsdb/create-document.md new file mode 100644 index 000000000..bde67443b --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/create-documents.md b/examples/2.0.x/console-web/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..1c9613362 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/create-index.md b/examples/2.0.x/console-web/examples/documentsdb/create-index.md new file mode 100644 index 000000000..ec398d9df --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/create-index.md @@ -0,0 +1,26 @@ +```javascript +import { + Client, + DocumentsDB, + DocumentsDBIndexType, + OrderBy, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createIndex({ + databaseId: '', + collectionId: '', + key: '', + type: DocumentsDBIndexType.Key, + attributes: [], + orders: [OrderBy.Asc], // optional + lengths: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/create-transaction.md b/examples/2.0.x/console-web/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..81770ad54 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/create.md b/examples/2.0.x/console-web/examples/documentsdb/create.md new file mode 100644 index 000000000..da10317e5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.create({ + databaseId: '', + name: '', + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/console-web/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..853c8b21e --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/delete-collection.md b/examples/2.0.x/console-web/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..9b59e603b --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/delete-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteCollection({ + databaseId: '', + collectionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/delete-document.md b/examples/2.0.x/console-web/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..a2985bab8 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/delete-documents.md b/examples/2.0.x/console-web/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..f9e603c05 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/delete-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/delete-index.md b/examples/2.0.x/console-web/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..27096d017 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/delete-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteIndex({ + databaseId: '', + collectionId: '', + key: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/delete-transaction.md b/examples/2.0.x/console-web/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..9ae98acf0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/delete.md b/examples/2.0.x/console-web/examples/documentsdb/delete.md new file mode 100644 index 000000000..03a4b9854 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.delete({ + databaseId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/get-collection.md b/examples/2.0.x/console-web/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..3a20069c7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/get-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getCollection({ + databaseId: '', + collectionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/get-document.md b/examples/2.0.x/console-web/examples/documentsdb/get-document.md new file mode 100644 index 000000000..48df62f50 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/get-index.md b/examples/2.0.x/console-web/examples/documentsdb/get-index.md new file mode 100644 index 000000000..565088475 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/get-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getIndex({ + databaseId: '', + collectionId: '', + key: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/get-transaction.md b/examples/2.0.x/console-web/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..5d6fe4b22 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/get.md b/examples/2.0.x/console-web/examples/documentsdb/get.md new file mode 100644 index 000000000..c7f67d518 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.get({ + databaseId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/console-web/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..3caa48d7a --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/list-collections.md b/examples/2.0.x/console-web/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..c0f532eab --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/list-collections.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listCollections({ + databaseId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/list-documents.md b/examples/2.0.x/console-web/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..8d0007567 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/list-indexes.md b/examples/2.0.x/console-web/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..cfe94f509 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/list-indexes.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listIndexes({ + databaseId: '', + collectionId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/list-transactions.md b/examples/2.0.x/console-web/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..cf97fb49a --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/list.md b/examples/2.0.x/console-web/examples/documentsdb/list.md new file mode 100644 index 000000000..0b1b06367 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.list({ + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/update-collection.md b/examples/2.0.x/console-web/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..7bbdafc10 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/update-collection.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateCollection({ + databaseId: '', + collectionId: '', + name: '', + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/update-document.md b/examples/2.0.x/console-web/examples/documentsdb/update-document.md new file mode 100644 index 000000000..ab279ca03 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/update-documents.md b/examples/2.0.x/console-web/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..90b6f272d --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/update-documents.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocuments({ + databaseId: '', + collectionId: '', + data: {}, // optional + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/update-transaction.md b/examples/2.0.x/console-web/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..f7f977d19 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/update.md b/examples/2.0.x/console-web/examples/documentsdb/update.md new file mode 100644 index 000000000..08a73a3f5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/update.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.update({ + databaseId: '', + name: '', + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/upsert-document.md b/examples/2.0.x/console-web/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..6a7c62905 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/documentsdb/upsert-documents.md b/examples/2.0.x/console-web/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..fb5a380a9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/documentsdb/upsert-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/console-web/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..0b93299b5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Embeddings, EmbeddingModel } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const embeddings = new Embeddings(client); + +const result = await embeddings.createTextEmbeddings({ + texts: [], + model: EmbeddingModel.NomicEmbedText, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/create-deployment.md b/examples/2.0.x/console-web/examples/functions/create-deployment.md new file mode 100644 index 000000000..a30cf6727 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/create-deployment.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createDeployment({ + functionId: '', + code: document.getElementById('uploader').files[0], + activate: false, + entrypoint: '', // optional + commands: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/console-web/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..35263d98c --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createDuplicateDeployment({ + functionId: '', + deploymentId: '', + buildId: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/create-execution.md b/examples/2.0.x/console-web/examples/functions/create-execution.md new file mode 100644 index 000000000..fc11f95aa --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/create-execution.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Functions, ExecutionMethod } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createExecution({ + functionId: '', + body: '', // optional + async: false, // optional + xpath: '', // optional + method: ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/create-template-deployment.md b/examples/2.0.x/console-web/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..a445c48c8 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/create-template-deployment.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Functions, TemplateReferenceType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createTemplateDeployment({ + functionId: '', + repository: '', + owner: '', + rootDirectory: '', + type: TemplateReferenceType.Commit, + reference: '', + activate: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/create-variable.md b/examples/2.0.x/console-web/examples/functions/create-variable.md new file mode 100644 index 000000000..c70f03761 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/create-variable.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createVariable({ + functionId: '', + variableId: '', + key: '', + value: '', + secret: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/create-vcs-deployment.md b/examples/2.0.x/console-web/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..22b9775e5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/create-vcs-deployment.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Functions, VCSReferenceType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createVcsDeployment({ + functionId: '', + type: VCSReferenceType.Branch, + reference: '', + activate: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/create.md b/examples/2.0.x/console-web/examples/functions/create.md new file mode 100644 index 000000000..aeb31effc --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/create.md @@ -0,0 +1,41 @@ +```javascript +import { + Client, + Functions, + Runtime, + ProjectKeyScopes, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.create({ + functionId: '', + name: '', + runtime: Runtime.Node145, + execute: ['any'], // optional + events: [], // optional + schedule: '0 0 * * *', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '', // optional + commands: '', // optional + scopes: [ProjectKeyScopes.ProjectRead], // optional + installationId: '', // optional + providerRepositoryId: '', // optional + providerBranch: '', // optional + providerSilentMode: false, // optional + providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/delete-deployment.md b/examples/2.0.x/console-web/examples/functions/delete-deployment.md new file mode 100644 index 000000000..b5e9905eb --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/delete-deployment.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.deleteDeployment({ + functionId: '', + deploymentId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/delete-execution.md b/examples/2.0.x/console-web/examples/functions/delete-execution.md new file mode 100644 index 000000000..fecb6d13d --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/delete-execution.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.deleteExecution({ + functionId: '', + executionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/delete-variable.md b/examples/2.0.x/console-web/examples/functions/delete-variable.md new file mode 100644 index 000000000..dbe969e53 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/delete-variable.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.deleteVariable({ + functionId: '', + variableId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/delete.md b/examples/2.0.x/console-web/examples/functions/delete.md new file mode 100644 index 000000000..a5538df9b --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.delete({ + functionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/get-deployment-download.md b/examples/2.0.x/console-web/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..632421467 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/get-deployment-download.md @@ -0,0 +1,22 @@ +```javascript +import { + Client, + Functions, + DeploymentDownloadType, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = functions.getDeploymentDownload({ + functionId: '', + deploymentId: '', + type: DeploymentDownloadType.Source, // optional + token: '', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/get-deployment.md b/examples/2.0.x/console-web/examples/functions/get-deployment.md new file mode 100644 index 000000000..2b11b0363 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/get-deployment.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getDeployment({ + functionId: '', + deploymentId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/get-execution.md b/examples/2.0.x/console-web/examples/functions/get-execution.md new file mode 100644 index 000000000..52b2192e4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/get-execution.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getExecution({ + functionId: '', + executionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/get-template.md b/examples/2.0.x/console-web/examples/functions/get-template.md new file mode 100644 index 000000000..7202df56d --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/get-template.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getTemplate({ + templateId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/get-variable.md b/examples/2.0.x/console-web/examples/functions/get-variable.md new file mode 100644 index 000000000..9453004a5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/get-variable.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getVariable({ + functionId: '', + variableId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/get.md b/examples/2.0.x/console-web/examples/functions/get.md new file mode 100644 index 000000000..3ade4a7c6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.get({ + functionId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/list-deployments.md b/examples/2.0.x/console-web/examples/functions/list-deployments.md new file mode 100644 index 000000000..4dce42885 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/list-deployments.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listDeployments({ + functionId: '', + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/list-executions.md b/examples/2.0.x/console-web/examples/functions/list-executions.md new file mode 100644 index 000000000..009c49f34 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/list-executions.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listExecutions({ + functionId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/list-runtimes.md b/examples/2.0.x/console-web/examples/functions/list-runtimes.md new file mode 100644 index 000000000..634305df1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/list-runtimes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listRuntimes(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/list-specifications.md b/examples/2.0.x/console-web/examples/functions/list-specifications.md new file mode 100644 index 000000000..b67d111c1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/list-specifications.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listSpecifications({ + type: 'runtimes', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/list-templates.md b/examples/2.0.x/console-web/examples/functions/list-templates.md new file mode 100644 index 000000000..8226ace53 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/list-templates.md @@ -0,0 +1,24 @@ +```javascript +import { + Client, + Functions, + Runtime, + FunctionTemplateUseCase, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listTemplates({ + runtimes: [Runtime.Node145], // optional + useCases: [FunctionTemplateUseCase.Starter], // optional + limit: 1, // optional + offset: 0, // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/list-variables.md b/examples/2.0.x/console-web/examples/functions/list-variables.md new file mode 100644 index 000000000..a0b0e6407 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/list-variables.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listVariables({ + functionId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/list.md b/examples/2.0.x/console-web/examples/functions/list.md new file mode 100644 index 000000000..c9115bdcb --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.list({ + queries: [], // optional + search: '', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/update-deployment-status.md b/examples/2.0.x/console-web/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..176260f69 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/update-deployment-status.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.updateDeploymentStatus({ + functionId: '', + deploymentId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/update-function-deployment.md b/examples/2.0.x/console-web/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..24eca47ad --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/update-function-deployment.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.updateFunctionDeployment({ + functionId: '', + deploymentId: '', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/update-variable.md b/examples/2.0.x/console-web/examples/functions/update-variable.md new file mode 100644 index 000000000..d319ba4aa --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/update-variable.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Functions } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.updateVariable({ + functionId: '', + variableId: '', + key: '', // optional + value: '', // optional + secret: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/functions/update.md b/examples/2.0.x/console-web/examples/functions/update.md new file mode 100644 index 000000000..ad32ec149 --- /dev/null +++ b/examples/2.0.x/console-web/examples/functions/update.md @@ -0,0 +1,41 @@ +```javascript +import { + Client, + Functions, + Runtime, + ProjectKeyScopes, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.update({ + functionId: '', + name: '', + runtime: Runtime.Node145, // optional + execute: ['any'], // optional + events: [], // optional + schedule: '0 0 * * *', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '', // optional + commands: '', // optional + scopes: [ProjectKeyScopes.ProjectRead], // optional + installationId: '', // optional + providerRepositoryId: '', // optional + providerBranch: '', // optional + providerSilentMode: false, // optional + providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/graphql/mutation.md b/examples/2.0.x/console-web/examples/graphql/mutation.md new file mode 100644 index 000000000..25c0ffbdd --- /dev/null +++ b/examples/2.0.x/console-web/examples/graphql/mutation.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Graphql } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.mutation({ + query: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/graphql/query.md b/examples/2.0.x/console-web/examples/graphql/query.md new file mode 100644 index 000000000..73b3da233 --- /dev/null +++ b/examples/2.0.x/console-web/examples/graphql/query.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Graphql } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.query({ + query: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/locale/get.md b/examples/2.0.x/console-web/examples/locale/get.md new file mode 100644 index 000000000..4432c7ee4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/locale/get.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.get(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/locale/list-codes.md b/examples/2.0.x/console-web/examples/locale/list-codes.md new file mode 100644 index 000000000..815fc01ac --- /dev/null +++ b/examples/2.0.x/console-web/examples/locale/list-codes.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCodes(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/locale/list-continents.md b/examples/2.0.x/console-web/examples/locale/list-continents.md new file mode 100644 index 000000000..89bfc10a8 --- /dev/null +++ b/examples/2.0.x/console-web/examples/locale/list-continents.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listContinents(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/locale/list-countries-eu.md b/examples/2.0.x/console-web/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..0223e0474 --- /dev/null +++ b/examples/2.0.x/console-web/examples/locale/list-countries-eu.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesEU(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/locale/list-countries-phones.md b/examples/2.0.x/console-web/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..e172ecf11 --- /dev/null +++ b/examples/2.0.x/console-web/examples/locale/list-countries-phones.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesPhones(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/locale/list-countries.md b/examples/2.0.x/console-web/examples/locale/list-countries.md new file mode 100644 index 000000000..b40c2c642 --- /dev/null +++ b/examples/2.0.x/console-web/examples/locale/list-countries.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountries(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/locale/list-currencies.md b/examples/2.0.x/console-web/examples/locale/list-currencies.md new file mode 100644 index 000000000..ccdceeeaf --- /dev/null +++ b/examples/2.0.x/console-web/examples/locale/list-currencies.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCurrencies(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/locale/list-languages.md b/examples/2.0.x/console-web/examples/locale/list-languages.md new file mode 100644 index 000000000..26688ff74 --- /dev/null +++ b/examples/2.0.x/console-web/examples/locale/list-languages.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Locale } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listLanguages(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-apns-provider.md b/examples/2.0.x/console-web/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..5a9f66eed --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-apns-provider.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createAPNSProvider({ + providerId: '', + name: '', + authKey: '', // optional + authKeyId: '', // optional + teamId: '', // optional + bundleId: '', // optional + sandbox: false, // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-email.md b/examples/2.0.x/console-web/examples/messaging/create-email.md new file mode 100644 index 000000000..a6da1435b --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-email.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createEmail({ + messageId: '', + subject: '', + content: '', + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-fcm-provider.md b/examples/2.0.x/console-web/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..74b9c95a3 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-fcm-provider.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createFCMProvider({ + providerId: '', + name: '', + serviceAccountJSON: {}, // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/console-web/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..0338191d0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,24 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createMailgunProvider({ + providerId: '', + name: '', + apiKey: '', // optional + domain: 'example.com', // optional + isEuRegion: false, // optional + fromName: '', // optional + fromEmail: 'email@example.com', // optional + replyToName: '', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/console-web/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..2f5462df4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createMsg91Provider({ + providerId: '', + name: '', + templateId: '', // optional + senderId: '', // optional + authKey: '', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-push.md b/examples/2.0.x/console-web/examples/messaging/create-push.md new file mode 100644 index 000000000..7235c19d9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-push.md @@ -0,0 +1,33 @@ +```javascript +import { Client, Messaging, MessagePriority } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createPush({ + messageId: '', + title: '', // optional + body: '<BODY>', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '<ID1:ID2>', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-resend-provider.md b/examples/2.0.x/console-web/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..bac274620 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-resend-provider.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createResendProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/console-web/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..d2cbe270b --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-ses-provider.md b/examples/2.0.x/console-web/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..f039f45c0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-ses-provider.md @@ -0,0 +1,24 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSesProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + accessKey: '<ACCESS_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + region: '<REGION>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-sms.md b/examples/2.0.x/console-web/examples/messaging/create-sms.md new file mode 100644 index 000000000..9dbafdd46 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-sms.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSMS({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-smtp-provider.md b/examples/2.0.x/console-web/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..3911e73dd --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-smtp-provider.md @@ -0,0 +1,28 @@ +```javascript +import { Client, Messaging, SmtpEncryption } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 587, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-subscriber.md b/examples/2.0.x/console-web/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..1a87cce5a --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-subscriber.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-telesign-provider.md b/examples/2.0.x/console-web/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..546b7957a --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-telesign-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/console-web/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..3501221ac --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-topic.md b/examples/2.0.x/console-web/examples/messaging/create-topic.md new file mode 100644 index 000000000..1757fa6f6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-topic.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ['any'], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-twilio-provider.md b/examples/2.0.x/console-web/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..75a41f899 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-twilio-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/create-vonage-provider.md b/examples/2.0.x/console-web/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..d3e46c87c --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/create-vonage-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/delete-provider.md b/examples/2.0.x/console-web/examples/messaging/delete-provider.md new file mode 100644 index 000000000..60d6a78fa --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/delete-provider.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteProvider({ + providerId: '<PROVIDER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/delete-subscriber.md b/examples/2.0.x/console-web/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..1c182f9db --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/delete-subscriber.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/delete-topic.md b/examples/2.0.x/console-web/examples/messaging/delete-topic.md new file mode 100644 index 000000000..485e0f0b3 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/delete-topic.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteTopic({ + topicId: '<TOPIC_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/delete.md b/examples/2.0.x/console-web/examples/messaging/delete.md new file mode 100644 index 000000000..cf354e288 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.delete({ + messageId: '<MESSAGE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/get-message.md b/examples/2.0.x/console-web/examples/messaging/get-message.md new file mode 100644 index 000000000..2b9c46c53 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/get-message.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.getMessage({ + messageId: '<MESSAGE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/get-provider.md b/examples/2.0.x/console-web/examples/messaging/get-provider.md new file mode 100644 index 000000000..8eb52b008 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/get-provider.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.getProvider({ + providerId: '<PROVIDER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/get-subscriber.md b/examples/2.0.x/console-web/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..59b51203a --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/get-subscriber.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.getSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/get-topic.md b/examples/2.0.x/console-web/examples/messaging/get-topic.md new file mode 100644 index 000000000..92fce9490 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/get-topic.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.getTopic({ + topicId: '<TOPIC_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/list-messages.md b/examples/2.0.x/console-web/examples/messaging/list-messages.md new file mode 100644 index 000000000..444c4aba1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/list-messages.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listMessages({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/list-providers.md b/examples/2.0.x/console-web/examples/messaging/list-providers.md new file mode 100644 index 000000000..d21b7b0b4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/list-providers.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listProviders({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/list-subscribers.md b/examples/2.0.x/console-web/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..2b7c7fe03 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/list-subscribers.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listSubscribers({ + topicId: '<TOPIC_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/list-targets.md b/examples/2.0.x/console-web/examples/messaging/list-targets.md new file mode 100644 index 000000000..a23399e87 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/list-targets.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listTargets({ + messageId: '<MESSAGE_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/list-topics.md b/examples/2.0.x/console-web/examples/messaging/list-topics.md new file mode 100644 index 000000000..63a2fbca1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/list-topics.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listTopics({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-apns-provider.md b/examples/2.0.x/console-web/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..b1eade771 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-apns-provider.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-email.md b/examples/2.0.x/console-web/examples/messaging/update-email.md new file mode 100644 index 000000000..77f765a47 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-email.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateEmail({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: '<SUBJECT>', // optional + content: '<CONTENT>', // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + attachments: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-fcm-provider.md b/examples/2.0.x/console-web/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..6d961eaa2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-fcm-provider.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + serviceAccountJSON: {}, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/console-web/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..5dd796872 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,24 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + apiKey: '<API_KEY>', // optional + domain: 'example.com', // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/console-web/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..40aab69df --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-push.md b/examples/2.0.x/console-web/examples/messaging/update-push.md new file mode 100644 index 000000000..f7c46bcfa --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-push.md @@ -0,0 +1,33 @@ +```javascript +import { Client, Messaging, MessagePriority } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updatePush({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '<ID1:ID2>', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-resend-provider.md b/examples/2.0.x/console-web/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..c9ec7c931 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-resend-provider.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateResendProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/console-web/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..1ec4f54d9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-ses-provider.md b/examples/2.0.x/console-web/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..873c42569 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-ses-provider.md @@ -0,0 +1,24 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateSesProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accessKey: '<ACCESS_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + region: '<REGION>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-sms.md b/examples/2.0.x/console-web/examples/messaging/update-sms.md new file mode 100644 index 000000000..a41f32269 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-sms.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateSMS({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + content: '<CONTENT>', // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-smtp-provider.md b/examples/2.0.x/console-web/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..fc8521f87 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-smtp-provider.md @@ -0,0 +1,28 @@ +```javascript +import { Client, Messaging, SmtpEncryption } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + host: '<HOST>', // optional + port: 1, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-telesign-provider.md b/examples/2.0.x/console-web/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..468419c3e --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-telesign-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/console-web/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..3f72f7c61 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-topic.md b/examples/2.0.x/console-web/examples/messaging/update-topic.md new file mode 100644 index 000000000..633728c6f --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-topic.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', // optional + subscribe: ['any'], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-twilio-provider.md b/examples/2.0.x/console-web/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..e8c0b08a9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-twilio-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + from: '<FROM>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/messaging/update-vonage-provider.md b/examples/2.0.x/console-web/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..cfe3ea50f --- /dev/null +++ b/examples/2.0.x/console-web/examples/messaging/update-vonage-provider.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Messaging } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + from: '<FROM>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/create-appwrite-migration.md b/examples/2.0.x/console-web/examples/migrations/create-appwrite-migration.md new file mode 100644 index 000000000..af8341f92 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/create-appwrite-migration.md @@ -0,0 +1,24 @@ +```javascript +import { + Client, + Migrations, + AppwriteMigrationResource, + OnDuplicate, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createAppwriteMigration({ + resources: [AppwriteMigrationResource.User], + endpoint: 'https://example.com', + projectId: '<PROJECT_ID>', + apiKey: '<API_KEY>', + onDuplicate: OnDuplicate.Fail, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/create-csv-export.md b/examples/2.0.x/console-web/examples/migrations/create-csv-export.md new file mode 100644 index 000000000..e357eb174 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/create-csv-export.md @@ -0,0 +1,24 @@ +```javascript +import { Client, Migrations } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createCSVExport({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + filename: '<FILENAME>', + columns: [], // optional + queries: [], // optional + delimiter: '<DELIMITER>', // optional + enclosure: '<ENCLOSURE>', // optional + escape: '<ESCAPE>', // optional + header: false, // optional + notify: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/create-csv-import.md b/examples/2.0.x/console-web/examples/migrations/create-csv-import.md new file mode 100644 index 000000000..12d62cf65 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/create-csv-import.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Migrations, OnDuplicate } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createCSVImport({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + internalFile: false, // optional + onDuplicate: OnDuplicate.Fail, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/create-firebase-migration.md b/examples/2.0.x/console-web/examples/migrations/create-firebase-migration.md new file mode 100644 index 000000000..521363f13 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/create-firebase-migration.md @@ -0,0 +1,20 @@ +```javascript +import { + Client, + Migrations, + FirebaseMigrationResource, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createFirebaseMigration({ + resources: [FirebaseMigrationResource.User], + serviceAccount: '<SERVICE_ACCOUNT>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/create-json-export.md b/examples/2.0.x/console-web/examples/migrations/create-json-export.md new file mode 100644 index 000000000..29da496e6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/create-json-export.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Migrations } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createJSONExport({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + filename: '<FILENAME>', + columns: [], // optional + queries: [], // optional + notify: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/create-json-import.md b/examples/2.0.x/console-web/examples/migrations/create-json-import.md new file mode 100644 index 000000000..f8decc0da --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/create-json-import.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Migrations, OnDuplicate } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createJSONImport({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + internalFile: false, // optional + onDuplicate: OnDuplicate.Fail, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/create-n-host-migration.md b/examples/2.0.x/console-web/examples/migrations/create-n-host-migration.md new file mode 100644 index 000000000..ef7b1ad2a --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/create-n-host-migration.md @@ -0,0 +1,26 @@ +```javascript +import { + Client, + Migrations, + NHostMigrationResource, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createNHostMigration({ + resources: [NHostMigrationResource.User], + subdomain: '<SUBDOMAIN>', + region: '<REGION>', + adminSecret: '<ADMIN_SECRET>', + database: '<DATABASE>', + username: '<USERNAME>', + password: 'password', + port: 5432, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/create-supabase-migration.md b/examples/2.0.x/console-web/examples/migrations/create-supabase-migration.md new file mode 100644 index 000000000..8289cd25c --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/create-supabase-migration.md @@ -0,0 +1,25 @@ +```javascript +import { + Client, + Migrations, + SupabaseMigrationResource, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createSupabaseMigration({ + resources: [SupabaseMigrationResource.User], + endpoint: 'https://example.com', + apiKey: '<API_KEY>', + databaseHost: '<DATABASE_HOST>', + username: '<USERNAME>', + password: 'password', + port: 5432, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/delete.md b/examples/2.0.x/console-web/examples/migrations/delete.md new file mode 100644 index 000000000..22dd6a51c --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Migrations } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.delete({ + migrationId: '<MIGRATION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/get-appwrite-report.md b/examples/2.0.x/console-web/examples/migrations/get-appwrite-report.md new file mode 100644 index 000000000..bc7e02283 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/get-appwrite-report.md @@ -0,0 +1,22 @@ +```javascript +import { + Client, + Migrations, + AppwriteMigrationResource, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.getAppwriteReport({ + resources: [AppwriteMigrationResource.User], + endpoint: 'https://example.com', + projectID: '<PROJECT_ID>', + key: '<KEY>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/get-firebase-report.md b/examples/2.0.x/console-web/examples/migrations/get-firebase-report.md new file mode 100644 index 000000000..dbced0f88 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/get-firebase-report.md @@ -0,0 +1,20 @@ +```javascript +import { + Client, + Migrations, + FirebaseMigrationResource, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.getFirebaseReport({ + resources: [FirebaseMigrationResource.User], + serviceAccount: '<SERVICE_ACCOUNT>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/get-n-host-report.md b/examples/2.0.x/console-web/examples/migrations/get-n-host-report.md new file mode 100644 index 000000000..6a0e05feb --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/get-n-host-report.md @@ -0,0 +1,26 @@ +```javascript +import { + Client, + Migrations, + NHostMigrationResource, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.getNHostReport({ + resources: [NHostMigrationResource.User], + subdomain: '<SUBDOMAIN>', + region: '<REGION>', + adminSecret: '<ADMIN_SECRET>', + database: '<DATABASE>', + username: '<USERNAME>', + password: 'password', + port: 5432, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/get-supabase-report.md b/examples/2.0.x/console-web/examples/migrations/get-supabase-report.md new file mode 100644 index 000000000..03db239d4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/get-supabase-report.md @@ -0,0 +1,25 @@ +```javascript +import { + Client, + Migrations, + SupabaseMigrationResource, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.getSupabaseReport({ + resources: [SupabaseMigrationResource.User], + endpoint: 'https://example.com', + apiKey: '<API_KEY>', + databaseHost: '<DATABASE_HOST>', + username: '<USERNAME>', + password: 'password', + port: 5432, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/get.md b/examples/2.0.x/console-web/examples/migrations/get.md new file mode 100644 index 000000000..86e25faa5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Migrations } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.get({ + migrationId: '<MIGRATION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/list.md b/examples/2.0.x/console-web/examples/migrations/list.md new file mode 100644 index 000000000..66778759c --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Migrations } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/migrations/retry.md b/examples/2.0.x/console-web/examples/migrations/retry.md new file mode 100644 index 000000000..315a19cd3 --- /dev/null +++ b/examples/2.0.x/console-web/examples/migrations/retry.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Migrations } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.retry({ + migrationId: '<MIGRATION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/notifications/list.md b/examples/2.0.x/console-web/examples/notifications/list.md new file mode 100644 index 000000000..3c6575818 --- /dev/null +++ b/examples/2.0.x/console-web/examples/notifications/list.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Notifications } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const notifications = new Notifications(client); + +const result = await notifications.list({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/notifications/update.md b/examples/2.0.x/console-web/examples/notifications/update.md new file mode 100644 index 000000000..5753d9278 --- /dev/null +++ b/examples/2.0.x/console-web/examples/notifications/update.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Notifications } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const notifications = new Notifications(client); + +const result = await notifications.update({ + notificationId: '<NOTIFICATION_ID>', + read: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/organization/create-project.md b/examples/2.0.x/console-web/examples/organization/create-project.md new file mode 100644 index 000000000..bdc4091e0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/organization/create-project.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Organization, Region } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const organization = new Organization(client); + +const result = await organization.createProject({ + projectId: '<PROJECT_ID>', + name: '<NAME>', + region: Region.Default, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/organization/delete-project.md b/examples/2.0.x/console-web/examples/organization/delete-project.md new file mode 100644 index 000000000..da0b09d72 --- /dev/null +++ b/examples/2.0.x/console-web/examples/organization/delete-project.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Organization } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const organization = new Organization(client); + +const result = await organization.deleteProject({ + projectId: '<PROJECT_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/organization/get-project.md b/examples/2.0.x/console-web/examples/organization/get-project.md new file mode 100644 index 000000000..2f985e357 --- /dev/null +++ b/examples/2.0.x/console-web/examples/organization/get-project.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Organization } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const organization = new Organization(client); + +const result = await organization.getProject({ + projectId: '<PROJECT_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/organization/list-projects.md b/examples/2.0.x/console-web/examples/organization/list-projects.md new file mode 100644 index 000000000..3f7a1c78c --- /dev/null +++ b/examples/2.0.x/console-web/examples/organization/list-projects.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Organization } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const organization = new Organization(client); + +const result = await organization.listProjects({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/organization/update-project.md b/examples/2.0.x/console-web/examples/organization/update-project.md new file mode 100644 index 000000000..7ae1ef33f --- /dev/null +++ b/examples/2.0.x/console-web/examples/organization/update-project.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Organization } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const organization = new Organization(client); + +const result = await organization.updateProject({ + projectId: '<PROJECT_ID>', + name: '<NAME>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/presences/delete.md b/examples/2.0.x/console-web/examples/presences/delete.md new file mode 100644 index 000000000..4f5f40543 --- /dev/null +++ b/examples/2.0.x/console-web/examples/presences/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Presences } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const presences = new Presences(client); + +const result = await presences.delete({ + presenceId: '<PRESENCE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/presences/get.md b/examples/2.0.x/console-web/examples/presences/get.md new file mode 100644 index 000000000..e1eba61dd --- /dev/null +++ b/examples/2.0.x/console-web/examples/presences/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Presences } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const presences = new Presences(client); + +const result = await presences.get({ + presenceId: '<PRESENCE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/presences/list.md b/examples/2.0.x/console-web/examples/presences/list.md new file mode 100644 index 000000000..3ffeb14e3 --- /dev/null +++ b/examples/2.0.x/console-web/examples/presences/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Presences } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const presences = new Presences(client); + +const result = await presences.list({ + queries: [], // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/presences/update.md b/examples/2.0.x/console-web/examples/presences/update.md new file mode 100644 index 000000000..a75cb2e7c --- /dev/null +++ b/examples/2.0.x/console-web/examples/presences/update.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Presences, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const presences = new Presences(client); + +const result = await presences.update({ + presenceId: '<PRESENCE_ID>', + status: '<STATUS>', // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional + permissions: [Permission.read(Role.any())], // optional + purge: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/presences/upsert.md b/examples/2.0.x/console-web/examples/presences/upsert.md new file mode 100644 index 000000000..ef3d2dea7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/presences/upsert.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Presences, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const presences = new Presences(client); + +const result = await presences.upsert({ + presenceId: '<PRESENCE_ID>', + status: '<STATUS>', + permissions: [Permission.read(Role.any())], // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-android-platform.md b/examples/2.0.x/console-web/examples/project/create-android-platform.md new file mode 100644 index 000000000..df9279327 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-android-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createAndroidPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + applicationId: '<APPLICATION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-apple-platform.md b/examples/2.0.x/console-web/examples/project/create-apple-platform.md new file mode 100644 index 000000000..28bb07936 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-apple-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createApplePlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + bundleIdentifier: '<BUNDLE_IDENTIFIER>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-ephemeral-key.md b/examples/2.0.x/console-web/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..f5f76a425 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-ephemeral-key.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project, ProjectKeyScopes } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createEphemeralKey({ + scopes: [ProjectKeyScopes.ProjectRead], + duration: 600, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-key.md b/examples/2.0.x/console-web/examples/project/create-key.md new file mode 100644 index 000000000..5354d7329 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-key.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project, ProjectKeyScopes } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createKey({ + keyId: '<KEY_ID>', + name: '<NAME>', + scopes: [ProjectKeyScopes.ProjectRead], + expire: '2020-10-15T06:38:00.000+00:00', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-linux-platform.md b/examples/2.0.x/console-web/examples/project/create-linux-platform.md new file mode 100644 index 000000000..cd527e370 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-linux-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createLinuxPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageName: '<PACKAGE_NAME>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-mock-phone.md b/examples/2.0.x/console-web/examples/project/create-mock-phone.md new file mode 100644 index 000000000..452362d1f --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-mock-phone.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createMockPhone({ + number: '+12065550100', + otp: '<OTP>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-smtp-test.md b/examples/2.0.x/console-web/examples/project/create-smtp-test.md new file mode 100644 index 000000000..300e972c9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-smtp-test.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createSMTPTest({ + emails: [], +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-variable.md b/examples/2.0.x/console-web/examples/project/create-variable.md new file mode 100644 index 000000000..2ad86e66a --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-variable.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createVariable({ + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-web-platform.md b/examples/2.0.x/console-web/examples/project/create-web-platform.md new file mode 100644 index 000000000..cc27e4cd1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-web-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createWebPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/create-windows-platform.md b/examples/2.0.x/console-web/examples/project/create-windows-platform.md new file mode 100644 index 000000000..55b534170 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/create-windows-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createWindowsPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageIdentifierName: '<PACKAGE_IDENTIFIER_NAME>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/delete-key.md b/examples/2.0.x/console-web/examples/project/delete-key.md new file mode 100644 index 000000000..05d107306 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/delete-key.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.deleteKey({ + keyId: '<KEY_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/delete-mock-phone.md b/examples/2.0.x/console-web/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..4db6d3ce1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/delete-mock-phone.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.deleteMockPhone({ + number: '+12065550100', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/delete-platform.md b/examples/2.0.x/console-web/examples/project/delete-platform.md new file mode 100644 index 000000000..2e939098b --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/delete-platform.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.deletePlatform({ + platformId: '<PLATFORM_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/delete-variable.md b/examples/2.0.x/console-web/examples/project/delete-variable.md new file mode 100644 index 000000000..8fcb3cd8d --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/delete-variable.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.deleteVariable({ + variableId: '<VARIABLE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/delete.md b/examples/2.0.x/console-web/examples/project/delete.md new file mode 100644 index 000000000..bb9376912 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/delete.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.delete(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/get-email-template.md b/examples/2.0.x/console-web/examples/project/get-email-template.md new file mode 100644 index 000000000..edcd55fc8 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/get-email-template.md @@ -0,0 +1,21 @@ +```javascript +import { + Client, + Project, + ProjectEmailTemplateId, + ProjectEmailTemplateLocale, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getEmailTemplate({ + templateId: ProjectEmailTemplateId.Verification, + locale: ProjectEmailTemplateLocale.Af, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/get-key.md b/examples/2.0.x/console-web/examples/project/get-key.md new file mode 100644 index 000000000..797a1101f --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/get-key.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getKey({ + keyId: '<KEY_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/get-mock-phone.md b/examples/2.0.x/console-web/examples/project/get-mock-phone.md new file mode 100644 index 000000000..c2b7c61dc --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/get-mock-phone.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getMockPhone({ + number: '+12065550100', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/console-web/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..449a282cf --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project, ProjectOAuthProviderId } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getOAuth2Provider({ + providerId: ProjectOAuthProviderId.Amazon, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/get-platform.md b/examples/2.0.x/console-web/examples/project/get-platform.md new file mode 100644 index 000000000..d896e5f41 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/get-platform.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getPlatform({ + platformId: '<PLATFORM_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/get-policy.md b/examples/2.0.x/console-web/examples/project/get-policy.md new file mode 100644 index 000000000..a1e4d7467 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/get-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project, ProjectPolicyId } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getPolicy({ + policyId: ProjectPolicyId.PasswordDictionary, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/get-variable.md b/examples/2.0.x/console-web/examples/project/get-variable.md new file mode 100644 index 000000000..2291de268 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/get-variable.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getVariable({ + variableId: '<VARIABLE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/get.md b/examples/2.0.x/console-web/examples/project/get.md new file mode 100644 index 000000000..8efa7685a --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/get.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.get(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/list-email-templates.md b/examples/2.0.x/console-web/examples/project/list-email-templates.md new file mode 100644 index 000000000..4bffe6035 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/list-email-templates.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.listEmailTemplates({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/list-keys.md b/examples/2.0.x/console-web/examples/project/list-keys.md new file mode 100644 index 000000000..b0d493ec0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/list-keys.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.listKeys({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/list-mock-phones.md b/examples/2.0.x/console-web/examples/project/list-mock-phones.md new file mode 100644 index 000000000..a0f5f6518 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/list-mock-phones.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.listMockPhones({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/console-web/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..197a26feb --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.listOAuth2Providers({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/list-platforms.md b/examples/2.0.x/console-web/examples/project/list-platforms.md new file mode 100644 index 000000000..695e1cd6f --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/list-platforms.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.listPlatforms({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/list-policies.md b/examples/2.0.x/console-web/examples/project/list-policies.md new file mode 100644 index 000000000..9c64c58e9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/list-policies.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.listPolicies({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/list-variables.md b/examples/2.0.x/console-web/examples/project/list-variables.md new file mode 100644 index 000000000..a397b9041 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/list-variables.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.listVariables({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-android-platform.md b/examples/2.0.x/console-web/examples/project/update-android-platform.md new file mode 100644 index 000000000..e736fb565 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-android-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateAndroidPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + applicationId: '<APPLICATION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-apple-platform.md b/examples/2.0.x/console-web/examples/project/update-apple-platform.md new file mode 100644 index 000000000..315e69037 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-apple-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateApplePlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + bundleIdentifier: '<BUNDLE_IDENTIFIER>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-auth-method.md b/examples/2.0.x/console-web/examples/project/update-auth-method.md new file mode 100644 index 000000000..c1a846a12 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-auth-method.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project, ProjectAuthMethodId } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateAuthMethod({ + methodId: ProjectAuthMethodId.EmailPassword, + enabled: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-email-template.md b/examples/2.0.x/console-web/examples/project/update-email-template.md new file mode 100644 index 000000000..24aa3fbae --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-email-template.md @@ -0,0 +1,27 @@ +```javascript +import { + Client, + Project, + ProjectEmailTemplateId, + ProjectEmailTemplateLocale, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateEmailTemplate({ + templateId: ProjectEmailTemplateId.Verification, + locale: ProjectEmailTemplateLocale.Af, // optional + subject: '<SUBJECT>', // optional + message: '<MESSAGE>', // optional + senderName: '<SENDER_NAME>', // optional + senderEmail: 'email@example.com', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-key.md b/examples/2.0.x/console-web/examples/project/update-key.md new file mode 100644 index 000000000..3bba96a0c --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-key.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project, ProjectKeyScopes } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateKey({ + keyId: '<KEY_ID>', + name: '<NAME>', + scopes: [ProjectKeyScopes.ProjectRead], + expire: '2020-10-15T06:38:00.000+00:00', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-labels.md b/examples/2.0.x/console-web/examples/project/update-labels.md new file mode 100644 index 000000000..8df4ffb42 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-labels.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateLabels({ + labels: [], +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-linux-platform.md b/examples/2.0.x/console-web/examples/project/update-linux-platform.md new file mode 100644 index 000000000..5bf1ae98a --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-linux-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateLinuxPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageName: '<PACKAGE_NAME>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/console-web/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..1e14ffa03 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateMembershipPrivacyPolicy({ + userId: false, // optional + userEmail: false, // optional + userPhone: false, // optional + userName: false, // optional + userMFA: false, // optional + userAccessedAt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/console-web/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..e2663bdef --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateMFAFactorsPolicy({ + totp: false, // optional + email: false, // optional + phone: false, // optional + custom: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-mock-phone.md b/examples/2.0.x/console-web/examples/project/update-mock-phone.md new file mode 100644 index 000000000..bf3d40926 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-mock-phone.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateMockPhone({ + number: '+12065550100', + otp: '<OTP>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..2f98d0919 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Amazon({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..ea8fef83c --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Apple({ + serviceId: '<SERVICE_ID>', // optional + keyId: '<KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + p8File: '<P8_FILE>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..669b14e3f --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Appwrite({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..7c2898e4c --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Auth0({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..796368a07 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Authentik({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..819d6fa43 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Autodesk({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..14e5d86c9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Bitbucket({ + key: '<KEY>', // optional + secret: '<SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..66865768e --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Bitly({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-box.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..7dd3605ad --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-box.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Box({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..b961a0918 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Cloudflare({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..fd63c401a --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Dailymotion({ + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..1116db06e --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Discord({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..fba11c6ac --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Disqus({ + publicKey: '<PUBLIC_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..6bb803e27 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Dropbox({ + appKey: '<APP_KEY>', // optional + appSecret: '<APP_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..d05f9050b --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Etsy({ + keyString: '<KEY_STRING>', // optional + sharedSecret: '<SHARED_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..deae89b2b --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Facebook({ + appId: '<APP_ID>', // optional + appSecret: '<APP_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..7414b4c13 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Figma({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..4881811e9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2FusionAuth({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..f3cc3b132 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2GitHub({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..1bfb3d7ea --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Gitlab({ + applicationId: '<APPLICATION_ID>', // optional + secret: '<SECRET>', // optional + endpoint: 'https://example.com', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-google.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..2780c0ca9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-google.md @@ -0,0 +1,22 @@ +```javascript +import { + Client, + Project, + ProjectOAuth2GooglePrompt, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Google({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + prompt: [ProjectOAuth2GooglePrompt.None], // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..4917ae7ae --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2HuggingFace({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..34653307b --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Keycloak({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + realmName: '<REALM_NAME>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..e29b1a75a --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Kick({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..97f465f0f --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Linkedin({ + clientId: '<CLIENT_ID>', // optional + primaryClientSecret: '<PRIMARY_CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..18f21fe93 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Microsoft({ + applicationId: '<APPLICATION_ID>', // optional + applicationSecret: '<APPLICATION_SECRET>', // optional + tenant: '<TENANT>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..66060594b --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Notion({ + oauthClientId: '<OAUTH_CLIENT_ID>', // optional + oauthClientSecret: '<OAUTH_CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..2d979ee8f --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,23 @@ +```javascript +import { Client, Project, ProjectOAuth2OidcPrompt } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Oidc({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + wellKnownURL: 'https://example.com', // optional + authorizationURL: 'https://example.com', // optional + tokenURL: 'https://example.com', // optional + userInfoURL: 'https://example.com', // optional + prompt: [ProjectOAuth2OidcPrompt.None], // optional + maxAge: 0, // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..a94ad691e --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Okta({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + domain: 'example.com', // optional + authorizationServerId: '<AUTHORIZATION_SERVER_ID>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..2b689e8e7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2PaypalSandbox({ + clientId: '<CLIENT_ID>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..3477c76e2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Paypal({ + clientId: '<CLIENT_ID>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..b930d4331 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Podio({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..99fef9567 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Resend({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..04c3da125 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Salesforce({ + customerKey: '<CUSTOMER_KEY>', // optional + customerSecret: '<CUSTOMER_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..fe04c9b31 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Slack({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..4e88f833c --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Spotify({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..311b1b1a8 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Stripe({ + clientId: '<CLIENT_ID>', // optional + apiSecretKey: '<API_SECRET_KEY>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..3a54d0c27 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2TradeshiftSandbox({ + oauth2ClientId: '<OAUTH2_CLIENT_ID>', // optional + oauth2ClientSecret: '<OAUTH2_CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..601a84529 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Tradeshift({ + oauth2ClientId: '<OAUTH2_CLIENT_ID>', // optional + oauth2ClientSecret: '<OAUTH2_CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..dec6da05e --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Twitch({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..04119dca5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2WordPress({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..9ce308592 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Yahoo({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..9cda2ed2b --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Yandex({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..0a1ff8615 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Zoho({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..a6f3f87a2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2Zoom({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-o-auth-2x.md b/examples/2.0.x/console-web/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..05162dc80 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-o-auth-2x.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateOAuth2X({ + customerKey: '<CUSTOMER_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/console-web/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..b89a58853 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updatePasswordDictionaryPolicy({ + enabled: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-password-history-policy.md b/examples/2.0.x/console-web/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..ac019894f --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-password-history-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updatePasswordHistoryPolicy({ + total: 1, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/console-web/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..ac5aad7c0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updatePasswordPersonalDataPolicy({ + enabled: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-password-strength-policy.md b/examples/2.0.x/console-web/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..38ee398dc --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-password-strength-policy.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updatePasswordStrengthPolicy({ + min: 8, // optional + uppercase: false, // optional + lowercase: false, // optional + number: false, // optional + symbols: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-protocol.md b/examples/2.0.x/console-web/examples/project/update-protocol.md new file mode 100644 index 000000000..fe1315898 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-protocol.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project, ProjectProtocolId } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateProtocol({ + protocolId: ProjectProtocolId.Rest, + enabled: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-service.md b/examples/2.0.x/console-web/examples/project/update-service.md new file mode 100644 index 000000000..a44657f79 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-service.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Project, ProjectServiceId } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateService({ + serviceId: ProjectServiceId.Account, + enabled: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-session-alert-policy.md b/examples/2.0.x/console-web/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..b264005fa --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-session-alert-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateSessionAlertPolicy({ + enabled: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-session-duration-policy.md b/examples/2.0.x/console-web/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..6dcf3d3f9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-session-duration-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateSessionDurationPolicy({ + duration: 60, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/console-web/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..ea2dc38fc --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateSessionInvalidationPolicy({ + enabled: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-session-limit-policy.md b/examples/2.0.x/console-web/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..6f4726c84 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-session-limit-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateSessionLimitPolicy({ + total: 1, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-smtp.md b/examples/2.0.x/console-web/examples/project/update-smtp.md new file mode 100644 index 000000000..e7bb461bf --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-smtp.md @@ -0,0 +1,24 @@ +```javascript +import { Client, Project, ProjectSMTPSecure } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateSMTP({ + host: 'example.com', // optional + port: 587, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + senderEmail: 'email@example.com', // optional + senderName: '<SENDER_NAME>', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + secure: ProjectSMTPSecure.Tls, // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-user-limit-policy.md b/examples/2.0.x/console-web/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..1b6c31559 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-user-limit-policy.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateUserLimitPolicy({ + total: 0, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-variable.md b/examples/2.0.x/console-web/examples/project/update-variable.md new file mode 100644 index 000000000..32668c6b9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-variable.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateVariable({ + variableId: '<VARIABLE_ID>', + key: '<KEY>', // optional + value: '<VALUE>', // optional + secret: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-web-platform.md b/examples/2.0.x/console-web/examples/project/update-web-platform.md new file mode 100644 index 000000000..3594a739b --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-web-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateWebPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/project/update-windows-platform.md b/examples/2.0.x/console-web/examples/project/update-windows-platform.md new file mode 100644 index 000000000..273c25071 --- /dev/null +++ b/examples/2.0.x/console-web/examples/project/update-windows-platform.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Project } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateWindowsPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageIdentifierName: '<PACKAGE_IDENTIFIER_NAME>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/create-schedule.md b/examples/2.0.x/console-web/examples/projects/create-schedule.md new file mode 100644 index 000000000..4ad15f229 --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/create-schedule.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Projects, ScheduleResourceType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.createSchedule({ + projectId: '<PROJECT_ID>', + resourceType: ScheduleResourceType.Function, + resourceId: '<RESOURCE_ID>', + schedule: '0 0 * * *', + active: false, // optional + data: {}, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/delete-dev-key.md b/examples/2.0.x/console-web/examples/projects/delete-dev-key.md new file mode 100644 index 000000000..c0940decc --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/delete-dev-key.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.deleteDevKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/get-dev-key.md b/examples/2.0.x/console-web/examples/projects/get-dev-key.md new file mode 100644 index 000000000..265b64018 --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/get-dev-key.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.getDevKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/get-schedule.md b/examples/2.0.x/console-web/examples/projects/get-schedule.md new file mode 100644 index 000000000..86812d5f7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/get-schedule.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.getSchedule({ + projectId: '<PROJECT_ID>', + scheduleId: '<SCHEDULE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/list-dev-keys.md b/examples/2.0.x/console-web/examples/projects/list-dev-keys.md new file mode 100644 index 000000000..46a0307e8 --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/list-dev-keys.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.listDevKeys({ + projectId: '<PROJECT_ID>', + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/list-schedules.md b/examples/2.0.x/console-web/examples/projects/list-schedules.md new file mode 100644 index 000000000..d28d3dcfd --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/list-schedules.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.listSchedules({ + projectId: '<PROJECT_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/list-stages.md b/examples/2.0.x/console-web/examples/projects/list-stages.md new file mode 100644 index 000000000..e01d3468f --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/list-stages.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.listStages({ + projectId: '<PROJECT_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/update-dev-key.md b/examples/2.0.x/console-web/examples/projects/update-dev-key.md new file mode 100644 index 000000000..424f7be1d --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/update-dev-key.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateDevKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>', + name: '<NAME>', + expire: '2020-10-15T06:38:00.000+00:00', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/update-stage.md b/examples/2.0.x/console-web/examples/projects/update-stage.md new file mode 100644 index 000000000..a8e532421 --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/update-stage.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateStage({ + projectId: '<PROJECT_ID>', + stageId: '<STAGE_ID>', + skip: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/projects/update-team.md b/examples/2.0.x/console-web/examples/projects/update-team.md new file mode 100644 index 000000000..4316ec581 --- /dev/null +++ b/examples/2.0.x/console-web/examples/projects/update-team.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Projects } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateTeam({ + projectId: '<PROJECT_ID>', + teamId: '<TEAM_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/proxy/create-api-rule.md b/examples/2.0.x/console-web/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..4f0421373 --- /dev/null +++ b/examples/2.0.x/console-web/examples/proxy/create-api-rule.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Proxy } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createAPIRule({ + domain: 'example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/proxy/create-function-rule.md b/examples/2.0.x/console-web/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..b1b9bb11e --- /dev/null +++ b/examples/2.0.x/console-web/examples/proxy/create-function-rule.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Proxy } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createFunctionRule({ + domain: 'example.com', + functionId: '<FUNCTION_ID>', + branch: '<BRANCH>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/proxy/create-redirect-rule.md b/examples/2.0.x/console-web/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..eb1d97cea --- /dev/null +++ b/examples/2.0.x/console-web/examples/proxy/create-redirect-rule.md @@ -0,0 +1,24 @@ +```javascript +import { + Client, + Proxy, + StatusCode, + ProxyResourceType, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createRedirectRule({ + domain: 'example.com', + url: 'https://example.com', + statusCode: StatusCode.MovedPermanently, + resourceId: '<RESOURCE_ID>', + resourceType: ProxyResourceType.Site, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/proxy/create-site-rule.md b/examples/2.0.x/console-web/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..7d0fb0db6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/proxy/create-site-rule.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Proxy } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createSiteRule({ + domain: 'example.com', + siteId: '<SITE_ID>', + branch: '<BRANCH>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/proxy/delete-rule.md b/examples/2.0.x/console-web/examples/proxy/delete-rule.md new file mode 100644 index 000000000..858dca183 --- /dev/null +++ b/examples/2.0.x/console-web/examples/proxy/delete-rule.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Proxy } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.deleteRule({ + ruleId: '<RULE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/proxy/get-rule.md b/examples/2.0.x/console-web/examples/proxy/get-rule.md new file mode 100644 index 000000000..8b77d3940 --- /dev/null +++ b/examples/2.0.x/console-web/examples/proxy/get-rule.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Proxy } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.getRule({ + ruleId: '<RULE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/proxy/list-rules.md b/examples/2.0.x/console-web/examples/proxy/list-rules.md new file mode 100644 index 000000000..40baf3d64 --- /dev/null +++ b/examples/2.0.x/console-web/examples/proxy/list-rules.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Proxy } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.listRules({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/proxy/update-rule-status.md b/examples/2.0.x/console-web/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..1309d915e --- /dev/null +++ b/examples/2.0.x/console-web/examples/proxy/update-rule-status.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Proxy } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.updateRuleStatus({ + ruleId: '<RULE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/create-deployment.md b/examples/2.0.x/console-web/examples/sites/create-deployment.md new file mode 100644 index 000000000..e9c3a8acb --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/create-deployment.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createDeployment({ + siteId: '<SITE_ID>', + code: document.getElementById('uploader').files[0], + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + activate: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/console-web/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..4dfa825a0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createDuplicateDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/create-template-deployment.md b/examples/2.0.x/console-web/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..d29a5e818 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/create-template-deployment.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Sites, TemplateReferenceType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createTemplateDeployment({ + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + type: TemplateReferenceType.Branch, + reference: '<REFERENCE>', + activate: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/create-variable.md b/examples/2.0.x/console-web/examples/sites/create-variable.md new file mode 100644 index 000000000..05afb1ffc --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/create-variable.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/create-vcs-deployment.md b/examples/2.0.x/console-web/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..79a3bd126 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/create-vcs-deployment.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Sites, VCSReferenceType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createVcsDeployment({ + siteId: '<SITE_ID>', + type: VCSReferenceType.Branch, + reference: '<REFERENCE>', + activate: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/create.md b/examples/2.0.x/console-web/examples/sites/create.md new file mode 100644 index 000000000..724ea5235 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/create.md @@ -0,0 +1,45 @@ +```javascript +import { + Client, + Sites, + Framework, + BuildRuntime, + Adapter, + ProjectKeyScopes, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.create({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: Framework.Analog, + buildRuntime: BuildRuntime.Node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + startCommand: '<START_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + adapter: Adapter.Static, // optional + installationId: '<INSTALLATION_ID>', // optional + fallbackFile: '<FALLBACK_FILE>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional + scopes: [ProjectKeyScopes.ProjectRead], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/delete-deployment.md b/examples/2.0.x/console-web/examples/sites/delete-deployment.md new file mode 100644 index 000000000..cfdbd6943 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/delete-deployment.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.deleteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/delete-log.md b/examples/2.0.x/console-web/examples/sites/delete-log.md new file mode 100644 index 000000000..3507f656e --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/delete-log.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.deleteLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/delete-variable.md b/examples/2.0.x/console-web/examples/sites/delete-variable.md new file mode 100644 index 000000000..4c1139ad5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/delete-variable.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.deleteVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/delete.md b/examples/2.0.x/console-web/examples/sites/delete.md new file mode 100644 index 000000000..4e3d7c78f --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.delete({ + siteId: '<SITE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/get-deployment-download.md b/examples/2.0.x/console-web/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..308707875 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/get-deployment-download.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Sites, DeploymentDownloadType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = sites.getDeploymentDownload({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType.Source, // optional + token: '<TOKEN>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/get-deployment.md b/examples/2.0.x/console-web/examples/sites/get-deployment.md new file mode 100644 index 000000000..9ed95bfcb --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/get-deployment.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/get-log.md b/examples/2.0.x/console-web/examples/sites/get-log.md new file mode 100644 index 000000000..ead132bc3 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/get-log.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/get-template.md b/examples/2.0.x/console-web/examples/sites/get-template.md new file mode 100644 index 000000000..88f30638d --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/get-template.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getTemplate({ + templateId: '<TEMPLATE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/get-variable.md b/examples/2.0.x/console-web/examples/sites/get-variable.md new file mode 100644 index 000000000..17a044bcf --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/get-variable.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/get.md b/examples/2.0.x/console-web/examples/sites/get.md new file mode 100644 index 000000000..c8d26fc70 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.get({ + siteId: '<SITE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/list-deployments.md b/examples/2.0.x/console-web/examples/sites/list-deployments.md new file mode 100644 index 000000000..484bf5b12 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/list-deployments.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listDeployments({ + siteId: '<SITE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/list-frameworks.md b/examples/2.0.x/console-web/examples/sites/list-frameworks.md new file mode 100644 index 000000000..26d0e5325 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/list-frameworks.md @@ -0,0 +1,13 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listFrameworks(); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/list-logs.md b/examples/2.0.x/console-web/examples/sites/list-logs.md new file mode 100644 index 000000000..8fb3d851c --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/list-logs.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listLogs({ + siteId: '<SITE_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/list-specifications.md b/examples/2.0.x/console-web/examples/sites/list-specifications.md new file mode 100644 index 000000000..1d77721c9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/list-specifications.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listSpecifications({ + type: 'runtimes', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/list-templates.md b/examples/2.0.x/console-web/examples/sites/list-templates.md new file mode 100644 index 000000000..4832803a9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/list-templates.md @@ -0,0 +1,23 @@ +```javascript +import { + Client, + Sites, + Framework, + SiteTemplateUseCase, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listTemplates({ + frameworks: [Framework.Analog], // optional + useCases: [SiteTemplateUseCase.Portfolio], // optional + limit: 1, // optional + offset: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/list-variables.md b/examples/2.0.x/console-web/examples/sites/list-variables.md new file mode 100644 index 000000000..75075e8fa --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/list-variables.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listVariables({ + siteId: '<SITE_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/list.md b/examples/2.0.x/console-web/examples/sites/list.md new file mode 100644 index 000000000..425011a2e --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/update-deployment-status.md b/examples/2.0.x/console-web/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..470bde6c6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/update-deployment-status.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.updateDeploymentStatus({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/update-site-deployment.md b/examples/2.0.x/console-web/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..0c857e5c2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/update-site-deployment.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.updateSiteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/update-variable.md b/examples/2.0.x/console-web/examples/sites/update-variable.md new file mode 100644 index 000000000..acf0bcf0d --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/update-variable.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Sites } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.updateVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', // optional + value: '<VALUE>', // optional + secret: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/sites/update.md b/examples/2.0.x/console-web/examples/sites/update.md new file mode 100644 index 000000000..36e66d825 --- /dev/null +++ b/examples/2.0.x/console-web/examples/sites/update.md @@ -0,0 +1,45 @@ +```javascript +import { + Client, + Sites, + Framework, + BuildRuntime, + Adapter, + ProjectKeyScopes, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.update({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: Framework.Analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + startCommand: '<START_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + buildRuntime: BuildRuntime.Node145, // optional + adapter: Adapter.Static, // optional + fallbackFile: '<FALLBACK_FILE>', // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional + scopes: [ProjectKeyScopes.ProjectRead], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/create-bucket.md b/examples/2.0.x/console-web/examples/storage/create-bucket.md new file mode 100644 index 000000000..e55136f35 --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/create-bucket.md @@ -0,0 +1,31 @@ +```javascript +import { + Client, + Storage, + Compression, + Permission, + Role, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: Compression.None, // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/create-file.md b/examples/2.0.x/console-web/examples/storage/create-file.md new file mode 100644 index 000000000..71b4a5f18 --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/create-file.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Storage, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: document.getElementById('uploader').files[0], + permissions: [Permission.read(Role.any())], // optional + folder: 'photos/2026', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/delete-bucket.md b/examples/2.0.x/console-web/examples/storage/delete-bucket.md new file mode 100644 index 000000000..a7147bcb5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/delete-bucket.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Storage } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteBucket({ + bucketId: '<BUCKET_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/delete-file.md b/examples/2.0.x/console-web/examples/storage/delete-file.md new file mode 100644 index 000000000..1a2d9eb80 --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/delete-file.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Storage } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/get-bucket.md b/examples/2.0.x/console-web/examples/storage/get-bucket.md new file mode 100644 index 000000000..eff67a035 --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/get-bucket.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Storage } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getBucket({ + bucketId: '<BUCKET_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/get-file-download.md b/examples/2.0.x/console-web/examples/storage/get-file-download.md new file mode 100644 index 000000000..6feab6e0a --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/get-file-download.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Storage } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileDownload({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/get-file-preview.md b/examples/2.0.x/console-web/examples/storage/get-file-preview.md new file mode 100644 index 000000000..a24eef6bc --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/get-file-preview.md @@ -0,0 +1,33 @@ +```javascript +import { + Client, + Storage, + ImageGravity, + ImageFormat, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFilePreview({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: 'FFFFFF', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: 'FFFFFF', // optional + output: ImageFormat.Jpg, // optional + token: '<TOKEN>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/get-file-view.md b/examples/2.0.x/console-web/examples/storage/get-file-view.md new file mode 100644 index 000000000..7dea7751a --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/get-file-view.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Storage } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileView({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/get-file.md b/examples/2.0.x/console-web/examples/storage/get-file.md new file mode 100644 index 000000000..317c090d7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/get-file.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Storage } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/list-buckets.md b/examples/2.0.x/console-web/examples/storage/list-buckets.md new file mode 100644 index 000000000..cb162c51e --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/list-buckets.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Storage } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listBuckets({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/list-files.md b/examples/2.0.x/console-web/examples/storage/list-files.md new file mode 100644 index 000000000..d69ec2e0c --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/list-files.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Storage } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listFiles({ + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/update-bucket.md b/examples/2.0.x/console-web/examples/storage/update-bucket.md new file mode 100644 index 000000000..6816d5920 --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/update-bucket.md @@ -0,0 +1,31 @@ +```javascript +import { + Client, + Storage, + Compression, + Permission, + Role, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: Compression.None, // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/storage/update-file.md b/examples/2.0.x/console-web/examples/storage/update-file.md new file mode 100644 index 000000000..881556111 --- /dev/null +++ b/examples/2.0.x/console-web/examples/storage/update-file.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Storage, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: [Permission.read(Role.any())], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..ff6fa9897 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createBigIntColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 1000000, // optional + xdefault: 0, // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..bff59103d --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: false, // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..cc9e87f3a --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: '2020-10-15T06:38:00.000+00:00', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-email-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..53c7430bf --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-email-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'email@example.com', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-enum-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..520a828ee --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-enum-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + elements: ['active', 'inactive'], + required: false, + xdefault: 'active', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-float-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..3852dfbe9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-float-column.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + xdefault: 10.5, // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-index.md b/examples/2.0.x/console-web/examples/tablesdb/create-index.md new file mode 100644 index 000000000..1b4f0aba8 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-index.md @@ -0,0 +1,26 @@ +```javascript +import { + Client, + TablesDB, + TablesDBIndexType, + OrderBy, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + type: TablesDBIndexType.Key, + columns: [], + orders: [OrderBy.Asc], // optional + lengths: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-integer-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..c2c1c2431 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-integer-column.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + xdefault: 10, // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-ip-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..bc09d7373 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-ip-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: '192.0.2.0', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-line-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..f82ce1974 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-line-column.md @@ -0,0 +1,23 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [1, 2], + [3, 4], + [5, 6], + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..5bc3c7bf7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createLongtextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..474fd9b28 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createMediumtextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-operations.md b/examples/2.0.x/console-web/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..a63c6d59b --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createOperations({ + transactionId: '<TRANSACTION_ID>', + operations: [ + { + action: 'create', + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-point-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..1e1591399 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-point-column.md @@ -0,0 +1,19 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createPointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [1, 2], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..ad5a21ba5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createPolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [ + [1, 2], + [3, 4], + [5, 6], + [1, 2], + ], + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..92d4fcdab --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,27 @@ +```javascript +import { + Client, + TablesDB, + RelationshipType, + RelationMutate, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: '<KEY>', // optional + twoWayKey: '<TWO_WAY_KEY>', // optional + onDelete: RelationMutate.Cascade, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-row.md b/examples/2.0.x/console-web/examples/tablesdb/create-row.md new file mode 100644 index 000000000..820637a28 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-rows.md b/examples/2.0.x/console-web/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..2c0461357 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-rows.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-string-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..be030ae13 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-string-column.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + size: 1, + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-table.md b/examples/2.0.x/console-web/examples/tablesdb/create-table.md new file mode 100644 index 000000000..9d213ce47 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-table.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // optional + rowSecurity: false, // optional + enabled: false, // optional + columns: [], // optional + indexes: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-text-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..71febf911 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-text-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createTextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-transaction.md b/examples/2.0.x/console-web/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..c9c05586b --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-url-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..93b4ef887 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-url-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'https://example.com', // optional + array: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/console-web/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..039cc055a --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createVarcharColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + size: 1, + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/create.md b/examples/2.0.x/console-web/examples/tablesdb/create.md new file mode 100644 index 000000000..ea7663558 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/console-web/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..de32d8649 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.decrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '<COLUMN>', + value: 1, // optional + min: 0, // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/delete-column.md b/examples/2.0.x/console-web/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..b8232ca3b --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/delete-column.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/delete-index.md b/examples/2.0.x/console-web/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..01b603ada --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/delete-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/delete-row.md b/examples/2.0.x/console-web/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..3022c5b27 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/delete-row.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/delete-rows.md b/examples/2.0.x/console-web/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..58df6f190 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/delete-rows.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/delete-table.md b/examples/2.0.x/console-web/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..3d20915d6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/delete-table.md @@ -0,0 +1,16 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/delete-transaction.md b/examples/2.0.x/console-web/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..a5511512f --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteTransaction({ + transactionId: '<TRANSACTION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/delete.md b/examples/2.0.x/console-web/examples/tablesdb/delete.md new file mode 100644 index 000000000..70fc1f456 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.delete({ + databaseId: '<DATABASE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/get-column.md b/examples/2.0.x/console-web/examples/tablesdb/get-column.md new file mode 100644 index 000000000..2c50bd679 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/get-column.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/get-index.md b/examples/2.0.x/console-web/examples/tablesdb/get-index.md new file mode 100644 index 000000000..b00f73363 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/get-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/get-row.md b/examples/2.0.x/console-web/examples/tablesdb/get-row.md new file mode 100644 index 000000000..c59483e34 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/get-row.md @@ -0,0 +1,19 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/get-table.md b/examples/2.0.x/console-web/examples/tablesdb/get-table.md new file mode 100644 index 000000000..6b5b5a3ac --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/get-table.md @@ -0,0 +1,16 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/get-transaction.md b/examples/2.0.x/console-web/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..b49fe1b7f --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getTransaction({ + transactionId: '<TRANSACTION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/get.md b/examples/2.0.x/console-web/examples/tablesdb/get.md new file mode 100644 index 000000000..78fac3258 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.get({ + databaseId: '<DATABASE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/increment-row-column.md b/examples/2.0.x/console-web/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..efcc2f5f0 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/increment-row-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.incrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '<COLUMN>', + value: 1, // optional + max: 100, // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/list-columns.md b/examples/2.0.x/console-web/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..c3e11bd76 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/list-columns.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listColumns({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/list-indexes.md b/examples/2.0.x/console-web/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..7044d8800 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/list-indexes.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listIndexes({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/list-rows.md b/examples/2.0.x/console-web/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..fe4fca369 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/list-rows.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/list-tables.md b/examples/2.0.x/console-web/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..adf12b922 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/list-tables.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listTables({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/list-transactions.md b/examples/2.0.x/console-web/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..2d616198b --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/list.md b/examples/2.0.x/console-web/examples/tablesdb/list.md new file mode 100644 index 000000000..e6e647b06 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..a8dcfb24d --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateBigIntColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 0, + min: 0, // optional + max: 1000000, // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..3f1f2904c --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: false, + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..218744e07 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: '2020-10-15T06:38:00.000+00:00', + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-email-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..c55294606 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-email-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'email@example.com', + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-enum-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..c85d50024 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-enum-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + elements: ['active', 'inactive'], + required: false, + xdefault: 'active', + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-float-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..ec3da21c9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-float-column.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 10.5, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-integer-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..a24c4e325 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-integer-column.md @@ -0,0 +1,22 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 10, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-ip-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..74aa61f4a --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-ip-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: '192.0.2.0', + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-line-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..79385a3a4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-line-column.md @@ -0,0 +1,24 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [1, 2], + [3, 4], + [5, 6], + ], // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..4d862abfe --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateLongtextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..040d78c2d --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateMediumtextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-point-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..636e56673 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-point-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updatePointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [1, 2], // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..8ed64623d --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,27 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updatePolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [ + [1, 2], + [3, 4], + [5, 6], + [1, 2], + ], + ], // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..77d2035d7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,19 @@ +```javascript +import { Client, TablesDB, RelationMutate } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + onDelete: RelationMutate.Cascade, // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-row.md b/examples/2.0.x/console-web/examples/tablesdb/update-row.md new file mode 100644 index 000000000..116fb2221 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-rows.md b/examples/2.0.x/console-web/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..32c0156c5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-rows.md @@ -0,0 +1,25 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-string-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..817ca449d --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-string-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-table.md b/examples/2.0.x/console-web/examples/tablesdb/update-table.md new file mode 100644 index 000000000..7d382d43c --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-table.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', // optional + permissions: [Permission.read(Role.any())], // optional + rowSecurity: false, // optional + enabled: false, // optional + purge: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-text-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..ac46a9622 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-text-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateTextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-transaction.md b/examples/2.0.x/console-web/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..01ccbd157 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateTransaction({ + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-url-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..14fbf3df9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-url-column.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'https://example.com', + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/console-web/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..ec04fb45b --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,21 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateVarcharColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/update.md b/examples/2.0.x/console-web/examples/tablesdb/update.md new file mode 100644 index 000000000..39cae9bf1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/update.md @@ -0,0 +1,17 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/upsert-row.md b/examples/2.0.x/console-web/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..2e58b52ef --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/upsert-row.md @@ -0,0 +1,26 @@ +```javascript +import { Client, TablesDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tablesdb/upsert-rows.md b/examples/2.0.x/console-web/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..005f7b4ee --- /dev/null +++ b/examples/2.0.x/console-web/examples/tablesdb/upsert-rows.md @@ -0,0 +1,18 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.upsertRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/create-membership.md b/examples/2.0.x/console-web/examples/teams/create-membership.md new file mode 100644 index 000000000..35581d303 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/create-membership.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.createMembership({ + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/create.md b/examples/2.0.x/console-web/examples/teams/create.md new file mode 100644 index 000000000..996943241 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.create({ + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/delete-membership.md b/examples/2.0.x/console-web/examples/teams/delete-membership.md new file mode 100644 index 000000000..d8a647e48 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/delete-membership.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/delete.md b/examples/2.0.x/console-web/examples/teams/delete.md new file mode 100644 index 000000000..ac4f95b79 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.delete({ + teamId: '<TEAM_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/get-membership.md b/examples/2.0.x/console-web/examples/teams/get-membership.md new file mode 100644 index 000000000..4dce19442 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/get-membership.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/get-prefs.md b/examples/2.0.x/console-web/examples/teams/get-prefs.md new file mode 100644 index 000000000..63ec4faa5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/get-prefs.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getPrefs({ + teamId: '<TEAM_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/get.md b/examples/2.0.x/console-web/examples/teams/get.md new file mode 100644 index 000000000..2afd1ab53 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.get({ + teamId: '<TEAM_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/list-memberships.md b/examples/2.0.x/console-web/examples/teams/list-memberships.md new file mode 100644 index 000000000..5ea918173 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/list-memberships.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listMemberships({ + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/list.md b/examples/2.0.x/console-web/examples/teams/list.md new file mode 100644 index 000000000..15db3ca68 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/update-membership-status.md b/examples/2.0.x/console-web/examples/teams/update-membership-status.md new file mode 100644 index 000000000..7ac6b1058 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/update-membership-status.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembershipStatus({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/update-membership.md b/examples/2.0.x/console-web/examples/teams/update-membership.md new file mode 100644 index 000000000..6ed365834 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/update-membership.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [], +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/update-name.md b/examples/2.0.x/console-web/examples/teams/update-name.md new file mode 100644 index 000000000..1b11e6e82 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/update-name.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateName({ + teamId: '<TEAM_ID>', + name: '<NAME>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/teams/update-prefs.md b/examples/2.0.x/console-web/examples/teams/update-prefs.md new file mode 100644 index 000000000..e0cdfa493 --- /dev/null +++ b/examples/2.0.x/console-web/examples/teams/update-prefs.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updatePrefs({ + teamId: '<TEAM_ID>', + prefs: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tokens/create-file-token.md b/examples/2.0.x/console-web/examples/tokens/create-file-token.md new file mode 100644 index 000000000..cd4d162cf --- /dev/null +++ b/examples/2.0.x/console-web/examples/tokens/create-file-token.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Tokens } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.createFileToken({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '2020-10-15T06:38:00.000+00:00', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tokens/delete.md b/examples/2.0.x/console-web/examples/tokens/delete.md new file mode 100644 index 000000000..f16e909dd --- /dev/null +++ b/examples/2.0.x/console-web/examples/tokens/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Tokens } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.delete({ + tokenId: '<TOKEN_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tokens/get.md b/examples/2.0.x/console-web/examples/tokens/get.md new file mode 100644 index 000000000..e60827508 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tokens/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Tokens } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.get({ + tokenId: '<TOKEN_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tokens/list.md b/examples/2.0.x/console-web/examples/tokens/list.md new file mode 100644 index 000000000..2a1b164c6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/tokens/list.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Tokens } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.list({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/tokens/update.md b/examples/2.0.x/console-web/examples/tokens/update.md new file mode 100644 index 000000000..28513f2cf --- /dev/null +++ b/examples/2.0.x/console-web/examples/tokens/update.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Tokens } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.update({ + tokenId: '<TOKEN_ID>', + expire: '2020-10-15T06:38:00.000+00:00', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/usage/list-events.md b/examples/2.0.x/console-web/examples/usage/list-events.md new file mode 100644 index 000000000..f3162025a --- /dev/null +++ b/examples/2.0.x/console-web/examples/usage/list-events.md @@ -0,0 +1,31 @@ +```javascript +import { + Client, + Usage, + UsageInterval, + UsageEventDimension, + UsageOrderBy, + UsageOrderDirection, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const usage = new Usage(client); + +const result = await usage.listEvents({ + metrics: [], + queries: [], // optional + interval: UsageInterval.OneMinute, // optional + dimensions: [UsageEventDimension.Path], // optional + startAt: '2020-10-15T06:38:00.000+00:00', // optional + endAt: '2020-10-15T06:38:00.000+00:00', // optional + orderBy: UsageOrderBy.Time, // optional + orderDir: UsageOrderDirection.Asc, // optional + limit: 1, // optional + offset: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/usage/list-gauges.md b/examples/2.0.x/console-web/examples/usage/list-gauges.md new file mode 100644 index 000000000..d518145fd --- /dev/null +++ b/examples/2.0.x/console-web/examples/usage/list-gauges.md @@ -0,0 +1,32 @@ +```javascript +import { + Client, + Usage, + UsageInterval, + UsageGaugeDimension, + UsageOrderBy, + UsageOrderDirection, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const usage = new Usage(client); + +const result = await usage.listGauges({ + metrics: [], + queries: [], // optional + interval: UsageInterval.OneMinute, // optional + dimensions: [UsageGaugeDimension.ResourceId], // optional + startAt: '2020-10-15T06:38:00.000+00:00', // optional + endAt: '2020-10-15T06:38:00.000+00:00', // optional + orderBy: UsageOrderBy.Time, // optional + orderDir: UsageOrderDirection.Asc, // optional + limit: 1, // optional + offset: 0, // optional + aggregate: 'last', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-argon-2-user.md b/examples/2.0.x/console-web/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..ba77aabdd --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-argon-2-user.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createArgon2User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-bcrypt-user.md b/examples/2.0.x/console-web/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..482eca33d --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-bcrypt-user.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createBcryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-jwt.md b/examples/2.0.x/console-web/examples/users/create-jwt.md new file mode 100644 index 000000000..922e2091f --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-jwt.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createJWT({ + userId: '<USER_ID>', + sessionId: 'recent()', // optional + duration: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-md-5-user.md b/examples/2.0.x/console-web/examples/users/create-md-5-user.md new file mode 100644 index 000000000..b9f6c9f76 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-md-5-user.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createMD5User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/console-web/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..a95a1f56c --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createMFARecoveryCodes({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-ph-pass-user.md b/examples/2.0.x/console-web/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..9a5ed8078 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-ph-pass-user.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createPHPassUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/console-web/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..97102a19d --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createScryptModifiedUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-scrypt-user.md b/examples/2.0.x/console-web/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..e03431891 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-scrypt-user.md @@ -0,0 +1,23 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createScryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-session.md b/examples/2.0.x/console-web/examples/users/create-session.md new file mode 100644 index 000000000..8a7e864fc --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-session.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createSession({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-sha-user.md b/examples/2.0.x/console-web/examples/users/create-sha-user.md new file mode 100644 index 000000000..3a69e7710 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-sha-user.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Users, PasswordHash } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createSHAUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: PasswordHash.Sha1, // optional + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-target.md b/examples/2.0.x/console-web/examples/users/create-target.md new file mode 100644 index 000000000..f6e985f99 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-target.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Users, MessagingProviderType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: MessagingProviderType.Email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create-token.md b/examples/2.0.x/console-web/examples/users/create-token.md new file mode 100644 index 000000000..56e5fae74 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create-token.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createToken({ + userId: '<USER_ID>', + length: 4, // optional + expire: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/create.md b/examples/2.0.x/console-web/examples/users/create.md new file mode 100644 index 000000000..71db07aa7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/create.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.create({ + userId: '<USER_ID>', + email: 'email@example.com', // optional + phone: '+12065550100', // optional + password: 'password', // optional + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/delete-identity.md b/examples/2.0.x/console-web/examples/users/delete-identity.md new file mode 100644 index 000000000..193e0e3a6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/delete-identity.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteIdentity({ + identityId: '<IDENTITY_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/console-web/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..520abf656 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users, AuthenticatorType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteMFAAuthenticator({ + userId: '<USER_ID>', + type: AuthenticatorType.Totp, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/delete-session.md b/examples/2.0.x/console-web/examples/users/delete-session.md new file mode 100644 index 000000000..193f6717a --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/delete-session.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteSession({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/delete-sessions.md b/examples/2.0.x/console-web/examples/users/delete-sessions.md new file mode 100644 index 000000000..7d5812988 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/delete-sessions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteSessions({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/delete-target.md b/examples/2.0.x/console-web/examples/users/delete-target.md new file mode 100644 index 000000000..639815a5d --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/delete-target.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/delete.md b/examples/2.0.x/console-web/examples/users/delete.md new file mode 100644 index 000000000..4cfdc4fa9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.delete({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/get-mfa-challenge.md b/examples/2.0.x/console-web/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..e31e1cecb --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/get-mfa-challenge.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.getMFAChallenge({ + userId: '<USER_ID>', + challengeId: '<CHALLENGE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/console-web/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..800fa2edd --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.getMFARecoveryCodes({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/get-prefs.md b/examples/2.0.x/console-web/examples/users/get-prefs.md new file mode 100644 index 000000000..6ad354974 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/get-prefs.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.getPrefs({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/get-target.md b/examples/2.0.x/console-web/examples/users/get-target.md new file mode 100644 index 000000000..17cd872cd --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/get-target.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.getTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/get.md b/examples/2.0.x/console-web/examples/users/get.md new file mode 100644 index 000000000..3da557d49 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.get({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/list-identities.md b/examples/2.0.x/console-web/examples/users/list-identities.md new file mode 100644 index 000000000..bfd63ef43 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/list-identities.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listIdentities({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/list-memberships.md b/examples/2.0.x/console-web/examples/users/list-memberships.md new file mode 100644 index 000000000..a3dfd8283 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/list-memberships.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listMemberships({ + userId: '<USER_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/list-mfa-factors.md b/examples/2.0.x/console-web/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..61c2b60b7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/list-mfa-factors.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listMFAFactors({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/list-sessions.md b/examples/2.0.x/console-web/examples/users/list-sessions.md new file mode 100644 index 000000000..934efef26 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/list-sessions.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listSessions({ + userId: '<USER_ID>', + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/list-targets.md b/examples/2.0.x/console-web/examples/users/list-targets.md new file mode 100644 index 000000000..b3f09b9f4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/list-targets.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listTargets({ + userId: '<USER_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/list.md b/examples/2.0.x/console-web/examples/users/list.md new file mode 100644 index 000000000..40f351e00 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-email-verification.md b/examples/2.0.x/console-web/examples/users/update-email-verification.md new file mode 100644 index 000000000..0131972f4 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-email-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateEmailVerification({ + userId: '<USER_ID>', + emailVerification: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-email.md b/examples/2.0.x/console-web/examples/users/update-email.md new file mode 100644 index 000000000..2f3fffed6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-email.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateEmail({ + userId: '<USER_ID>', + email: 'email@example.com', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-impersonator.md b/examples/2.0.x/console-web/examples/users/update-impersonator.md new file mode 100644 index 000000000..819a857ed --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-impersonator.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateImpersonator({ + userId: '<USER_ID>', + impersonator: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-labels.md b/examples/2.0.x/console-web/examples/users/update-labels.md new file mode 100644 index 000000000..bf287f366 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-labels.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateLabels({ + userId: '<USER_ID>', + labels: [], +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/console-web/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..ed7a57061 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateMFARecoveryCodes({ + userId: '<USER_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-mfa.md b/examples/2.0.x/console-web/examples/users/update-mfa.md new file mode 100644 index 000000000..5152ce26d --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-mfa.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateMFA({ + userId: '<USER_ID>', + mfa: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-name.md b/examples/2.0.x/console-web/examples/users/update-name.md new file mode 100644 index 000000000..1d7680e69 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-name.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateName({ + userId: '<USER_ID>', + name: '<NAME>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-password.md b/examples/2.0.x/console-web/examples/users/update-password.md new file mode 100644 index 000000000..ff58b1dad --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-password.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updatePassword({ + userId: '<USER_ID>', + password: 'password', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-phone-verification.md b/examples/2.0.x/console-web/examples/users/update-phone-verification.md new file mode 100644 index 000000000..d30161f9d --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-phone-verification.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updatePhoneVerification({ + userId: '<USER_ID>', + phoneVerification: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-phone.md b/examples/2.0.x/console-web/examples/users/update-phone.md new file mode 100644 index 000000000..a3c5868ae --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-phone.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updatePhone({ + userId: '<USER_ID>', + number: '+12065550100', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-prefs.md b/examples/2.0.x/console-web/examples/users/update-prefs.md new file mode 100644 index 000000000..b306d59a1 --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-prefs.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updatePrefs({ + userId: '<USER_ID>', + prefs: {}, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-status.md b/examples/2.0.x/console-web/examples/users/update-status.md new file mode 100644 index 000000000..fc95c6bba --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-status.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateStatus({ + userId: '<USER_ID>', + status: false, +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/users/update-target.md b/examples/2.0.x/console-web/examples/users/update-target.md new file mode 100644 index 000000000..50c9257bb --- /dev/null +++ b/examples/2.0.x/console-web/examples/users/update-target.md @@ -0,0 +1,19 @@ +```javascript +import { Client, Users } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // optional + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/create-repository-detection.md b/examples/2.0.x/console-web/examples/vcs/create-repository-detection.md new file mode 100644 index 000000000..99df3235c --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/create-repository-detection.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Vcs, VCSDetectionType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.createRepositoryDetection({ + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', + type: VCSDetectionType.Runtime, + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/create-repository.md b/examples/2.0.x/console-web/examples/vcs/create-repository.md new file mode 100644 index 000000000..9598870ca --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/create-repository.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.createRepository({ + installationId: '<INSTALLATION_ID>', + name: '<NAME>', + xprivate: false, + providerNamespace: '<PROVIDER_NAMESPACE>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/delete-installation.md b/examples/2.0.x/console-web/examples/vcs/delete-installation.md new file mode 100644 index 000000000..73d4db526 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/delete-installation.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.deleteInstallation({ + installationId: '<INSTALLATION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/get-installation.md b/examples/2.0.x/console-web/examples/vcs/get-installation.md new file mode 100644 index 000000000..35c17ccb7 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/get-installation.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.getInstallation({ + installationId: '<INSTALLATION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/get-repository-contents.md b/examples/2.0.x/console-web/examples/vcs/get-repository-contents.md new file mode 100644 index 000000000..87caa4075 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/get-repository-contents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.getRepositoryContents({ + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerReference: '<PROVIDER_REFERENCE>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/get-repository.md b/examples/2.0.x/console-web/examples/vcs/get-repository.md new file mode 100644 index 000000000..805fca4ff --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/get-repository.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.getRepository({ + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/list-installations.md b/examples/2.0.x/console-web/examples/vcs/list-installations.md new file mode 100644 index 000000000..56f7fc4d9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/list-installations.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.listInstallations({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/list-namespaces.md b/examples/2.0.x/console-web/examples/vcs/list-namespaces.md new file mode 100644 index 000000000..a66ffdd03 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/list-namespaces.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.listNamespaces({ + installationId: '<INSTALLATION_ID>', + search: '<SEARCH>', // optional + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/list-repositories.md b/examples/2.0.x/console-web/examples/vcs/list-repositories.md new file mode 100644 index 000000000..1661cd8c5 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/list-repositories.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Vcs, VCSDetectionType } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.listRepositories({ + installationId: '<INSTALLATION_ID>', + type: VCSDetectionType.Runtime, + search: '<SEARCH>', // optional + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/list-repository-branches.md b/examples/2.0.x/console-web/examples/vcs/list-repository-branches.md new file mode 100644 index 000000000..2efd905b2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/list-repository-branches.md @@ -0,0 +1,18 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.listRepositoryBranches({ + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', + search: '<SEARCH>', // optional + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vcs/update-external-deployments.md b/examples/2.0.x/console-web/examples/vcs/update-external-deployments.md new file mode 100644 index 000000000..3975bc7f3 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vcs/update-external-deployments.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Vcs } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.updateExternalDeployments({ + installationId: '<INSTALLATION_ID>', + repositoryId: '<REPOSITORY_ID>', + providerPullRequestId: '<PROVIDER_PULL_REQUEST_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/create-collection.md b/examples/2.0.x/console-web/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..b69be570a --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/create-collection.md @@ -0,0 +1,21 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/create-document.md b/examples/2.0.x/console-web/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..5995f070f --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + embeddings: [0.12, -0.55, 0.88, 1.02], + metadata: { + key: 'value', + }, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/create-documents.md b/examples/2.0.x/console-web/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..6bda5bf18 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/create-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/create-index.md b/examples/2.0.x/console-web/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..1f8b422dc --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/create-index.md @@ -0,0 +1,26 @@ +```javascript +import { + Client, + VectorsDB, + VectorsDBIndexType, + OrderBy, +} from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: VectorsDBIndexType.HnswEuclidean, + attributes: [], + orders: [OrderBy.Asc], // optional + lengths: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/create-operations.md b/examples/2.0.x/console-web/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..fc90ed8bd --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createOperations({ + transactionId: '<TRANSACTION_ID>', + operations: [ + { + action: 'create', + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/create-query.md b/examples/2.0.x/console-web/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..5900362b2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createQuery({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/create-transaction.md b/examples/2.0.x/console-web/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..713840a8b --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/create.md b/examples/2.0.x/console-web/examples/vectorsdb/create.md new file mode 100644 index 000000000..b52b5d229 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/delete-collection.md b/examples/2.0.x/console-web/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..9e0d2bf86 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/delete-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/delete-document.md b/examples/2.0.x/console-web/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..b7d5b7a77 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/delete-documents.md b/examples/2.0.x/console-web/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..e699485bd --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/delete-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/delete-index.md b/examples/2.0.x/console-web/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..b88a5dc20 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/delete-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/console-web/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..8e936d1a2 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteTransaction({ + transactionId: '<TRANSACTION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/delete.md b/examples/2.0.x/console-web/examples/vectorsdb/delete.md new file mode 100644 index 000000000..34ce8b6da --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.delete({ + databaseId: '<DATABASE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/get-collection.md b/examples/2.0.x/console-web/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..3d0eb6a95 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/get-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/get-document.md b/examples/2.0.x/console-web/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..0b16fca1f --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/get-index.md b/examples/2.0.x/console-web/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..6a1ace933 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/get-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/get-transaction.md b/examples/2.0.x/console-web/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..cd9e1e58c --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getTransaction({ + transactionId: '<TRANSACTION_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/get.md b/examples/2.0.x/console-web/examples/vectorsdb/get.md new file mode 100644 index 000000000..e82e8f5dc --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.get({ + databaseId: '<DATABASE_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/list-collections.md b/examples/2.0.x/console-web/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..10b68b111 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/list-collections.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listCollections({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/list-documents.md b/examples/2.0.x/console-web/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..acdfdc88b --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/list-indexes.md b/examples/2.0.x/console-web/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..dfc577c05 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/list-indexes.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listIndexes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/list-transactions.md b/examples/2.0.x/console-web/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..02da76869 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/list.md b/examples/2.0.x/console-web/examples/vectorsdb/list.md new file mode 100644 index 000000000..6e8ac6d3d --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/update-collection.md b/examples/2.0.x/console-web/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..491024410 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/update-collection.md @@ -0,0 +1,21 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, // optional + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/update-document.md b/examples/2.0.x/console-web/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..f571d8341 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/update-documents.md b/examples/2.0.x/console-web/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..e24463827 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/update-documents.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/update-transaction.md b/examples/2.0.x/console-web/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..cec0535df --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateTransaction({ + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/update.md b/examples/2.0.x/console-web/examples/vectorsdb/update.md new file mode 100644 index 000000000..264e9959d --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/update.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/upsert-document.md b/examples/2.0.x/console-web/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..9d42d0d7d --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/console-web/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..af58d1d43 --- /dev/null +++ b/examples/2.0.x/console-web/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/webhooks/create.md b/examples/2.0.x/console-web/examples/webhooks/create.md new file mode 100644 index 000000000..f5817fbe6 --- /dev/null +++ b/examples/2.0.x/console-web/examples/webhooks/create.md @@ -0,0 +1,23 @@ +```javascript +import { Client, Webhooks } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const webhooks = new Webhooks(client); + +const result = await webhooks.create({ + webhookId: '<WEBHOOK_ID>', + url: 'https://example.com/webhook', + name: '<NAME>', + events: [], + enabled: false, // optional + tls: false, // optional + authUsername: '<AUTH_USERNAME>', // optional + authPassword: 'password', // optional + secret: '<SECRET>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/webhooks/delete.md b/examples/2.0.x/console-web/examples/webhooks/delete.md new file mode 100644 index 000000000..e4fbd3d79 --- /dev/null +++ b/examples/2.0.x/console-web/examples/webhooks/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Webhooks } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const webhooks = new Webhooks(client); + +const result = await webhooks.delete({ + webhookId: '<WEBHOOK_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/webhooks/get.md b/examples/2.0.x/console-web/examples/webhooks/get.md new file mode 100644 index 000000000..d7e40e528 --- /dev/null +++ b/examples/2.0.x/console-web/examples/webhooks/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Webhooks } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const webhooks = new Webhooks(client); + +const result = await webhooks.get({ + webhookId: '<WEBHOOK_ID>', +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/webhooks/list.md b/examples/2.0.x/console-web/examples/webhooks/list.md new file mode 100644 index 000000000..6d4381cd9 --- /dev/null +++ b/examples/2.0.x/console-web/examples/webhooks/list.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Webhooks } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const webhooks = new Webhooks(client); + +const result = await webhooks.list({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/webhooks/update-secret.md b/examples/2.0.x/console-web/examples/webhooks/update-secret.md new file mode 100644 index 000000000..bb7492ade --- /dev/null +++ b/examples/2.0.x/console-web/examples/webhooks/update-secret.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Webhooks } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const webhooks = new Webhooks(client); + +const result = await webhooks.updateSecret({ + webhookId: '<WEBHOOK_ID>', + secret: '<SECRET>', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/console-web/examples/webhooks/update.md b/examples/2.0.x/console-web/examples/webhooks/update.md new file mode 100644 index 000000000..78071ef4c --- /dev/null +++ b/examples/2.0.x/console-web/examples/webhooks/update.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Webhooks } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const webhooks = new Webhooks(client); + +const result = await webhooks.update({ + webhookId: '<WEBHOOK_ID>', + name: '<NAME>', + url: 'https://example.com/webhook', + events: [], + enabled: false, // optional + tls: false, // optional + authUsername: '<AUTH_USERNAME>', // optional + authPassword: 'password', // optional +}); + +console.log(result); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-anonymous-session.md b/examples/2.0.x/server-dart/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..542c0d644 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-anonymous-session.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.createAnonymousSession(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-email-password-session.md b/examples/2.0.x/server-dart/examples/account/create-email-password-session.md new file mode 100644 index 000000000..bac35a125 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-email-password-session.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.createEmailPasswordSession( + email: 'email@example.com', + password: 'password', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-email-token.md b/examples/2.0.x/server-dart/examples/account/create-email-token.md new file mode 100644 index 000000000..dfcfc76c8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-email-token.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createEmailToken( + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-email-verification.md b/examples/2.0.x/server-dart/examples/account/create-email-verification.md new file mode 100644 index 000000000..0db846c12 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-email-verification.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createEmailVerification( + url: 'https://example.com', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-magic-url-token.md b/examples/2.0.x/server-dart/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..4b4f703e8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-magic-url-token.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createMagicURLToken( + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // (optional) + phrase: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-dart/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..98a10171c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-mfa-authenticator.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaType result = await account.createMFAAuthenticator( + type: enums.AuthenticatorType.totp, +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-dart/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..36d2f8981 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-mfa-challenge.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaChallenge result = await account.createMFAChallenge( + factor: enums.AuthenticationFactor.email, +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-dart/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..1fc2ec3b1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaRecoveryCodes result = await account.createMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-dart/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..de299d60b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-o-auth-2-token.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.createOAuth2Token( + provider: enums.OAuthProvider.amazon, + success: 'https://example.com', // (optional) + failure: 'https://example.com', // (optional) + scopes: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-phone-token.md b/examples/2.0.x/server-dart/examples/account/create-phone-token.md new file mode 100644 index 000000000..86a2ed36b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-phone-token.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createPhoneToken( + userId: '<USER_ID>', + phone: '+12065550100', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-phone-verification.md b/examples/2.0.x/server-dart/examples/account/create-phone-verification.md new file mode 100644 index 000000000..400e47ec4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-phone-verification.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createPhoneVerification(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-recovery.md b/examples/2.0.x/server-dart/examples/account/create-recovery.md new file mode 100644 index 000000000..a71d691f5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-recovery.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createRecovery( + email: 'email@example.com', + url: 'https://example.com', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-session.md b/examples/2.0.x/server-dart/examples/account/create-session.md new file mode 100644 index 000000000..5e6f733d5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-session.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.createSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create-verification.md b/examples/2.0.x/server-dart/examples/account/create-verification.md new file mode 100644 index 000000000..c12b0dd2d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create-verification.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createVerification( + url: 'https://example.com', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/create.md b/examples/2.0.x/server-dart/examples/account/create.md new file mode 100644 index 000000000..59b961161 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/create.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.create( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/delete-identity.md b/examples/2.0.x/server-dart/examples/account/delete-identity.md new file mode 100644 index 000000000..e05b30fa5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/delete-identity.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.deleteIdentity( + identityId: '<IDENTITY_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-dart/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..06b60ece9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.deleteMFAAuthenticator( + type: enums.AuthenticatorType.totp, +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/delete-session.md b/examples/2.0.x/server-dart/examples/account/delete-session.md new file mode 100644 index 000000000..2961f1a48 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/delete-session.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.deleteSession( + sessionId: '<SESSION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/delete-sessions.md b/examples/2.0.x/server-dart/examples/account/delete-sessions.md new file mode 100644 index 000000000..2b7f5b819 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/delete-sessions.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.deleteSessions(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-dart/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..7b6c314ae --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaRecoveryCodes result = await account.getMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/get-prefs.md b/examples/2.0.x/server-dart/examples/account/get-prefs.md new file mode 100644 index 000000000..667f2c040 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/get-prefs.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Preferences result = await account.getPrefs(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/get-session.md b/examples/2.0.x/server-dart/examples/account/get-session.md new file mode 100644 index 000000000..36429bf74 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/get-session.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.getSession( + sessionId: '<SESSION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/get.md b/examples/2.0.x/server-dart/examples/account/get.md new file mode 100644 index 000000000..fb5633f4b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/get.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.get(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/list-identities.md b/examples/2.0.x/server-dart/examples/account/list-identities.md new file mode 100644 index 000000000..9db450bbe --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/list-identities.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +IdentityList result = await account.listIdentities( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/list-mfa-factors.md b/examples/2.0.x/server-dart/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..80f366802 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/list-mfa-factors.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaFactors result = await account.listMFAFactors(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/list-sessions.md b/examples/2.0.x/server-dart/examples/account/list-sessions.md new file mode 100644 index 000000000..53c0d220b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/list-sessions.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +SessionList result = await account.listSessions(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-email-verification.md b/examples/2.0.x/server-dart/examples/account/update-email-verification.md new file mode 100644 index 000000000..4f41ac059 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-email-verification.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.updateEmailVerification( + userId: '<USER_ID>', + secret: '<SECRET>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-email.md b/examples/2.0.x/server-dart/examples/account/update-email.md new file mode 100644 index 000000000..b6c7c5924 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-email.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateEmail( + email: 'email@example.com', + password: 'password', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-magic-url-session.md b/examples/2.0.x/server-dart/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..bed558eab --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-magic-url-session.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.updateMagicURLSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-dart/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..d898bc2d3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-mfa-authenticator.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateMFAAuthenticator( + type: enums.AuthenticatorType.totp, + otp: '<OTP>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-dart/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..928a7ad8f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-mfa-challenge.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.updateMFAChallenge( + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-dart/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..b1abcd858 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaRecoveryCodes result = await account.updateMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-mfa.md b/examples/2.0.x/server-dart/examples/account/update-mfa.md new file mode 100644 index 000000000..744a5da5d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-mfa.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateMFA( + mfa: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-name.md b/examples/2.0.x/server-dart/examples/account/update-name.md new file mode 100644 index 000000000..402210076 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-name.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateName( + name: '<NAME>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-password.md b/examples/2.0.x/server-dart/examples/account/update-password.md new file mode 100644 index 000000000..e903f1a1b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-password.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updatePassword( + password: 'password', + oldPassword: 'password', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-phone-session.md b/examples/2.0.x/server-dart/examples/account/update-phone-session.md new file mode 100644 index 000000000..d99d8b6d3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-phone-session.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.updatePhoneSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-phone-verification.md b/examples/2.0.x/server-dart/examples/account/update-phone-verification.md new file mode 100644 index 000000000..909b228ef --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-phone-verification.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.updatePhoneVerification( + userId: '<USER_ID>', + secret: '<SECRET>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-phone.md b/examples/2.0.x/server-dart/examples/account/update-phone.md new file mode 100644 index 000000000..7bf501690 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-phone.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updatePhone( + phone: '+12065550100', + password: 'password', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-prefs.md b/examples/2.0.x/server-dart/examples/account/update-prefs.md new file mode 100644 index 000000000..fe0076a27 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-prefs.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updatePrefs( + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + }, +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-recovery.md b/examples/2.0.x/server-dart/examples/account/update-recovery.md new file mode 100644 index 000000000..fd69c45fa --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-recovery.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.updateRecovery( + userId: '<USER_ID>', + secret: '<SECRET>', + password: 'password', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-session.md b/examples/2.0.x/server-dart/examples/account/update-session.md new file mode 100644 index 000000000..12ad41b51 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-session.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.updateSession( + sessionId: '<SESSION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-status.md b/examples/2.0.x/server-dart/examples/account/update-status.md new file mode 100644 index 000000000..0841e5e25 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-status.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateStatus(); +``` diff --git a/examples/2.0.x/server-dart/examples/account/update-verification.md b/examples/2.0.x/server-dart/examples/account/update-verification.md new file mode 100644 index 000000000..e45bfd3cf --- /dev/null +++ b/examples/2.0.x/server-dart/examples/account/update-verification.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.updateVerification( + userId: '<USER_ID>', + secret: '<SECRET>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/advisor/delete-report.md b/examples/2.0.x/server-dart/examples/advisor/delete-report.md new file mode 100644 index 000000000..d490e8209 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/advisor/delete-report.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Advisor advisor = Advisor(client); + +await advisor.deleteReport( + reportId: '<REPORT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/advisor/get-insight.md b/examples/2.0.x/server-dart/examples/advisor/get-insight.md new file mode 100644 index 000000000..1920eb8e2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/advisor/get-insight.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Advisor advisor = Advisor(client); + +Insight result = await advisor.getInsight( + reportId: '<REPORT_ID>', + insightId: '<INSIGHT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/advisor/get-report.md b/examples/2.0.x/server-dart/examples/advisor/get-report.md new file mode 100644 index 000000000..4266ff05c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/advisor/get-report.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Advisor advisor = Advisor(client); + +Report result = await advisor.getReport( + reportId: '<REPORT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/advisor/list-insights.md b/examples/2.0.x/server-dart/examples/advisor/list-insights.md new file mode 100644 index 000000000..16d874f77 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/advisor/list-insights.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Advisor advisor = Advisor(client); + +InsightList result = await advisor.listInsights( + reportId: '<REPORT_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/advisor/list-reports.md b/examples/2.0.x/server-dart/examples/advisor/list-reports.md new file mode 100644 index 000000000..292c014b1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/advisor/list-reports.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Advisor advisor = Advisor(client); + +ReportList result = await advisor.listReports( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-browser.md b/examples/2.0.x/server-dart/examples/avatars/get-browser.md new file mode 100644 index 000000000..b4626789b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-browser.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getBrowser( + code: enums.Browser.avantBrowser, + width: 0, // (optional) + height: 0, // (optional) + quality: -1, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-credit-card.md b/examples/2.0.x/server-dart/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..b5eb4f427 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-credit-card.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getCreditCard( + code: enums.CreditCard.americanExpress, + width: 0, // (optional) + height: 0, // (optional) + quality: -1, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-favicon.md b/examples/2.0.x/server-dart/examples/avatars/get-favicon.md new file mode 100644 index 000000000..1bfa9b721 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-favicon.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getFavicon( + url: 'https://example.com', +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-flag.md b/examples/2.0.x/server-dart/examples/avatars/get-flag.md new file mode 100644 index 000000000..920ccc5d8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-flag.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getFlag( + code: enums.Flag.afghanistan, + width: 0, // (optional) + height: 0, // (optional) + quality: -1, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-image.md b/examples/2.0.x/server-dart/examples/avatars/get-image.md new file mode 100644 index 000000000..c4c347102 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-image.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getImage( + url: 'https://example.com', + width: 0, // (optional) + height: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-initials.md b/examples/2.0.x/server-dart/examples/avatars/get-initials.md new file mode 100644 index 000000000..27323c5c9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-initials.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getInitials( + name: '<NAME>', // (optional) + width: 0, // (optional) + height: 0, // (optional) + background: 'FFFFFF', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-photo.md b/examples/2.0.x/server-dart/examples/avatars/get-photo.md new file mode 100644 index 000000000..9914fedcf --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-photo.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getPhoto( + width: 0, // (optional) + height: 0, // (optional) + quality: 0, // (optional) + output: 'png', // (optional) + rating: 'g', // (optional) + userId: 'current()', // (optional) + emailHash: '<EMAIL_HASH>', // (optional) + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-qr.md b/examples/2.0.x/server-dart/examples/avatars/get-qr.md new file mode 100644 index 000000000..9c470360e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-qr.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getQR( + text: '<TEXT>', + size: 1, // (optional) + margin: 0, // (optional) + download: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/avatars/get-screenshot.md b/examples/2.0.x/server-dart/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..b2c005e37 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/avatars/get-screenshot.md @@ -0,0 +1,37 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +Uint8List result = await avatars.getScreenshot( + url: 'https://example.com', + headers: { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + }, // (optional) + viewportWidth: 1920, // (optional) + viewportHeight: 1080, // (optional) + scale: 2, // (optional) + theme: enums.BrowserTheme.dark, // (optional) + userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // (optional) + fullpage: true, // (optional) + locale: 'en-US', // (optional) + timezone: enums.Timezone.africaAbidjan, // (optional) + latitude: 37.7749, // (optional) + longitude: -122.4194, // (optional) + accuracy: 100, // (optional) + touch: true, // (optional) + permissions: [enums.BrowserPermission.geolocation, enums.BrowserPermission.notifications], // (optional) + sleep: 3, // (optional) + width: 800, // (optional) + height: 600, // (optional) + quality: 85, // (optional) + output: enums.ImageFormat.jpeg, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..2ef51ff23 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-big-int-attribute.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeBigint result = await databases.createBigIntAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + min: 0, // (optional) + max: 1000000, // (optional) + xdefault: 0, // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..f997555db --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-boolean-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeBoolean result = await databases.createBooleanAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: false, // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-collection.md b/examples/2.0.x/server-dart/examples/databases/create-collection.md new file mode 100644 index 000000000..f0c3aea51 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-collection.md @@ -0,0 +1,23 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Collection result = await databases.createCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // (optional) + documentSecurity: false, // (optional) + enabled: false, // (optional) + attributes: [], // (optional) + indexes: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..88a1069b0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-datetime-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeDatetime result = await databases.createDatetimeAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: '2020-10-15T06:38:00.000+00:00', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-document.md b/examples/2.0.x/server-dart/examples/databases/create-document.md new file mode 100644 index 000000000..f6dc0aaa6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-document.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-documents.md b/examples/2.0.x/server-dart/examples/databases/create-documents.md new file mode 100644 index 000000000..dd0204676 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.createDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-email-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..beac778d1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-email-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeEmail result = await databases.createEmailAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'email@example.com', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..b690880f8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-enum-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeEnum result = await databases.createEnumAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + xrequired: false, + xdefault: 'active', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-float-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..5cce5c6ed --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-float-attribute.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeFloat result = await databases.createFloatAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + min: 0, // (optional) + max: 100, // (optional) + xdefault: 10.5, // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-index.md b/examples/2.0.x/server-dart/examples/databases/create-index.md new file mode 100644 index 000000000..b1bfb5724 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-index.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Index result = await databases.createIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: enums.DatabasesIndexType.key, + attributes: [], + orders: [enums.OrderBy.asc], // (optional) + lengths: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..333f82809 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-integer-attribute.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeInteger result = await databases.createIntegerAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + min: 0, // (optional) + max: 100, // (optional) + xdefault: 10, // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..c9334bc39 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-ip-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeIp result = await databases.createIpAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: '192.0.2.0', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-line-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..aca28abd3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-line-attribute.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeLine result = await databases.createLineAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..fae172d8a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-longtext-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeLongtext result = await databases.createLongtextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..a93a23c1c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeMediumtext result = await databases.createMediumtextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-operations.md b/examples/2.0.x/server-dart/examples/databases/create-operations.md new file mode 100644 index 000000000..d44b4e839 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-operations.md @@ -0,0 +1,25 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Transaction result = await databases.createOperations( + transactionId: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-point-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..6d320c48c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-point-attribute.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributePoint result = await databases.createPointAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [1, 2], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..62923f950 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-polygon-attribute.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributePolygon result = await databases.createPolygonAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..2cb68d98f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-relationship-attribute.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeRelationship result = await databases.createRelationshipAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + relatedCollectionId: '<RELATED_COLLECTION_ID>', + type: enums.RelationshipType.oneToOne, + twoWay: false, // (optional) + key: '<KEY>', // (optional) + twoWayKey: '<TWO_WAY_KEY>', // (optional) + onDelete: enums.RelationMutate.cascade, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-string-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..d6b24de09 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-string-attribute.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeString result = await databases.createStringAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + size: 1, + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-text-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..0a53ffb1a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-text-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeText result = await databases.createTextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-transaction.md b/examples/2.0.x/server-dart/examples/databases/create-transaction.md new file mode 100644 index 000000000..5ab1c8ae1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Transaction result = await databases.createTransaction( + ttl: 60, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-url-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..cffdb5361 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-url-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeUrl result = await databases.createUrlAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'https://example.com', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-dart/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..c0dc22595 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create-varchar-attribute.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeVarchar result = await databases.createVarcharAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + size: 1, + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/create.md b/examples/2.0.x/server-dart/examples/databases/create.md new file mode 100644 index 000000000..3abe57d10 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/create.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Database result = await databases.create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-dart/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..2f99b28ad --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/decrement-document-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.decrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // (optional) + min: 0, // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/delete-attribute.md b/examples/2.0.x/server-dart/examples/databases/delete-attribute.md new file mode 100644 index 000000000..ef14704a3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/delete-attribute.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/delete-collection.md b/examples/2.0.x/server-dart/examples/databases/delete-collection.md new file mode 100644 index 000000000..76a0289e1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/delete-collection.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/delete-document.md b/examples/2.0.x/server-dart/examples/databases/delete-document.md new file mode 100644 index 000000000..659e09e74 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/delete-document.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +await databases.deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/delete-documents.md b/examples/2.0.x/server-dart/examples/databases/delete-documents.md new file mode 100644 index 000000000..6a8bd5a87 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/delete-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/delete-index.md b/examples/2.0.x/server-dart/examples/databases/delete-index.md new file mode 100644 index 000000000..f13e1a44c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/delete-index.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/delete-transaction.md b/examples/2.0.x/server-dart/examples/databases/delete-transaction.md new file mode 100644 index 000000000..1a00f8166 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/delete-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteTransaction( + transactionId: '<TRANSACTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/delete.md b/examples/2.0.x/server-dart/examples/databases/delete.md new file mode 100644 index 000000000..eabebed6f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.delete( + databaseId: '<DATABASE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/get-attribute.md b/examples/2.0.x/server-dart/examples/databases/get-attribute.md new file mode 100644 index 000000000..97ddcff19 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/get-attribute.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +dynamic result = await databases.getAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/get-collection.md b/examples/2.0.x/server-dart/examples/databases/get-collection.md new file mode 100644 index 000000000..0e19f4e04 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/get-collection.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Collection result = await databases.getCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/get-document.md b/examples/2.0.x/server-dart/examples/databases/get-document.md new file mode 100644 index 000000000..75fbb943e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/get-document.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/get-index.md b/examples/2.0.x/server-dart/examples/databases/get-index.md new file mode 100644 index 000000000..b516dd88b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/get-index.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Index result = await databases.getIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/get-transaction.md b/examples/2.0.x/server-dart/examples/databases/get-transaction.md new file mode 100644 index 000000000..230f2ee61 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/get-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Transaction result = await databases.getTransaction( + transactionId: '<TRANSACTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/get.md b/examples/2.0.x/server-dart/examples/databases/get.md new file mode 100644 index 000000000..e8b042b37 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Database result = await databases.get( + databaseId: '<DATABASE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-dart/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..7a7170237 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/increment-document-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.incrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // (optional) + max: 100, // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/list-attributes.md b/examples/2.0.x/server-dart/examples/databases/list-attributes.md new file mode 100644 index 000000000..3d98457fe --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/list-attributes.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeList result = await databases.listAttributes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/list-collections.md b/examples/2.0.x/server-dart/examples/databases/list-collections.md new file mode 100644 index 000000000..6b983d6bb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/list-collections.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +CollectionList result = await databases.listCollections( + databaseId: '<DATABASE_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/list-documents.md b/examples/2.0.x/server-dart/examples/databases/list-documents.md new file mode 100644 index 000000000..5cb4a1231 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/list-documents.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +DocumentList result = await databases.listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) + total: false, // (optional) + ttl: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/list-indexes.md b/examples/2.0.x/server-dart/examples/databases/list-indexes.md new file mode 100644 index 000000000..ccfa33582 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/list-indexes.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +IndexList result = await databases.listIndexes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/list-transactions.md b/examples/2.0.x/server-dart/examples/databases/list-transactions.md new file mode 100644 index 000000000..07a73e26d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/list-transactions.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +TransactionList result = await databases.listTransactions( + queries: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/list.md b/examples/2.0.x/server-dart/examples/databases/list.md new file mode 100644 index 000000000..3da131483 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +DatabaseList result = await databases.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..93a91d624 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-big-int-attribute.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeBigint result = await databases.updateBigIntAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 0, + min: 0, // (optional) + max: 1000000, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..2d7ba021e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-boolean-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeBoolean result = await databases.updateBooleanAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: false, + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-collection.md b/examples/2.0.x/server-dart/examples/databases/update-collection.md new file mode 100644 index 000000000..b724e7b94 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-collection.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Collection result = await databases.updateCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', // (optional) + permissions: [Permission.read(Role.any())], // (optional) + documentSecurity: false, // (optional) + enabled: false, // (optional) + purge: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..3534c431f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-datetime-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeDatetime result = await databases.updateDatetimeAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: '2020-10-15T06:38:00.000+00:00', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-document.md b/examples/2.0.x/server-dart/examples/databases/update-document.md new file mode 100644 index 000000000..ccfc6838c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-document.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-documents.md b/examples/2.0.x/server-dart/examples/databases/update-documents.md new file mode 100644 index 000000000..9ab88a699 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-documents.md @@ -0,0 +1,24 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.updateDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // (optional) + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-email-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..ba3944fd8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-email-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeEmail result = await databases.updateEmailAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'email@example.com', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..0edf10715 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-enum-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeEnum result = await databases.updateEnumAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + xrequired: false, + xdefault: 'active', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-float-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..f46c3f504 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-float-attribute.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeFloat result = await databases.updateFloatAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 10.5, + min: 0, // (optional) + max: 100, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..5d5928aa8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-integer-attribute.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeInteger result = await databases.updateIntegerAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 10, + min: 0, // (optional) + max: 100, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..d0f37ea5f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-ip-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeIp result = await databases.updateIpAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: '192.0.2.0', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-line-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..2a8620930 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-line-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeLine result = await databases.updateLineAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..daf0707b4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-longtext-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeLongtext result = await databases.updateLongtextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..08bccb671 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeMediumtext result = await databases.updateMediumtextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-point-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..2eae40b81 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-point-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributePoint result = await databases.updatePointAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [1, 2], // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..a72ccd79f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-polygon-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributePolygon result = await databases.updatePolygonAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..e1ab8b3b9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-relationship-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeRelationship result = await databases.updateRelationshipAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + onDelete: enums.RelationMutate.cascade, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-string-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..13530814a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-string-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeString result = await databases.updateStringAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + size: 1, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-text-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..bd74f458f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-text-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeText result = await databases.updateTextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-transaction.md b/examples/2.0.x/server-dart/examples/databases/update-transaction.md new file mode 100644 index 000000000..f43e7e5d7 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-transaction.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Transaction result = await databases.updateTransaction( + transactionId: '<TRANSACTION_ID>', + commit: false, // (optional) + rollback: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-url-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..d873907cf --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-url-attribute.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeUrl result = await databases.updateUrlAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'https://example.com', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-dart/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..96d6775ec --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update-varchar-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeVarchar result = await databases.updateVarcharAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + size: 1, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/update.md b/examples/2.0.x/server-dart/examples/databases/update.md new file mode 100644 index 000000000..4c097968a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/update.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Database result = await databases.update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/upsert-document.md b/examples/2.0.x/server-dart/examples/databases/upsert-document.md new file mode 100644 index 000000000..46a70fda1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/upsert-document.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/databases/upsert-documents.md b/examples/2.0.x/server-dart/examples/databases/upsert-documents.md new file mode 100644 index 000000000..95806e1ab --- /dev/null +++ b/examples/2.0.x/server-dart/examples/databases/upsert-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.upsertDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/create-collection.md b/examples/2.0.x/server-dart/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..dd591620d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/create-collection.md @@ -0,0 +1,23 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Collection result = await documentsDB.createCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // (optional) + documentSecurity: false, // (optional) + enabled: false, // (optional) + attributes: [], // (optional) + indexes: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/create-document.md b/examples/2.0.x/server-dart/examples/documentsdb/create-document.md new file mode 100644 index 000000000..07d152ba1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/create-document.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/create-documents.md b/examples/2.0.x/server-dart/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..6a76e7e0b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/create-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +DocumentList result = await documentsDB.createDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/create-index.md b/examples/2.0.x/server-dart/examples/documentsdb/create-index.md new file mode 100644 index 000000000..3cfaea320 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/create-index.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Index result = await documentsDB.createIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: enums.DocumentsDBIndexType.key, + attributes: [], + orders: [enums.OrderBy.asc], // (optional) + lengths: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/create-operations.md b/examples/2.0.x/server-dart/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..e91cd1867 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.createOperations( + transactionId: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-dart/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..caf13b367 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/create-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.createTransaction( + ttl: 60, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/create.md b/examples/2.0.x/server-dart/examples/documentsdb/create.md new file mode 100644 index 000000000..0b495c011 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/create.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Database result = await documentsDB.create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-dart/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..883644f1a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.decrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // (optional) + min: 0, // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-dart/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..ebf766acc --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/delete-collection.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/delete-document.md b/examples/2.0.x/server-dart/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..f9fa3a37f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/delete-document.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-dart/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..9218ccd6b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/delete-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/delete-index.md b/examples/2.0.x/server-dart/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..6aa14c686 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/delete-index.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-dart/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..6639fb887 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/delete-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.deleteTransaction( + transactionId: '<TRANSACTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/delete.md b/examples/2.0.x/server-dart/examples/documentsdb/delete.md new file mode 100644 index 000000000..308c2a83d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +await documentsDB.delete( + databaseId: '<DATABASE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/get-collection.md b/examples/2.0.x/server-dart/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..5b23bdb7e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/get-collection.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Collection result = await documentsDB.getCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/get-document.md b/examples/2.0.x/server-dart/examples/documentsdb/get-document.md new file mode 100644 index 000000000..02b6a7a43 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/get-document.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/get-index.md b/examples/2.0.x/server-dart/examples/documentsdb/get-index.md new file mode 100644 index 000000000..bbb7891c6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/get-index.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Index result = await documentsDB.getIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-dart/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..688128f20 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/get-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.getTransaction( + transactionId: '<TRANSACTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/get.md b/examples/2.0.x/server-dart/examples/documentsdb/get.md new file mode 100644 index 000000000..09bcb91f8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Database result = await documentsDB.get( + databaseId: '<DATABASE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-dart/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..e7b7d7ff2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.incrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // (optional) + max: 100, // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/list-collections.md b/examples/2.0.x/server-dart/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..45cef6362 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/list-collections.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +CollectionList result = await documentsDB.listCollections( + databaseId: '<DATABASE_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/list-documents.md b/examples/2.0.x/server-dart/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..5619c5cfd --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/list-documents.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +DocumentList result = await documentsDB.listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) + total: false, // (optional) + ttl: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-dart/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..b7285af15 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/list-indexes.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +IndexList result = await documentsDB.listIndexes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-dart/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..066ebfe5b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/list-transactions.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +TransactionList result = await documentsDB.listTransactions( + queries: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/list.md b/examples/2.0.x/server-dart/examples/documentsdb/list.md new file mode 100644 index 000000000..1b2b8dd49 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +DatabaseList result = await documentsDB.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/update-collection.md b/examples/2.0.x/server-dart/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..c90d2c4b9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/update-collection.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Collection result = await documentsDB.updateCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // (optional) + documentSecurity: false, // (optional) + enabled: false, // (optional) + purge: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/update-document.md b/examples/2.0.x/server-dart/examples/documentsdb/update-document.md new file mode 100644 index 000000000..99746d741 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/update-document.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/update-documents.md b/examples/2.0.x/server-dart/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..5554e087b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/update-documents.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +DocumentList result = await documentsDB.updateDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // (optional) + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-dart/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..d5dcaeb58 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/update-transaction.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Transaction result = await documentsDB.updateTransaction( + transactionId: '<TRANSACTION_ID>', + commit: false, // (optional) + rollback: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/update.md b/examples/2.0.x/server-dart/examples/documentsdb/update.md new file mode 100644 index 000000000..f24ec2cca --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/update.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +Database result = await documentsDB.update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-dart/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..71c5db06d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/upsert-document.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +DocumentsDB documentsDB = DocumentsDB(client); + +Document result = await documentsDB.upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-dart/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..bbf864900 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/documentsdb/upsert-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +DocumentsDB documentsDB = DocumentsDB(client); + +DocumentList result = await documentsDB.upsertDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-dart/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..b943468ad --- /dev/null +++ b/examples/2.0.x/server-dart/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Embeddings embeddings = Embeddings(client); + +EmbeddingList result = await embeddings.createTextEmbeddings( + texts: [], + model: enums.EmbeddingModel.nomicEmbedText, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/create-deployment.md b/examples/2.0.x/server-dart/examples/functions/create-deployment.md new file mode 100644 index 000000000..62ac7cca5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/create-deployment.md @@ -0,0 +1,19 @@ +```dart +import 'dart:io'; +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createDeployment( + functionId: '<FUNCTION_ID>', + code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + activate: false, + entrypoint: '<ENTRYPOINT>', // (optional) + commands: '<COMMANDS>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-dart/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..14804895b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createDuplicateDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + buildId: '<BUILD_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/create-execution.md b/examples/2.0.x/server-dart/examples/functions/create-execution.md new file mode 100644 index 000000000..2f6ac1c33 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/create-execution.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Functions functions = Functions(client); + +Execution result = await functions.createExecution( + functionId: '<FUNCTION_ID>', + body: '<BODY>', // (optional) + xasync: false, // (optional) + path: '<PATH>', // (optional) + method: enums.ExecutionMethod.gET, // (optional) + headers: {}, // (optional) + scheduledAt: '<SCHEDULED_AT>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/create-template-deployment.md b/examples/2.0.x/server-dart/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..1b1f5d244 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/create-template-deployment.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createTemplateDeployment( + functionId: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + type: enums.TemplateReferenceType.commit, + reference: '<REFERENCE>', + activate: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/create-variable.md b/examples/2.0.x/server-dart/examples/functions/create-variable.md new file mode 100644 index 000000000..48d9ca801 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/create-variable.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Variable result = await functions.createVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-dart/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..a241c80fe --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/create-vcs-deployment.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createVcsDeployment( + functionId: '<FUNCTION_ID>', + type: enums.VCSReferenceType.branch, + reference: '<REFERENCE>', + activate: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/create.md b/examples/2.0.x/server-dart/examples/functions/create.md new file mode 100644 index 000000000..e4eddf0bd --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/create.md @@ -0,0 +1,36 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Func result = await functions.create( + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: enums.Runtime.node145, + execute: ["any"], // (optional) + events: [], // (optional) + schedule: '0 0 * * *', // (optional) + timeout: 1, // (optional) + enabled: false, // (optional) + logging: false, // (optional) + entrypoint: '<ENTRYPOINT>', // (optional) + commands: '<COMMANDS>', // (optional) + scopes: [enums.ProjectKeyScopes.projectRead], // (optional) + installationId: '<INSTALLATION_ID>', // (optional) + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional) + providerBranch: '<PROVIDER_BRANCH>', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional) + providerBranches: [], // (optional) + providerPaths: [], // (optional) + buildSpecification: 's-1vcpu-512mb', // (optional) + runtimeSpecification: 's-1vcpu-512mb', // (optional) + deploymentRetention: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/delete-deployment.md b/examples/2.0.x/server-dart/examples/functions/delete-deployment.md new file mode 100644 index 000000000..a4d629d19 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/delete-deployment.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +await functions.deleteDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/delete-execution.md b/examples/2.0.x/server-dart/examples/functions/delete-execution.md new file mode 100644 index 000000000..f5226dda0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/delete-execution.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +await functions.deleteExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/delete-variable.md b/examples/2.0.x/server-dart/examples/functions/delete-variable.md new file mode 100644 index 000000000..ce2c26c12 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/delete-variable.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +await functions.deleteVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/delete.md b/examples/2.0.x/server-dart/examples/functions/delete.md new file mode 100644 index 000000000..9d0465d0c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +await functions.delete( + functionId: '<FUNCTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/get-deployment-download.md b/examples/2.0.x/server-dart/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..618f84b62 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/get-deployment-download.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Uint8List result = await functions.getDeploymentDownload( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: enums.DeploymentDownloadType.source, // (optional) + token: '<TOKEN>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/get-deployment.md b/examples/2.0.x/server-dart/examples/functions/get-deployment.md new file mode 100644 index 000000000..8e3e2e28c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/get-deployment.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.getDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/get-execution.md b/examples/2.0.x/server-dart/examples/functions/get-execution.md new file mode 100644 index 000000000..1f3654845 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/get-execution.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Functions functions = Functions(client); + +Execution result = await functions.getExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/get-variable.md b/examples/2.0.x/server-dart/examples/functions/get-variable.md new file mode 100644 index 000000000..ab8179e0c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/get-variable.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Variable result = await functions.getVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/get.md b/examples/2.0.x/server-dart/examples/functions/get.md new file mode 100644 index 000000000..caafad0ac --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Func result = await functions.get( + functionId: '<FUNCTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/list-deployments.md b/examples/2.0.x/server-dart/examples/functions/list-deployments.md new file mode 100644 index 000000000..0cd7c71fb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/list-deployments.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +DeploymentList result = await functions.listDeployments( + functionId: '<FUNCTION_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/list-executions.md b/examples/2.0.x/server-dart/examples/functions/list-executions.md new file mode 100644 index 000000000..deb100be0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/list-executions.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Functions functions = Functions(client); + +ExecutionList result = await functions.listExecutions( + functionId: '<FUNCTION_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/list-runtimes.md b/examples/2.0.x/server-dart/examples/functions/list-runtimes.md new file mode 100644 index 000000000..6325f4e4b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/list-runtimes.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +RuntimeList result = await functions.listRuntimes(); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/list-specifications.md b/examples/2.0.x/server-dart/examples/functions/list-specifications.md new file mode 100644 index 000000000..be35d601a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/list-specifications.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +SpecificationList result = await functions.listSpecifications( + type: 'runtimes', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/list-variables.md b/examples/2.0.x/server-dart/examples/functions/list-variables.md new file mode 100644 index 000000000..bd07b0000 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/list-variables.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +VariableList result = await functions.listVariables( + functionId: '<FUNCTION_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/list.md b/examples/2.0.x/server-dart/examples/functions/list.md new file mode 100644 index 000000000..5b5fb5711 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +FunctionList result = await functions.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/update-deployment-status.md b/examples/2.0.x/server-dart/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..7c8d0cb8e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/update-deployment-status.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.updateDeploymentStatus( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/update-function-deployment.md b/examples/2.0.x/server-dart/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..2fd5848b8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/update-function-deployment.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Func result = await functions.updateFunctionDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/update-variable.md b/examples/2.0.x/server-dart/examples/functions/update-variable.md new file mode 100644 index 000000000..e933473f6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/update-variable.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Variable result = await functions.updateVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', // (optional) + value: '<VALUE>', // (optional) + secret: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/functions/update.md b/examples/2.0.x/server-dart/examples/functions/update.md new file mode 100644 index 000000000..90277742c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/functions/update.md @@ -0,0 +1,36 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Func result = await functions.update( + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: enums.Runtime.node145, // (optional) + execute: ["any"], // (optional) + events: [], // (optional) + schedule: '0 0 * * *', // (optional) + timeout: 1, // (optional) + enabled: false, // (optional) + logging: false, // (optional) + entrypoint: '<ENTRYPOINT>', // (optional) + commands: '<COMMANDS>', // (optional) + scopes: [enums.ProjectKeyScopes.projectRead], // (optional) + installationId: '<INSTALLATION_ID>', // (optional) + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional) + providerBranch: '<PROVIDER_BRANCH>', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional) + providerBranches: [], // (optional) + providerPaths: [], // (optional) + buildSpecification: 's-1vcpu-512mb', // (optional) + runtimeSpecification: 's-1vcpu-512mb', // (optional) + deploymentRetention: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/graphql/mutation.md b/examples/2.0.x/server-dart/examples/graphql/mutation.md new file mode 100644 index 000000000..cd55d655e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/graphql/mutation.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Graphql graphql = Graphql(client); + +Any result = await graphql.mutation( + query: {}, +); +``` diff --git a/examples/2.0.x/server-dart/examples/graphql/query.md b/examples/2.0.x/server-dart/examples/graphql/query.md new file mode 100644 index 000000000..7d6fa1841 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/graphql/query.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Graphql graphql = Graphql(client); + +Any result = await graphql.query( + query: {}, +); +``` diff --git a/examples/2.0.x/server-dart/examples/locale/get.md b/examples/2.0.x/server-dart/examples/locale/get.md new file mode 100644 index 000000000..e8d5a6e5f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/locale/get.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +Locale result = await locale.get(); +``` diff --git a/examples/2.0.x/server-dart/examples/locale/list-codes.md b/examples/2.0.x/server-dart/examples/locale/list-codes.md new file mode 100644 index 000000000..c8b2490d9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/locale/list-codes.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +LocaleCodeList result = await locale.listCodes(); +``` diff --git a/examples/2.0.x/server-dart/examples/locale/list-continents.md b/examples/2.0.x/server-dart/examples/locale/list-continents.md new file mode 100644 index 000000000..5d96631bc --- /dev/null +++ b/examples/2.0.x/server-dart/examples/locale/list-continents.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +ContinentList result = await locale.listContinents(); +``` diff --git a/examples/2.0.x/server-dart/examples/locale/list-countries-eu.md b/examples/2.0.x/server-dart/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..191be9496 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/locale/list-countries-eu.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +CountryList result = await locale.listCountriesEU(); +``` diff --git a/examples/2.0.x/server-dart/examples/locale/list-countries-phones.md b/examples/2.0.x/server-dart/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..00ec7810b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/locale/list-countries-phones.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +PhoneList result = await locale.listCountriesPhones(); +``` diff --git a/examples/2.0.x/server-dart/examples/locale/list-countries.md b/examples/2.0.x/server-dart/examples/locale/list-countries.md new file mode 100644 index 000000000..62da933f8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/locale/list-countries.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +CountryList result = await locale.listCountries(); +``` diff --git a/examples/2.0.x/server-dart/examples/locale/list-currencies.md b/examples/2.0.x/server-dart/examples/locale/list-currencies.md new file mode 100644 index 000000000..c10296305 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/locale/list-currencies.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +CurrencyList result = await locale.listCurrencies(); +``` diff --git a/examples/2.0.x/server-dart/examples/locale/list-languages.md b/examples/2.0.x/server-dart/examples/locale/list-languages.md new file mode 100644 index 000000000..297128406 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/locale/list-languages.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +LanguageList result = await locale.listLanguages(); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..5ccf6f764 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-apns-provider.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createAPNSProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', // (optional) + authKeyId: '<AUTH_KEY_ID>', // (optional) + teamId: '<TEAM_ID>', // (optional) + bundleId: '<BUNDLE_ID>', // (optional) + sandbox: false, // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-email.md b/examples/2.0.x/server-dart/examples/messaging/create-email.md new file mode 100644 index 000000000..f31414eb6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-email.md @@ -0,0 +1,25 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.createEmail( + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + cc: [], // (optional) + bcc: [], // (optional) + attachments: [], // (optional) + draft: false, // (optional) + html: false, // (optional) + scheduledAt: '2020-10-15T06:38:00.000+00:00', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..93a224593 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-fcm-provider.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createFCMProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: {}, // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..5661c2081 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,23 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createMailgunProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // (optional) + domain: 'example.com', // (optional) + isEuRegion: false, // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..b6b919f51 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createMsg91Provider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + templateId: '<TEMPLATE_ID>', // (optional) + senderId: '<SENDER_ID>', // (optional) + authKey: '<AUTH_KEY>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-push.md b/examples/2.0.x/server-dart/examples/messaging/create-push.md new file mode 100644 index 000000000..0e28197ba --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-push.md @@ -0,0 +1,33 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.createPush( + messageId: '<MESSAGE_ID>', + title: '<TITLE>', // (optional) + body: '<BODY>', // (optional) + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + data: {}, // (optional) + action: '<ACTION>', // (optional) + image: '<ID1:ID2>', // (optional) + icon: '<ICON>', // (optional) + sound: '<SOUND>', // (optional) + color: '<COLOR>', // (optional) + tag: '<TAG>', // (optional) + badge: 1, // (optional) + draft: false, // (optional) + scheduledAt: '2020-10-15T06:38:00.000+00:00', // (optional) + contentAvailable: false, // (optional) + critical: false, // (optional) + priority: enums.MessagePriority.normal, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..6ce3fb47f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-resend-provider.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createResendProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..376bf8ccb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createSendgridProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..254166c12 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-ses-provider.md @@ -0,0 +1,23 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createSesProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + accessKey: '<ACCESS_KEY>', // (optional) + secretKey: '<SECRET_KEY>', // (optional) + region: '<REGION>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-sms.md b/examples/2.0.x/server-dart/examples/messaging/create-sms.md new file mode 100644 index 000000000..01591f571 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-sms.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.createSMS( + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + draft: false, // (optional) + scheduledAt: '2020-10-15T06:38:00.000+00:00', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..60f6082af --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-smtp-provider.md @@ -0,0 +1,28 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createSMTPProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 587, // (optional) + username: '<USERNAME>', // (optional) + password: 'password', // (optional) + encryption: enums.SmtpEncryption.none, // (optional) + autoTLS: false, // (optional) + mailer: '<MAILER>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-subscriber.md b/examples/2.0.x/server-dart/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..cd9e9a43b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-subscriber.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +Messaging messaging = Messaging(client); + +Subscriber result = await messaging.createSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..0e86c2d83 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-telesign-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createTelesignProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // (optional) + customerId: '<CUSTOMER_ID>', // (optional) + apiKey: '<API_KEY>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..88086ee51 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createTextmagicProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // (optional) + username: '<USERNAME>', // (optional) + apiKey: '<API_KEY>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-topic.md b/examples/2.0.x/server-dart/examples/messaging/create-topic.md new file mode 100644 index 000000000..1414bd0cc --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-topic.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Topic result = await messaging.createTopic( + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..abd848d47 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-twilio-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createTwilioProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // (optional) + accountSid: '<ACCOUNT_SID>', // (optional) + authToken: '<AUTH_TOKEN>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-dart/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..cb372b787 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/create-vonage-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createVonageProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // (optional) + apiKey: '<API_KEY>', // (optional) + apiSecret: '<API_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/delete-provider.md b/examples/2.0.x/server-dart/examples/messaging/delete-provider.md new file mode 100644 index 000000000..f59b3ddc5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/delete-provider.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +await messaging.deleteProvider( + providerId: '<PROVIDER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-dart/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..870894a1c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/delete-subscriber.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +Messaging messaging = Messaging(client); + +await messaging.deleteSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/delete-topic.md b/examples/2.0.x/server-dart/examples/messaging/delete-topic.md new file mode 100644 index 000000000..25afc8174 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/delete-topic.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +await messaging.deleteTopic( + topicId: '<TOPIC_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/delete.md b/examples/2.0.x/server-dart/examples/messaging/delete.md new file mode 100644 index 000000000..757aa24ab --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +await messaging.delete( + messageId: '<MESSAGE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/get-message.md b/examples/2.0.x/server-dart/examples/messaging/get-message.md new file mode 100644 index 000000000..6030ab411 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/get-message.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.getMessage( + messageId: '<MESSAGE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/get-provider.md b/examples/2.0.x/server-dart/examples/messaging/get-provider.md new file mode 100644 index 000000000..b9978e124 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/get-provider.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.getProvider( + providerId: '<PROVIDER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/get-subscriber.md b/examples/2.0.x/server-dart/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..4866ec406 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/get-subscriber.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Subscriber result = await messaging.getSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/get-topic.md b/examples/2.0.x/server-dart/examples/messaging/get-topic.md new file mode 100644 index 000000000..9bde98187 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/get-topic.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Topic result = await messaging.getTopic( + topicId: '<TOPIC_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/list-messages.md b/examples/2.0.x/server-dart/examples/messaging/list-messages.md new file mode 100644 index 000000000..cb43477f4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/list-messages.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +MessageList result = await messaging.listMessages( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/list-providers.md b/examples/2.0.x/server-dart/examples/messaging/list-providers.md new file mode 100644 index 000000000..3fb8e6ffc --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/list-providers.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +ProviderList result = await messaging.listProviders( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/list-subscribers.md b/examples/2.0.x/server-dart/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..6a876a7c3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/list-subscribers.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +SubscriberList result = await messaging.listSubscribers( + topicId: '<TOPIC_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/list-targets.md b/examples/2.0.x/server-dart/examples/messaging/list-targets.md new file mode 100644 index 000000000..6f0225e19 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/list-targets.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +TargetList result = await messaging.listTargets( + messageId: '<MESSAGE_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/list-topics.md b/examples/2.0.x/server-dart/examples/messaging/list-topics.md new file mode 100644 index 000000000..7147c2d0d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/list-topics.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +TopicList result = await messaging.listTopics( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..47e714d5c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-apns-provider.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateAPNSProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + authKey: '<AUTH_KEY>', // (optional) + authKeyId: '<AUTH_KEY_ID>', // (optional) + teamId: '<TEAM_ID>', // (optional) + bundleId: '<BUNDLE_ID>', // (optional) + sandbox: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-email.md b/examples/2.0.x/server-dart/examples/messaging/update-email.md new file mode 100644 index 000000000..c78a42fd9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-email.md @@ -0,0 +1,25 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.updateEmail( + messageId: '<MESSAGE_ID>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + subject: '<SUBJECT>', // (optional) + content: '<CONTENT>', // (optional) + draft: false, // (optional) + html: false, // (optional) + cc: [], // (optional) + bcc: [], // (optional) + scheduledAt: '2020-10-15T06:38:00.000+00:00', // (optional) + attachments: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..522466176 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-fcm-provider.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateFCMProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + serviceAccountJSON: {}, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..447f0898b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,23 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateMailgunProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + apiKey: '<API_KEY>', // (optional) + domain: 'example.com', // (optional) + isEuRegion: false, // (optional) + enabled: false, // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: '<REPLY_TO_EMAIL>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..37a0a5673 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateMsg91Provider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + templateId: '<TEMPLATE_ID>', // (optional) + senderId: '<SENDER_ID>', // (optional) + authKey: '<AUTH_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-push.md b/examples/2.0.x/server-dart/examples/messaging/update-push.md new file mode 100644 index 000000000..17b347e41 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-push.md @@ -0,0 +1,33 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.updatePush( + messageId: '<MESSAGE_ID>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + title: '<TITLE>', // (optional) + body: '<BODY>', // (optional) + data: {}, // (optional) + action: '<ACTION>', // (optional) + image: '<ID1:ID2>', // (optional) + icon: '<ICON>', // (optional) + sound: '<SOUND>', // (optional) + color: '<COLOR>', // (optional) + tag: '<TAG>', // (optional) + badge: 1, // (optional) + draft: false, // (optional) + scheduledAt: '2020-10-15T06:38:00.000+00:00', // (optional) + contentAvailable: false, // (optional) + critical: false, // (optional) + priority: enums.MessagePriority.normal, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..6af01550d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-resend-provider.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateResendProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + apiKey: '<API_KEY>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: '<REPLY_TO_EMAIL>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..3cfbe82b0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateSendgridProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + apiKey: '<API_KEY>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: '<REPLY_TO_EMAIL>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..a2e100752 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-ses-provider.md @@ -0,0 +1,23 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateSesProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + accessKey: '<ACCESS_KEY>', // (optional) + secretKey: '<SECRET_KEY>', // (optional) + region: '<REGION>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: '<REPLY_TO_EMAIL>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-sms.md b/examples/2.0.x/server-dart/examples/messaging/update-sms.md new file mode 100644 index 000000000..b8197294a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-sms.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.updateSMS( + messageId: '<MESSAGE_ID>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + content: '<CONTENT>', // (optional) + draft: false, // (optional) + scheduledAt: '2020-10-15T06:38:00.000+00:00', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..e88708cf0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-smtp-provider.md @@ -0,0 +1,28 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateSMTPProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + host: '<HOST>', // (optional) + port: 1, // (optional) + username: '<USERNAME>', // (optional) + password: 'password', // (optional) + encryption: enums.SmtpEncryption.none, // (optional) + autoTLS: false, // (optional) + mailer: '<MAILER>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: '<REPLY_TO_EMAIL>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..cc1759931 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-telesign-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateTelesignProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + customerId: '<CUSTOMER_ID>', // (optional) + apiKey: '<API_KEY>', // (optional) + from: '<FROM>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..2eaff5353 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateTextmagicProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + username: '<USERNAME>', // (optional) + apiKey: '<API_KEY>', // (optional) + from: '<FROM>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-topic.md b/examples/2.0.x/server-dart/examples/messaging/update-topic.md new file mode 100644 index 000000000..448812729 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-topic.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Topic result = await messaging.updateTopic( + topicId: '<TOPIC_ID>', + name: '<NAME>', // (optional) + subscribe: ["any"], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..d177d8718 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-twilio-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateTwilioProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + accountSid: '<ACCOUNT_SID>', // (optional) + authToken: '<AUTH_TOKEN>', // (optional) + from: '<FROM>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-dart/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..ca1228067 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/messaging/update-vonage-provider.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateVonageProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + apiKey: '<API_KEY>', // (optional) + apiSecret: '<API_SECRET>', // (optional) + from: '<FROM>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/organization/create-project.md b/examples/2.0.x/server-dart/examples/organization/create-project.md new file mode 100644 index 000000000..2345d7580 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/organization/create-project.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Organization organization = Organization(client); + +Project result = await organization.createProject( + projectId: '<PROJECT_ID>', + name: '<NAME>', + region: enums.Region.default, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/organization/delete-project.md b/examples/2.0.x/server-dart/examples/organization/delete-project.md new file mode 100644 index 000000000..054d22809 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/organization/delete-project.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Organization organization = Organization(client); + +await organization.deleteProject( + projectId: '<PROJECT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/organization/get-project.md b/examples/2.0.x/server-dart/examples/organization/get-project.md new file mode 100644 index 000000000..751fcc905 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/organization/get-project.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Organization organization = Organization(client); + +Project result = await organization.getProject( + projectId: '<PROJECT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/organization/list-projects.md b/examples/2.0.x/server-dart/examples/organization/list-projects.md new file mode 100644 index 000000000..49b5b5ec2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/organization/list-projects.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Organization organization = Organization(client); + +ProjectList result = await organization.listProjects( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/organization/update-project.md b/examples/2.0.x/server-dart/examples/organization/update-project.md new file mode 100644 index 000000000..9c94d9cd8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/organization/update-project.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Organization organization = Organization(client); + +Project result = await organization.updateProject( + projectId: '<PROJECT_ID>', + name: '<NAME>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/presences/delete.md b/examples/2.0.x/server-dart/examples/presences/delete.md new file mode 100644 index 000000000..50c950a61 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/presences/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Presences presences = Presences(client); + +await presences.delete( + presenceId: '<PRESENCE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/presences/get.md b/examples/2.0.x/server-dart/examples/presences/get.md new file mode 100644 index 000000000..f8025297f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/presences/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Presences presences = Presences(client); + +Presence result = await presences.get( + presenceId: '<PRESENCE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/presences/list.md b/examples/2.0.x/server-dart/examples/presences/list.md new file mode 100644 index 000000000..d0a87bb13 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/presences/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Presences presences = Presences(client); + +PresenceList result = await presences.list( + queries: [], // (optional) + total: false, // (optional) + ttl: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/presences/update.md b/examples/2.0.x/server-dart/examples/presences/update.md new file mode 100644 index 000000000..fcdc97b25 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/presences/update.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Presences presences = Presences(client); + +Presence result = await presences.update( + presenceId: '<PRESENCE_ID>', + userId: '<USER_ID>', + status: '<STATUS>', // (optional) + expiresAt: '2020-10-15T06:38:00.000+00:00', // (optional) + metadata: {}, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + purge: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/presences/upsert.md b/examples/2.0.x/server-dart/examples/presences/upsert.md new file mode 100644 index 000000000..7602a2eb2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/presences/upsert.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Presences presences = Presences(client); + +Presence result = await presences.upsert( + presenceId: '<PRESENCE_ID>', + userId: '<USER_ID>', + status: '<STATUS>', + permissions: [Permission.read(Role.any())], // (optional) + expiresAt: '2020-10-15T06:38:00.000+00:00', // (optional) + metadata: {}, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-android-platform.md b/examples/2.0.x/server-dart/examples/project/create-android-platform.md new file mode 100644 index 000000000..47a5c14bd --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-android-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformAndroid result = await project.createAndroidPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + applicationId: '<APPLICATION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-apple-platform.md b/examples/2.0.x/server-dart/examples/project/create-apple-platform.md new file mode 100644 index 000000000..8de12084a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-apple-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformApple result = await project.createApplePlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + bundleIdentifier: '<BUNDLE_IDENTIFIER>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-dart/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..cdc4ab77d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-ephemeral-key.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +EphemeralKey result = await project.createEphemeralKey( + scopes: [enums.ProjectKeyScopes.projectRead], + duration: 600, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-linux-platform.md b/examples/2.0.x/server-dart/examples/project/create-linux-platform.md new file mode 100644 index 000000000..a7842305e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-linux-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformLinux result = await project.createLinuxPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageName: '<PACKAGE_NAME>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-mock-phone.md b/examples/2.0.x/server-dart/examples/project/create-mock-phone.md new file mode 100644 index 000000000..c73c4c2fc --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-mock-phone.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +MockNumber result = await project.createMockPhone( + number: '+12065550100', + otp: '<OTP>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-smtp-test.md b/examples/2.0.x/server-dart/examples/project/create-smtp-test.md new file mode 100644 index 000000000..fac73da88 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-smtp-test.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + + result = await project.createSMTPTest( + emails: [], +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-variable.md b/examples/2.0.x/server-dart/examples/project/create-variable.md new file mode 100644 index 000000000..838fce0b6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-variable.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Variable result = await project.createVariable( + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-web-platform.md b/examples/2.0.x/server-dart/examples/project/create-web-platform.md new file mode 100644 index 000000000..12b157ee0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-web-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformWeb result = await project.createWebPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/create-windows-platform.md b/examples/2.0.x/server-dart/examples/project/create-windows-platform.md new file mode 100644 index 000000000..f2b47ca08 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/create-windows-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformWindows result = await project.createWindowsPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageIdentifierName: '<PACKAGE_IDENTIFIER_NAME>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/delete-key.md b/examples/2.0.x/server-dart/examples/project/delete-key.md new file mode 100644 index 000000000..6617fa4d6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/delete-key.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +await project.deleteKey( + keyId: '<KEY_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/delete-mock-phone.md b/examples/2.0.x/server-dart/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..f47a21902 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/delete-mock-phone.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +await project.deleteMockPhone( + number: '+12065550100', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/delete-platform.md b/examples/2.0.x/server-dart/examples/project/delete-platform.md new file mode 100644 index 000000000..2a1a5985c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/delete-platform.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +await project.deletePlatform( + platformId: '<PLATFORM_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/delete-variable.md b/examples/2.0.x/server-dart/examples/project/delete-variable.md new file mode 100644 index 000000000..9a177d51d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/delete-variable.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +await project.deleteVariable( + variableId: '<VARIABLE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/delete.md b/examples/2.0.x/server-dart/examples/project/delete.md new file mode 100644 index 000000000..3199e2db8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/delete.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +await project.delete(); +``` diff --git a/examples/2.0.x/server-dart/examples/project/get-email-template.md b/examples/2.0.x/server-dart/examples/project/get-email-template.md new file mode 100644 index 000000000..c98e0c6b2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/get-email-template.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +EmailTemplate result = await project.getEmailTemplate( + templateId: enums.ProjectEmailTemplateId.verification, + locale: enums.ProjectEmailTemplateLocale.af, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/get-key.md b/examples/2.0.x/server-dart/examples/project/get-key.md new file mode 100644 index 000000000..77ee7bd32 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/get-key.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Key result = await project.getKey( + keyId: '<KEY_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/get-mock-phone.md b/examples/2.0.x/server-dart/examples/project/get-mock-phone.md new file mode 100644 index 000000000..e3ef61ff9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/get-mock-phone.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +MockNumber result = await project.getMockPhone( + number: '+12065550100', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-dart/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..e487cda2b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +dynamic result = await project.getOAuth2Provider( + providerId: enums.ProjectOAuthProviderId.amazon, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/get-platform.md b/examples/2.0.x/server-dart/examples/project/get-platform.md new file mode 100644 index 000000000..3874f13ae --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/get-platform.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +dynamic result = await project.getPlatform( + platformId: '<PLATFORM_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/get-policy.md b/examples/2.0.x/server-dart/examples/project/get-policy.md new file mode 100644 index 000000000..d8c856440 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/get-policy.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +dynamic result = await project.getPolicy( + policyId: enums.ProjectPolicyId.passwordDictionary, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/get-variable.md b/examples/2.0.x/server-dart/examples/project/get-variable.md new file mode 100644 index 000000000..2b39e1048 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/get-variable.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Variable result = await project.getVariable( + variableId: '<VARIABLE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/get.md b/examples/2.0.x/server-dart/examples/project/get.md new file mode 100644 index 000000000..a2bfa10fc --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/get.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.get(); +``` diff --git a/examples/2.0.x/server-dart/examples/project/list-email-templates.md b/examples/2.0.x/server-dart/examples/project/list-email-templates.md new file mode 100644 index 000000000..0bd9ee7eb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/list-email-templates.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +EmailTemplateList result = await project.listEmailTemplates( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/list-keys.md b/examples/2.0.x/server-dart/examples/project/list-keys.md new file mode 100644 index 000000000..6002f7289 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/list-keys.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +KeyList result = await project.listKeys( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/list-mock-phones.md b/examples/2.0.x/server-dart/examples/project/list-mock-phones.md new file mode 100644 index 000000000..dac643971 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/list-mock-phones.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +MockNumberList result = await project.listMockPhones( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-dart/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..b69c52731 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2ProviderList result = await project.listOAuth2Providers( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/list-platforms.md b/examples/2.0.x/server-dart/examples/project/list-platforms.md new file mode 100644 index 000000000..9333ae36b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/list-platforms.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformList result = await project.listPlatforms( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/list-policies.md b/examples/2.0.x/server-dart/examples/project/list-policies.md new file mode 100644 index 000000000..5aba661cf --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/list-policies.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PolicyList result = await project.listPolicies( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/list-variables.md b/examples/2.0.x/server-dart/examples/project/list-variables.md new file mode 100644 index 000000000..ae5b52705 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/list-variables.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +VariableList result = await project.listVariables( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-android-platform.md b/examples/2.0.x/server-dart/examples/project/update-android-platform.md new file mode 100644 index 000000000..ee6eccf6a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-android-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformAndroid result = await project.updateAndroidPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + applicationId: '<APPLICATION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-apple-platform.md b/examples/2.0.x/server-dart/examples/project/update-apple-platform.md new file mode 100644 index 000000000..8feb3093f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-apple-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformApple result = await project.updateApplePlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + bundleIdentifier: '<BUNDLE_IDENTIFIER>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-auth-method.md b/examples/2.0.x/server-dart/examples/project/update-auth-method.md new file mode 100644 index 000000000..167c591a0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-auth-method.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateAuthMethod( + methodId: enums.ProjectAuthMethodId.emailPassword, + enabled: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-email-template.md b/examples/2.0.x/server-dart/examples/project/update-email-template.md new file mode 100644 index 000000000..15f0a8fa7 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-email-template.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +EmailTemplate result = await project.updateEmailTemplate( + templateId: enums.ProjectEmailTemplateId.verification, + locale: enums.ProjectEmailTemplateLocale.af, // (optional) + subject: '<SUBJECT>', // (optional) + message: '<MESSAGE>', // (optional) + senderName: '<SENDER_NAME>', // (optional) + senderEmail: 'email@example.com', // (optional) + replyToEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-key.md b/examples/2.0.x/server-dart/examples/project/update-key.md new file mode 100644 index 000000000..b15aa92f4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-key.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Key result = await project.updateKey( + keyId: '<KEY_ID>', + name: '<NAME>', + scopes: [enums.ProjectKeyScopes.projectRead], + expire: '2020-10-15T06:38:00.000+00:00', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-labels.md b/examples/2.0.x/server-dart/examples/project/update-labels.md new file mode 100644 index 000000000..ec1b51ce3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-labels.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateLabels( + labels: [], +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-linux-platform.md b/examples/2.0.x/server-dart/examples/project/update-linux-platform.md new file mode 100644 index 000000000..c93fe7a6a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-linux-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformLinux result = await project.updateLinuxPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageName: '<PACKAGE_NAME>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-dart/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..d1164b7ff --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateMembershipPrivacyPolicy( + userId: false, // (optional) + userEmail: false, // (optional) + userPhone: false, // (optional) + userName: false, // (optional) + userMFA: false, // (optional) + userAccessedAt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-dart/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..97e1bd661 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateMFAFactorsPolicy( + totp: false, // (optional) + email: false, // (optional) + phone: false, // (optional) + custom: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-mock-phone.md b/examples/2.0.x/server-dart/examples/project/update-mock-phone.md new file mode 100644 index 000000000..3f584d210 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-mock-phone.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +MockNumber result = await project.updateMockPhone( + number: '+12065550100', + otp: '<OTP>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..1821f5d89 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Amazon result = await project.updateOAuth2Amazon( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..06f506e59 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Apple result = await project.updateOAuth2Apple( + serviceId: '<SERVICE_ID>', // (optional) + keyId: '<KEY_ID>', // (optional) + teamId: '<TEAM_ID>', // (optional) + p8File: '<P8_FILE>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..54187ae55 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Appwrite result = await project.updateOAuth2Appwrite( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..e00a59761 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Auth0 result = await project.updateOAuth2Auth0( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + endpoint: '<ENDPOINT>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..734702733 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Authentik result = await project.updateOAuth2Authentik( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + endpoint: '<ENDPOINT>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..1273e6e4c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Autodesk result = await project.updateOAuth2Autodesk( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..2f9274a08 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Bitbucket result = await project.updateOAuth2Bitbucket( + key: '<KEY>', // (optional) + secret: '<SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..5f03c82e8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Bitly result = await project.updateOAuth2Bitly( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..b00ab7c58 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-box.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Box result = await project.updateOAuth2Box( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..a6a4201f9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Cloudflare result = await project.updateOAuth2Cloudflare( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..1117cf853 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Dailymotion result = await project.updateOAuth2Dailymotion( + apiKey: '<API_KEY>', // (optional) + apiSecret: '<API_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..7e06450d2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Discord result = await project.updateOAuth2Discord( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..42d62a827 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Disqus result = await project.updateOAuth2Disqus( + publicKey: '<PUBLIC_KEY>', // (optional) + secretKey: '<SECRET_KEY>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..200829125 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Dropbox result = await project.updateOAuth2Dropbox( + appKey: '<APP_KEY>', // (optional) + appSecret: '<APP_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..3e6118a1c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Etsy result = await project.updateOAuth2Etsy( + keyString: '<KEY_STRING>', // (optional) + sharedSecret: '<SHARED_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..48d282a98 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Facebook result = await project.updateOAuth2Facebook( + appId: '<APP_ID>', // (optional) + appSecret: '<APP_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..1b80d0e56 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Figma result = await project.updateOAuth2Figma( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..73c41171d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2FusionAuth result = await project.updateOAuth2FusionAuth( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + endpoint: '<ENDPOINT>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..e2830382e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Github result = await project.updateOAuth2GitHub( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..1d7418d95 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Gitlab result = await project.updateOAuth2Gitlab( + applicationId: '<APPLICATION_ID>', // (optional) + secret: '<SECRET>', // (optional) + endpoint: 'https://example.com', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..8c563f6bd --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-google.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Google result = await project.updateOAuth2Google( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + prompt: [enums.ProjectOAuth2GooglePrompt.none], // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..2a5bb5167 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2HuggingFace result = await project.updateOAuth2HuggingFace( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..b7195b82c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Keycloak result = await project.updateOAuth2Keycloak( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + endpoint: '<ENDPOINT>', // (optional) + realmName: '<REALM_NAME>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..5cfdf9a4a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Kick result = await project.updateOAuth2Kick( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..d69f1eaa3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Linkedin result = await project.updateOAuth2Linkedin( + clientId: '<CLIENT_ID>', // (optional) + primaryClientSecret: '<PRIMARY_CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..7f1aa6ca9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Microsoft result = await project.updateOAuth2Microsoft( + applicationId: '<APPLICATION_ID>', // (optional) + applicationSecret: '<APPLICATION_SECRET>', // (optional) + tenant: '<TENANT>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..ba723ccc5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Notion result = await project.updateOAuth2Notion( + oauthClientId: '<OAUTH_CLIENT_ID>', // (optional) + oauthClientSecret: '<OAUTH_CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..d2dc2d9da --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,23 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Oidc result = await project.updateOAuth2Oidc( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + wellKnownURL: 'https://example.com', // (optional) + authorizationURL: 'https://example.com', // (optional) + tokenURL: 'https://example.com', // (optional) + userInfoURL: 'https://example.com', // (optional) + prompt: [enums.ProjectOAuth2OidcPrompt.none], // (optional) + maxAge: 0, // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..cfd9f8cef --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Okta result = await project.updateOAuth2Okta( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + domain: 'example.com', // (optional) + authorizationServerId: '<AUTHORIZATION_SERVER_ID>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..eda05f5e6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Paypal result = await project.updateOAuth2PaypalSandbox( + clientId: '<CLIENT_ID>', // (optional) + secretKey: '<SECRET_KEY>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..120b58170 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Paypal result = await project.updateOAuth2Paypal( + clientId: '<CLIENT_ID>', // (optional) + secretKey: '<SECRET_KEY>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..9b5ee737b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Podio result = await project.updateOAuth2Podio( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..408f73874 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Resend result = await project.updateOAuth2Resend( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..6be026b45 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Salesforce result = await project.updateOAuth2Salesforce( + customerKey: '<CUSTOMER_KEY>', // (optional) + customerSecret: '<CUSTOMER_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..1032810c6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Slack result = await project.updateOAuth2Slack( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..8e7f98347 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Spotify result = await project.updateOAuth2Spotify( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..367466733 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Stripe result = await project.updateOAuth2Stripe( + clientId: '<CLIENT_ID>', // (optional) + apiSecretKey: '<API_SECRET_KEY>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..653abf6eb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Tradeshift result = await project.updateOAuth2TradeshiftSandbox( + oauth2ClientId: '<OAUTH2_CLIENT_ID>', // (optional) + oauth2ClientSecret: '<OAUTH2_CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..1e780bfc0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Tradeshift result = await project.updateOAuth2Tradeshift( + oauth2ClientId: '<OAUTH2_CLIENT_ID>', // (optional) + oauth2ClientSecret: '<OAUTH2_CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..93d29acdc --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Twitch result = await project.updateOAuth2Twitch( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..32e3495a3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2WordPress result = await project.updateOAuth2WordPress( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..f08d50749 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Yahoo result = await project.updateOAuth2Yahoo( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..4106fe67b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Yandex result = await project.updateOAuth2Yandex( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..69d44d8a2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Zoho result = await project.updateOAuth2Zoho( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..d91ddcbde --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2Zoom result = await project.updateOAuth2Zoom( + clientId: '<CLIENT_ID>', // (optional) + clientSecret: '<CLIENT_SECRET>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-dart/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..bf7e5f622 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-o-auth-2x.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +OAuth2X result = await project.updateOAuth2X( + customerKey: '<CUSTOMER_KEY>', // (optional) + secretKey: '<SECRET_KEY>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-dart/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..9d07cff39 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updatePasswordDictionaryPolicy( + enabled: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-password-history-policy.md b/examples/2.0.x/server-dart/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..2d5ca13e3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-password-history-policy.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updatePasswordHistoryPolicy( + total: 1, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-dart/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..51680b7d5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updatePasswordPersonalDataPolicy( + enabled: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-dart/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..eca34320a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-password-strength-policy.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PolicyPasswordStrength result = await project.updatePasswordStrengthPolicy( + min: 8, // (optional) + uppercase: false, // (optional) + lowercase: false, // (optional) + number: false, // (optional) + symbols: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-protocol.md b/examples/2.0.x/server-dart/examples/project/update-protocol.md new file mode 100644 index 000000000..261273d65 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-protocol.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateProtocol( + protocolId: enums.ProjectProtocolId.rest, + enabled: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-service.md b/examples/2.0.x/server-dart/examples/project/update-service.md new file mode 100644 index 000000000..2d4f71526 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-service.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateService( + serviceId: enums.ProjectServiceId.account, + enabled: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-dart/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..a3d892f02 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-session-alert-policy.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateSessionAlertPolicy( + enabled: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-dart/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..b5a0e4cf4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-session-duration-policy.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateSessionDurationPolicy( + duration: 60, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-dart/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..e38b5180d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateSessionInvalidationPolicy( + enabled: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-dart/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..8726970e7 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-session-limit-policy.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateSessionLimitPolicy( + total: 1, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-smtp.md b/examples/2.0.x/server-dart/examples/project/update-smtp.md new file mode 100644 index 000000000..c1d414775 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-smtp.md @@ -0,0 +1,24 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateSMTP( + host: 'example.com', // (optional) + port: 587, // (optional) + username: '<USERNAME>', // (optional) + password: 'password', // (optional) + senderEmail: 'email@example.com', // (optional) + senderName: '<SENDER_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + secure: enums.ProjectSMTPSecure.tls, // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-dart/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..cbbdeb42f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-user-limit-policy.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Project result = await project.updateUserLimitPolicy( + total: 0, +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-variable.md b/examples/2.0.x/server-dart/examples/project/update-variable.md new file mode 100644 index 000000000..eef236d53 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-variable.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +Variable result = await project.updateVariable( + variableId: '<VARIABLE_ID>', + key: '<KEY>', // (optional) + value: '<VALUE>', // (optional) + secret: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-web-platform.md b/examples/2.0.x/server-dart/examples/project/update-web-platform.md new file mode 100644 index 000000000..5de1cdc9c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-web-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformWeb result = await project.updateWebPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com', +); +``` diff --git a/examples/2.0.x/server-dart/examples/project/update-windows-platform.md b/examples/2.0.x/server-dart/examples/project/update-windows-platform.md new file mode 100644 index 000000000..306d00248 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/project/update-windows-platform.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Project project = Project(client); + +PlatformWindows result = await project.updateWindowsPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageIdentifierName: '<PACKAGE_IDENTIFIER_NAME>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/proxy/create-api-rule.md b/examples/2.0.x/server-dart/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..a0a161505 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/proxy/create-api-rule.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Proxy proxy = Proxy(client); + +ProxyRule result = await proxy.createAPIRule( + domain: 'example.com', +); +``` diff --git a/examples/2.0.x/server-dart/examples/proxy/create-function-rule.md b/examples/2.0.x/server-dart/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..10bf38a2f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/proxy/create-function-rule.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Proxy proxy = Proxy(client); + +ProxyRule result = await proxy.createFunctionRule( + domain: 'example.com', + functionId: '<FUNCTION_ID>', + branch: '<BRANCH>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-dart/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..348390630 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/proxy/create-redirect-rule.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Proxy proxy = Proxy(client); + +ProxyRule result = await proxy.createRedirectRule( + domain: 'example.com', + url: 'https://example.com', + statusCode: enums.StatusCode.movedPermanently, + resourceId: '<RESOURCE_ID>', + resourceType: enums.ProxyResourceType.site, +); +``` diff --git a/examples/2.0.x/server-dart/examples/proxy/create-site-rule.md b/examples/2.0.x/server-dart/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..872ba3578 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/proxy/create-site-rule.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Proxy proxy = Proxy(client); + +ProxyRule result = await proxy.createSiteRule( + domain: 'example.com', + siteId: '<SITE_ID>', + branch: '<BRANCH>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/proxy/delete-rule.md b/examples/2.0.x/server-dart/examples/proxy/delete-rule.md new file mode 100644 index 000000000..6829f2a1f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/proxy/delete-rule.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Proxy proxy = Proxy(client); + +await proxy.deleteRule( + ruleId: '<RULE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/proxy/get-rule.md b/examples/2.0.x/server-dart/examples/proxy/get-rule.md new file mode 100644 index 000000000..6ade16472 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/proxy/get-rule.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Proxy proxy = Proxy(client); + +ProxyRule result = await proxy.getRule( + ruleId: '<RULE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/proxy/list-rules.md b/examples/2.0.x/server-dart/examples/proxy/list-rules.md new file mode 100644 index 000000000..29931d1d3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/proxy/list-rules.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Proxy proxy = Proxy(client); + +ProxyRuleList result = await proxy.listRules( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/proxy/update-rule-status.md b/examples/2.0.x/server-dart/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..00c62dffa --- /dev/null +++ b/examples/2.0.x/server-dart/examples/proxy/update-rule-status.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Proxy proxy = Proxy(client); + +ProxyRule result = await proxy.updateRuleStatus( + ruleId: '<RULE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/create-deployment.md b/examples/2.0.x/server-dart/examples/sites/create-deployment.md new file mode 100644 index 000000000..261c04fe9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/create-deployment.md @@ -0,0 +1,20 @@ +```dart +import 'dart:io'; +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createDeployment( + siteId: '<SITE_ID>', + code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + installCommand: '<INSTALL_COMMAND>', // (optional) + buildCommand: '<BUILD_COMMAND>', // (optional) + outputDirectory: '<OUTPUT_DIRECTORY>', // (optional) + activate: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-dart/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..6844d143c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createDuplicateDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/create-template-deployment.md b/examples/2.0.x/server-dart/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..a0d9004e2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/create-template-deployment.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createTemplateDeployment( + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + type: enums.TemplateReferenceType.branch, + reference: '<REFERENCE>', + activate: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/create-variable.md b/examples/2.0.x/server-dart/examples/sites/create-variable.md new file mode 100644 index 000000000..0144bec00 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/create-variable.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.createVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-dart/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..a4fe7f8db --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/create-vcs-deployment.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createVcsDeployment( + siteId: '<SITE_ID>', + type: enums.VCSReferenceType.branch, + reference: '<REFERENCE>', + activate: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/create.md b/examples/2.0.x/server-dart/examples/sites/create.md new file mode 100644 index 000000000..a1c617a38 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/create.md @@ -0,0 +1,38 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.create( + siteId: '<SITE_ID>', + name: '<NAME>', + framework: enums.Framework.analog, + buildRuntime: enums.BuildRuntime.node145, + enabled: false, // (optional) + logging: false, // (optional) + timeout: 1, // (optional) + installCommand: '<INSTALL_COMMAND>', // (optional) + buildCommand: '<BUILD_COMMAND>', // (optional) + startCommand: '<START_COMMAND>', // (optional) + outputDirectory: '<OUTPUT_DIRECTORY>', // (optional) + adapter: enums.Adapter.static, // (optional) + installationId: '<INSTALLATION_ID>', // (optional) + fallbackFile: '<FALLBACK_FILE>', // (optional) + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional) + providerBranch: '<PROVIDER_BRANCH>', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional) + providerBranches: [], // (optional) + providerPaths: [], // (optional) + buildSpecification: 's-1vcpu-512mb', // (optional) + runtimeSpecification: 's-1vcpu-512mb', // (optional) + deploymentRetention: 0, // (optional) + scopes: [enums.ProjectKeyScopes.projectRead], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/delete-deployment.md b/examples/2.0.x/server-dart/examples/sites/delete-deployment.md new file mode 100644 index 000000000..0a847f0a0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/delete-deployment.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/delete-log.md b/examples/2.0.x/server-dart/examples/sites/delete-log.md new file mode 100644 index 000000000..93b7d29a1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/delete-log.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteLog( + siteId: '<SITE_ID>', + logId: '<LOG_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/delete-variable.md b/examples/2.0.x/server-dart/examples/sites/delete-variable.md new file mode 100644 index 000000000..46caceb2d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/delete-variable.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/delete.md b/examples/2.0.x/server-dart/examples/sites/delete.md new file mode 100644 index 000000000..059e1dbd6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +await sites.delete( + siteId: '<SITE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/get-deployment-download.md b/examples/2.0.x/server-dart/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..412817491 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/get-deployment-download.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Uint8List result = await sites.getDeploymentDownload( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: enums.DeploymentDownloadType.source, // (optional) + token: '<TOKEN>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/get-deployment.md b/examples/2.0.x/server-dart/examples/sites/get-deployment.md new file mode 100644 index 000000000..baaae7e75 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/get-deployment.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.getDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/get-log.md b/examples/2.0.x/server-dart/examples/sites/get-log.md new file mode 100644 index 000000000..b7e12b992 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/get-log.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Execution result = await sites.getLog( + siteId: '<SITE_ID>', + logId: '<LOG_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/get-variable.md b/examples/2.0.x/server-dart/examples/sites/get-variable.md new file mode 100644 index 000000000..6da082bef --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/get-variable.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.getVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/get.md b/examples/2.0.x/server-dart/examples/sites/get.md new file mode 100644 index 000000000..148689b73 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.get( + siteId: '<SITE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/list-deployments.md b/examples/2.0.x/server-dart/examples/sites/list-deployments.md new file mode 100644 index 000000000..eef8e7d64 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/list-deployments.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +DeploymentList result = await sites.listDeployments( + siteId: '<SITE_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/list-frameworks.md b/examples/2.0.x/server-dart/examples/sites/list-frameworks.md new file mode 100644 index 000000000..b3e9bd8b0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/list-frameworks.md @@ -0,0 +1,12 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +FrameworkList result = await sites.listFrameworks(); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/list-logs.md b/examples/2.0.x/server-dart/examples/sites/list-logs.md new file mode 100644 index 000000000..a95b29ac6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/list-logs.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +ExecutionList result = await sites.listLogs( + siteId: '<SITE_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/list-specifications.md b/examples/2.0.x/server-dart/examples/sites/list-specifications.md new file mode 100644 index 000000000..7c80f2aad --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/list-specifications.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +SpecificationList result = await sites.listSpecifications( + type: 'runtimes', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/list-variables.md b/examples/2.0.x/server-dart/examples/sites/list-variables.md new file mode 100644 index 000000000..2f226ed6f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/list-variables.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +VariableList result = await sites.listVariables( + siteId: '<SITE_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/list.md b/examples/2.0.x/server-dart/examples/sites/list.md new file mode 100644 index 000000000..a9860af6d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +SiteList result = await sites.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/update-deployment-status.md b/examples/2.0.x/server-dart/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..01a22596e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/update-deployment-status.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.updateDeploymentStatus( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/update-site-deployment.md b/examples/2.0.x/server-dart/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..6139981e8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/update-site-deployment.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.updateSiteDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/update-variable.md b/examples/2.0.x/server-dart/examples/sites/update-variable.md new file mode 100644 index 000000000..24a135ead --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/update-variable.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.updateVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', // (optional) + value: '<VALUE>', // (optional) + secret: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/sites/update.md b/examples/2.0.x/server-dart/examples/sites/update.md new file mode 100644 index 000000000..44a1b3abd --- /dev/null +++ b/examples/2.0.x/server-dart/examples/sites/update.md @@ -0,0 +1,38 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.update( + siteId: '<SITE_ID>', + name: '<NAME>', + framework: enums.Framework.analog, + enabled: false, // (optional) + logging: false, // (optional) + timeout: 1, // (optional) + installCommand: '<INSTALL_COMMAND>', // (optional) + buildCommand: '<BUILD_COMMAND>', // (optional) + startCommand: '<START_COMMAND>', // (optional) + outputDirectory: '<OUTPUT_DIRECTORY>', // (optional) + buildRuntime: enums.BuildRuntime.node145, // (optional) + adapter: enums.Adapter.static, // (optional) + fallbackFile: '<FALLBACK_FILE>', // (optional) + installationId: '<INSTALLATION_ID>', // (optional) + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional) + providerBranch: '<PROVIDER_BRANCH>', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional) + providerBranches: [], // (optional) + providerPaths: [], // (optional) + buildSpecification: 's-1vcpu-512mb', // (optional) + runtimeSpecification: 's-1vcpu-512mb', // (optional) + deploymentRetention: 0, // (optional) + scopes: [enums.ProjectKeyScopes.projectRead], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/create-bucket.md b/examples/2.0.x/server-dart/examples/storage/create-bucket.md new file mode 100644 index 000000000..6f634a984 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/create-bucket.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +Bucket result = await storage.createBucket( + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // (optional) + fileSecurity: false, // (optional) + enabled: false, // (optional) + maximumFileSize: 1, // (optional) + allowedFileExtensions: [], // (optional) + compression: enums.Compression.none, // (optional) + encryption: false, // (optional) + antivirus: false, // (optional) + transformations: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/create-file.md b/examples/2.0.x/server-dart/examples/storage/create-file.md new file mode 100644 index 000000000..d0fae4cb8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/create-file.md @@ -0,0 +1,21 @@ +```dart +import 'dart:io'; +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +File result = await storage.createFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + permissions: [Permission.read(Role.any())], // (optional) + folder: 'photos/2026', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/delete-bucket.md b/examples/2.0.x/server-dart/examples/storage/delete-bucket.md new file mode 100644 index 000000000..041612f86 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/delete-bucket.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +await storage.deleteBucket( + bucketId: '<BUCKET_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/delete-file.md b/examples/2.0.x/server-dart/examples/storage/delete-file.md new file mode 100644 index 000000000..b52b5f918 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/delete-file.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +await storage.deleteFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/get-bucket.md b/examples/2.0.x/server-dart/examples/storage/get-bucket.md new file mode 100644 index 000000000..e5e2ed721 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/get-bucket.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +Bucket result = await storage.getBucket( + bucketId: '<BUCKET_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/get-file-download.md b/examples/2.0.x/server-dart/examples/storage/get-file-download.md new file mode 100644 index 000000000..3eefb650e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/get-file-download.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +Uint8List result = await storage.getFileDownload( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/get-file-preview.md b/examples/2.0.x/server-dart/examples/storage/get-file-preview.md new file mode 100644 index 000000000..6359990da --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/get-file-preview.md @@ -0,0 +1,28 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +Uint8List result = await storage.getFilePreview( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // (optional) + height: 0, // (optional) + gravity: enums.ImageGravity.center, // (optional) + quality: -1, // (optional) + borderWidth: 0, // (optional) + borderColor: 'FFFFFF', // (optional) + borderRadius: 0, // (optional) + opacity: 0, // (optional) + rotation: -360, // (optional) + background: 'FFFFFF', // (optional) + output: enums.ImageFormat.jpg, // (optional) + token: '<TOKEN>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/get-file-view.md b/examples/2.0.x/server-dart/examples/storage/get-file-view.md new file mode 100644 index 000000000..63cd86995 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/get-file-view.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +Uint8List result = await storage.getFileView( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/get-file.md b/examples/2.0.x/server-dart/examples/storage/get-file.md new file mode 100644 index 000000000..bc5272c54 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/get-file.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +File result = await storage.getFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/list-buckets.md b/examples/2.0.x/server-dart/examples/storage/list-buckets.md new file mode 100644 index 000000000..0b76ac287 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/list-buckets.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +BucketList result = await storage.listBuckets( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/list-files.md b/examples/2.0.x/server-dart/examples/storage/list-files.md new file mode 100644 index 000000000..ad417224e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/list-files.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +FileList result = await storage.listFiles( + bucketId: '<BUCKET_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/update-bucket.md b/examples/2.0.x/server-dart/examples/storage/update-bucket.md new file mode 100644 index 000000000..c796c34c0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/update-bucket.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +Bucket result = await storage.updateBucket( + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // (optional) + fileSecurity: false, // (optional) + enabled: false, // (optional) + maximumFileSize: 1, // (optional) + allowedFileExtensions: [], // (optional) + compression: enums.Compression.none, // (optional) + encryption: false, // (optional) + antivirus: false, // (optional) + transformations: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/storage/update-file.md b/examples/2.0.x/server-dart/examples/storage/update-file.md new file mode 100644 index 000000000..4b3c3ac86 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/storage/update-file.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +File result = await storage.updateFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // (optional) + permissions: [Permission.read(Role.any())], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..ff23c3a73 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnBigint result = await tablesDB.createBigIntColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + min: 0, // (optional) + max: 1000000, // (optional) + xdefault: 0, // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..d1ed05b80 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnBoolean result = await tablesDB.createBooleanColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: false, // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..99107f148 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnDatetime result = await tablesDB.createDatetimeColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: '2020-10-15T06:38:00.000+00:00', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..00e6d3f00 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-email-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnEmail result = await tablesDB.createEmailColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'email@example.com', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..079a774d4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-enum-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnEnum result = await tablesDB.createEnumColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + xrequired: false, + xdefault: 'active', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..a6432000b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-float-column.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnFloat result = await tablesDB.createFloatColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + min: 0, // (optional) + max: 100, // (optional) + xdefault: 10.5, // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-index.md b/examples/2.0.x/server-dart/examples/tablesdb/create-index.md new file mode 100644 index 000000000..97f2e23a4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-index.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIndex result = await tablesDB.createIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + type: enums.TablesDBIndexType.key, + columns: [], + orders: [enums.OrderBy.asc], // (optional) + lengths: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..8f1e2cdd4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-integer-column.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnInteger result = await tablesDB.createIntegerColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + min: 0, // (optional) + max: 100, // (optional) + xdefault: 10, // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..16d38c7bb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-ip-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIp result = await tablesDB.createIpColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: '192.0.2.0', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..3c38760b9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-line-column.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnLine result = await tablesDB.createLineColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..36b7b2aa9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnLongtext result = await tablesDB.createLongtextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..3c26f6e82 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnMediumtext result = await tablesDB.createMediumtextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-operations.md b/examples/2.0.x/server-dart/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..359982dad --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-operations.md @@ -0,0 +1,25 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Transaction result = await tablesDB.createOperations( + transactionId: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..6615ef21b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-point-column.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnPoint result = await tablesDB.createPointColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [1, 2], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..9036a1950 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnPolygon result = await tablesDB.createPolygonColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..4a7a0754a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnRelationship result = await tablesDB.createRelationshipColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: enums.RelationshipType.oneToOne, + twoWay: false, // (optional) + key: '<KEY>', // (optional) + twoWayKey: '<TWO_WAY_KEY>', // (optional) + onDelete: enums.RelationMutate.cascade, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-row.md b/examples/2.0.x/server-dart/examples/tablesdb/create-row.md new file mode 100644 index 000000000..589d98ff1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-row.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.createRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-rows.md b/examples/2.0.x/server-dart/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..afa7629da --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-rows.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.createRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..d410af1ec --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-string-column.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnString result = await tablesDB.createStringColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + size: 1, + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-table.md b/examples/2.0.x/server-dart/examples/tablesdb/create-table.md new file mode 100644 index 000000000..e4563135c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-table.md @@ -0,0 +1,23 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Table result = await tablesDB.createTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], // (optional) + rowSecurity: false, // (optional) + enabled: false, // (optional) + columns: [], // (optional) + indexes: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..d26dc60e1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-text-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnText result = await tablesDB.createTextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-dart/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..bb779b8c2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Transaction result = await tablesDB.createTransaction( + ttl: 60, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..d7de58691 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-url-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnUrl result = await tablesDB.createUrlColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'https://example.com', // (optional) + array: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-dart/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..57a5037ec --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnVarchar result = await tablesDB.createVarcharColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + size: 1, + xrequired: false, + xdefault: 'Hello World', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/create.md b/examples/2.0.x/server-dart/examples/tablesdb/create.md new file mode 100644 index 000000000..3c85e98f5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/create.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Database result = await tablesDB.create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-dart/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..74657b6f4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.decrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '<COLUMN>', + value: 1, // (optional) + min: 0, // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/delete-column.md b/examples/2.0.x/server-dart/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..ffa574ba1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/delete-column.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/delete-index.md b/examples/2.0.x/server-dart/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..96587d18a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/delete-index.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/delete-row.md b/examples/2.0.x/server-dart/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..1cf058fd5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/delete-row.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-dart/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..443aee01f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/delete-rows.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/delete-table.md b/examples/2.0.x/server-dart/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..046c8c941 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/delete-table.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-dart/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..18bdc902b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/delete-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteTransaction( + transactionId: '<TRANSACTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/delete.md b/examples/2.0.x/server-dart/examples/tablesdb/delete.md new file mode 100644 index 000000000..7001ddaa8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.delete( + databaseId: '<DATABASE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/get-column.md b/examples/2.0.x/server-dart/examples/tablesdb/get-column.md new file mode 100644 index 000000000..0fa363285 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/get-column.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +dynamic result = await tablesDB.getColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/get-index.md b/examples/2.0.x/server-dart/examples/tablesdb/get-index.md new file mode 100644 index 000000000..517559d49 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/get-index.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIndex result = await tablesDB.getIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/get-row.md b/examples/2.0.x/server-dart/examples/tablesdb/get-row.md new file mode 100644 index 000000000..11a7d67b8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/get-row.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.getRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/get-table.md b/examples/2.0.x/server-dart/examples/tablesdb/get-table.md new file mode 100644 index 000000000..81eed7f1b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/get-table.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Table result = await tablesDB.getTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-dart/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..ffe133298 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/get-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Transaction result = await tablesDB.getTransaction( + transactionId: '<TRANSACTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/get.md b/examples/2.0.x/server-dart/examples/tablesdb/get.md new file mode 100644 index 000000000..24412ad11 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Database result = await tablesDB.get( + databaseId: '<DATABASE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-dart/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..0a17c6060 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/increment-row-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.incrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '<COLUMN>', + value: 1, // (optional) + max: 100, // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/list-columns.md b/examples/2.0.x/server-dart/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..7c2200768 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/list-columns.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnList result = await tablesDB.listColumns( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-dart/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..669bbb3a2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/list-indexes.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIndexList result = await tablesDB.listIndexes( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/list-rows.md b/examples/2.0.x/server-dart/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..863e461ee --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/list-rows.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.listRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) + total: false, // (optional) + ttl: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/list-tables.md b/examples/2.0.x/server-dart/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..b640527ba --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/list-tables.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +TableList result = await tablesDB.listTables( + databaseId: '<DATABASE_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-dart/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..fa4782b5b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/list-transactions.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +TransactionList result = await tablesDB.listTransactions( + queries: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/list.md b/examples/2.0.x/server-dart/examples/tablesdb/list.md new file mode 100644 index 000000000..ef6722782 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +DatabaseList result = await tablesDB.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..3638e5b5e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnBigint result = await tablesDB.updateBigIntColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 0, + min: 0, // (optional) + max: 1000000, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..f282f134d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnBoolean result = await tablesDB.updateBooleanColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: false, + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..5f40545fd --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnDatetime result = await tablesDB.updateDatetimeColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: '2020-10-15T06:38:00.000+00:00', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..8f9bc613b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-email-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnEmail result = await tablesDB.updateEmailColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'email@example.com', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..8e2ed4e42 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-enum-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnEnum result = await tablesDB.updateEnumColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + xrequired: false, + xdefault: 'active', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..9cdc6670d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-float-column.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnFloat result = await tablesDB.updateFloatColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 10.5, + min: 0, // (optional) + max: 100, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..9264c25b8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-integer-column.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnInteger result = await tablesDB.updateIntegerColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 10, + min: 0, // (optional) + max: 100, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..df4368e9b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-ip-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIp result = await tablesDB.updateIpColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: '192.0.2.0', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..beadc457b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-line-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnLine result = await tablesDB.updateLineColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..3cce90f78 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnLongtext result = await tablesDB.updateLongtextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..833043c19 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnMediumtext result = await tablesDB.updateMediumtextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..0d970da99 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-point-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnPoint result = await tablesDB.updatePointColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [1, 2], // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..c19b82729 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnPolygon result = await tablesDB.updatePolygonColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..60008cb79 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnRelationship result = await tablesDB.updateRelationshipColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + onDelete: enums.RelationMutate.cascade, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-row.md b/examples/2.0.x/server-dart/examples/tablesdb/update-row.md new file mode 100644 index 000000000..514f740b5 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-row.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.updateRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-rows.md b/examples/2.0.x/server-dart/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..3d3730bce --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-rows.md @@ -0,0 +1,24 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.updateRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // (optional) + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..80c0a6be3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-string-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnString result = await tablesDB.updateStringColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + size: 1, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-table.md b/examples/2.0.x/server-dart/examples/tablesdb/update-table.md new file mode 100644 index 000000000..217da3f41 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-table.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Table result = await tablesDB.updateTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', // (optional) + permissions: [Permission.read(Role.any())], // (optional) + rowSecurity: false, // (optional) + enabled: false, // (optional) + purge: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..6cb0f7ce8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-text-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnText result = await tablesDB.updateTextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-dart/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..fbcafc8ab --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-transaction.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Transaction result = await tablesDB.updateTransaction( + transactionId: '<TRANSACTION_ID>', + commit: false, // (optional) + rollback: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..98b4be9fa --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-url-column.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnUrl result = await tablesDB.updateUrlColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'https://example.com', + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-dart/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..b9b7cce4e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnVarchar result = await tablesDB.updateVarcharColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + xrequired: false, + xdefault: 'Hello World', + size: 1, // (optional) + newKey: '<NEW_KEY>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/update.md b/examples/2.0.x/server-dart/examples/tablesdb/update.md new file mode 100644 index 000000000..ad85b595f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/update.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Database result = await tablesDB.update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-dart/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..21f2734b2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/upsert-row.md @@ -0,0 +1,27 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.upsertRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-dart/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..a457f5e88 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tablesdb/upsert-rows.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.upsertRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/create-membership.md b/examples/2.0.x/server-dart/examples/teams/create-membership.md new file mode 100644 index 000000000..8f95362a7 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/create-membership.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Membership result = await teams.createMembership( + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // (optional) + userId: '<USER_ID>', // (optional) + phone: '+12065550100', // (optional) + url: 'https://example.com', // (optional) + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/create.md b/examples/2.0.x/server-dart/examples/teams/create.md new file mode 100644 index 000000000..61bb5daa3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/create.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Team result = await teams.create( + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/delete-membership.md b/examples/2.0.x/server-dart/examples/teams/delete-membership.md new file mode 100644 index 000000000..5c63224f6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/delete-membership.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +await teams.deleteMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/delete.md b/examples/2.0.x/server-dart/examples/teams/delete.md new file mode 100644 index 000000000..8cb4181a0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +await teams.delete( + teamId: '<TEAM_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/get-membership.md b/examples/2.0.x/server-dart/examples/teams/get-membership.md new file mode 100644 index 000000000..b7a8200a8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/get-membership.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Membership result = await teams.getMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/get-prefs.md b/examples/2.0.x/server-dart/examples/teams/get-prefs.md new file mode 100644 index 000000000..482390cf6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/get-prefs.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Preferences result = await teams.getPrefs( + teamId: '<TEAM_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/get.md b/examples/2.0.x/server-dart/examples/teams/get.md new file mode 100644 index 000000000..cd426afcb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Team result = await teams.get( + teamId: '<TEAM_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/list-memberships.md b/examples/2.0.x/server-dart/examples/teams/list-memberships.md new file mode 100644 index 000000000..2f6400d9a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/list-memberships.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +MembershipList result = await teams.listMemberships( + teamId: '<TEAM_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/list.md b/examples/2.0.x/server-dart/examples/teams/list.md new file mode 100644 index 000000000..b056968ec --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +TeamList result = await teams.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/update-membership-status.md b/examples/2.0.x/server-dart/examples/teams/update-membership-status.md new file mode 100644 index 000000000..a5ec5e1c0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/update-membership-status.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Membership result = await teams.updateMembershipStatus( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/update-membership.md b/examples/2.0.x/server-dart/examples/teams/update-membership.md new file mode 100644 index 000000000..961def983 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/update-membership.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Membership result = await teams.updateMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [], +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/update-name.md b/examples/2.0.x/server-dart/examples/teams/update-name.md new file mode 100644 index 000000000..84069773e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/update-name.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Team result = await teams.updateName( + teamId: '<TEAM_ID>', + name: '<NAME>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/teams/update-prefs.md b/examples/2.0.x/server-dart/examples/teams/update-prefs.md new file mode 100644 index 000000000..e51b2da05 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/teams/update-prefs.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Preferences result = await teams.updatePrefs( + teamId: '<TEAM_ID>', + prefs: {}, +); +``` diff --git a/examples/2.0.x/server-dart/examples/tokens/create-file-token.md b/examples/2.0.x/server-dart/examples/tokens/create-file-token.md new file mode 100644 index 000000000..5348736a2 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tokens/create-file-token.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.createFileToken( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '2020-10-15T06:38:00.000+00:00', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tokens/delete.md b/examples/2.0.x/server-dart/examples/tokens/delete.md new file mode 100644 index 000000000..b5541b0e3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tokens/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +await tokens.delete( + tokenId: '<TOKEN_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tokens/get.md b/examples/2.0.x/server-dart/examples/tokens/get.md new file mode 100644 index 000000000..53bbd181e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tokens/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.get( + tokenId: '<TOKEN_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/tokens/list.md b/examples/2.0.x/server-dart/examples/tokens/list.md new file mode 100644 index 000000000..17fb2ff80 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tokens/list.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceTokenList result = await tokens.list( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/tokens/update.md b/examples/2.0.x/server-dart/examples/tokens/update.md new file mode 100644 index 000000000..6c0eb572a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/tokens/update.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.update( + tokenId: '<TOKEN_ID>', + expire: '2020-10-15T06:38:00.000+00:00', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-argon-2-user.md b/examples/2.0.x/server-dart/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..2cddf2fa6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-argon-2-user.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createArgon2User( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-dart/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..ca5bdf564 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-bcrypt-user.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createBcryptUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-jwt.md b/examples/2.0.x/server-dart/examples/users/create-jwt.md new file mode 100644 index 000000000..42b174b77 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-jwt.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Jwt result = await users.createJWT( + userId: '<USER_ID>', + sessionId: 'recent()', // (optional) + duration: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-md-5-user.md b/examples/2.0.x/server-dart/examples/users/create-md-5-user.md new file mode 100644 index 000000000..490b26a6e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-md-5-user.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createMD5User( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-dart/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..9251cb504 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaRecoveryCodes result = await users.createMFARecoveryCodes( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-dart/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..74105bcf3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-ph-pass-user.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createPHPassUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-dart/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..5c6301854 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createScryptModifiedUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-scrypt-user.md b/examples/2.0.x/server-dart/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..66d495218 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-scrypt-user.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createScryptUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-session.md b/examples/2.0.x/server-dart/examples/users/create-session.md new file mode 100644 index 000000000..f782dbefe --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-session.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Session result = await users.createSession( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-sha-user.md b/examples/2.0.x/server-dart/examples/users/create-sha-user.md new file mode 100644 index 000000000..65adca609 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-sha-user.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createSHAUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: enums.PasswordHash.sha1, // (optional) + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-target.md b/examples/2.0.x/server-dart/examples/users/create-target.md new file mode 100644 index 000000000..ea9c4014a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-target.md @@ -0,0 +1,20 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Target result = await users.createTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: enums.MessagingProviderType.email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // (optional) + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create-token.md b/examples/2.0.x/server-dart/examples/users/create-token.md new file mode 100644 index 000000000..c79c21cc6 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create-token.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Token result = await users.createToken( + userId: '<USER_ID>', + length: 4, // (optional) + expire: 60, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/create.md b/examples/2.0.x/server-dart/examples/users/create.md new file mode 100644 index 000000000..1bbccb8ce --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/create.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.create( + userId: '<USER_ID>', + email: 'email@example.com', // (optional) + phone: '+12065550100', // (optional) + password: 'password', // (optional) + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/delete-identity.md b/examples/2.0.x/server-dart/examples/users/delete-identity.md new file mode 100644 index 000000000..6ec6cfa81 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/delete-identity.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteIdentity( + identityId: '<IDENTITY_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-dart/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..d33dd5f7d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteMFAAuthenticator( + userId: '<USER_ID>', + type: enums.AuthenticatorType.totp, +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/delete-session.md b/examples/2.0.x/server-dart/examples/users/delete-session.md new file mode 100644 index 000000000..d5555502f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/delete-session.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteSession( + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/delete-sessions.md b/examples/2.0.x/server-dart/examples/users/delete-sessions.md new file mode 100644 index 000000000..cb84cac70 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/delete-sessions.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteSessions( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/delete-target.md b/examples/2.0.x/server-dart/examples/users/delete-target.md new file mode 100644 index 000000000..86ade933f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/delete-target.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/delete.md b/examples/2.0.x/server-dart/examples/users/delete.md new file mode 100644 index 000000000..a10942744 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.delete( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-dart/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..0738433dc --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/get-mfa-challenge.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaChallengeSecret result = await users.getMFAChallenge( + userId: '<USER_ID>', + challengeId: '<CHALLENGE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-dart/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..72fb5b9eb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaRecoveryCodes result = await users.getMFARecoveryCodes( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/get-prefs.md b/examples/2.0.x/server-dart/examples/users/get-prefs.md new file mode 100644 index 000000000..c8f314c6f --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/get-prefs.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Preferences result = await users.getPrefs( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/get-target.md b/examples/2.0.x/server-dart/examples/users/get-target.md new file mode 100644 index 000000000..f765ada56 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/get-target.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Target result = await users.getTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/get.md b/examples/2.0.x/server-dart/examples/users/get.md new file mode 100644 index 000000000..1ce98396b --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.get( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/list-identities.md b/examples/2.0.x/server-dart/examples/users/list-identities.md new file mode 100644 index 000000000..a6d570f1e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/list-identities.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +IdentityList result = await users.listIdentities( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/list-memberships.md b/examples/2.0.x/server-dart/examples/users/list-memberships.md new file mode 100644 index 000000000..b6b7f7cac --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/list-memberships.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MembershipList result = await users.listMemberships( + userId: '<USER_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/list-mfa-factors.md b/examples/2.0.x/server-dart/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..f8b1db82c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/list-mfa-factors.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaFactors result = await users.listMFAFactors( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/list-sessions.md b/examples/2.0.x/server-dart/examples/users/list-sessions.md new file mode 100644 index 000000000..abbf7932c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/list-sessions.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +SessionList result = await users.listSessions( + userId: '<USER_ID>', + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/list-targets.md b/examples/2.0.x/server-dart/examples/users/list-targets.md new file mode 100644 index 000000000..3014b8de1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/list-targets.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +TargetList result = await users.listTargets( + userId: '<USER_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/list.md b/examples/2.0.x/server-dart/examples/users/list.md new file mode 100644 index 000000000..bb00e0cfe --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +UserList result = await users.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-email-verification.md b/examples/2.0.x/server-dart/examples/users/update-email-verification.md new file mode 100644 index 000000000..636afc107 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-email-verification.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateEmailVerification( + userId: '<USER_ID>', + emailVerification: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-email.md b/examples/2.0.x/server-dart/examples/users/update-email.md new file mode 100644 index 000000000..0bd3d61e1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-email.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateEmail( + userId: '<USER_ID>', + email: 'email@example.com', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-impersonator.md b/examples/2.0.x/server-dart/examples/users/update-impersonator.md new file mode 100644 index 000000000..6d1d96452 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-impersonator.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateImpersonator( + userId: '<USER_ID>', + impersonator: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-labels.md b/examples/2.0.x/server-dart/examples/users/update-labels.md new file mode 100644 index 000000000..efbf657d3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-labels.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateLabels( + userId: '<USER_ID>', + labels: [], +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-dart/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..a08fc361d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaRecoveryCodes result = await users.updateMFARecoveryCodes( + userId: '<USER_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-mfa.md b/examples/2.0.x/server-dart/examples/users/update-mfa.md new file mode 100644 index 000000000..cd67922e9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-mfa.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateMFA( + userId: '<USER_ID>', + mfa: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-name.md b/examples/2.0.x/server-dart/examples/users/update-name.md new file mode 100644 index 000000000..4a67672d4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-name.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateName( + userId: '<USER_ID>', + name: '<NAME>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-password.md b/examples/2.0.x/server-dart/examples/users/update-password.md new file mode 100644 index 000000000..4968bae42 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-password.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updatePassword( + userId: '<USER_ID>', + password: 'password', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-phone-verification.md b/examples/2.0.x/server-dart/examples/users/update-phone-verification.md new file mode 100644 index 000000000..14f91aeb3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-phone-verification.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updatePhoneVerification( + userId: '<USER_ID>', + phoneVerification: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-phone.md b/examples/2.0.x/server-dart/examples/users/update-phone.md new file mode 100644 index 000000000..3eb43b1e1 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-phone.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updatePhone( + userId: '<USER_ID>', + number: '+12065550100', +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-prefs.md b/examples/2.0.x/server-dart/examples/users/update-prefs.md new file mode 100644 index 000000000..e8b7e7e82 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-prefs.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Preferences result = await users.updatePrefs( + userId: '<USER_ID>', + prefs: {}, +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-status.md b/examples/2.0.x/server-dart/examples/users/update-status.md new file mode 100644 index 000000000..3d4741872 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-status.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateStatus( + userId: '<USER_ID>', + status: false, +); +``` diff --git a/examples/2.0.x/server-dart/examples/users/update-target.md b/examples/2.0.x/server-dart/examples/users/update-target.md new file mode 100644 index 000000000..f15e170fb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/users/update-target.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Target result = await users.updateTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // (optional) + providerId: '<PROVIDER_ID>', // (optional) + name: '<NAME>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-dart/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..373e42edd --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/create-collection.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.createCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, + permissions: [Permission.read(Role.any())], // (optional) + documentSecurity: false, // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/create-document.md b/examples/2.0.x/server-dart/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..5a69c5387 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/create-document.md @@ -0,0 +1,31 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + }, + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-dart/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..61d28281a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/create-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.createDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/create-index.md b/examples/2.0.x/server-dart/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..497e69da4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/create-index.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart' as enums; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Index result = await vectorsDB.createIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: enums.VectorsDBIndexType.hnswEuclidean, + attributes: [], + orders: [enums.OrderBy.asc], // (optional) + lengths: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-dart/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..2736f79e3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.createOperations( + transactionId: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/create-query.md b/examples/2.0.x/server-dart/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..f94dd3236 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/create-query.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.createQuery( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) + total: false, // (optional) + ttl: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-dart/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..a049d5e72 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/create-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.createTransaction( + ttl: 60, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/create.md b/examples/2.0.x/server-dart/examples/vectorsdb/create.md new file mode 100644 index 000000000..2db7faa4e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/create.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Database result = await vectorsDB.create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-dart/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..ff7b73c44 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/delete-collection.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-dart/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..b0ecb3758 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/delete-document.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-dart/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..a2d7b1f9d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/delete-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-dart/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..a658a0790 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/delete-index.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-dart/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..c8d2d9734 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.deleteTransaction( + transactionId: '<TRANSACTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/delete.md b/examples/2.0.x/server-dart/examples/vectorsdb/delete.md new file mode 100644 index 000000000..889f599ac --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +await vectorsDB.delete( + databaseId: '<DATABASE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-dart/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..8fe629229 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/get-collection.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.getCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/get-document.md b/examples/2.0.x/server-dart/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..f6e88e0be --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/get-document.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/get-index.md b/examples/2.0.x/server-dart/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..ebfa90328 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/get-index.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Index result = await vectorsDB.getIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-dart/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..513d4997e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/get-transaction.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.getTransaction( + transactionId: '<TRANSACTION_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/get.md b/examples/2.0.x/server-dart/examples/vectorsdb/get.md new file mode 100644 index 000000000..6498956a7 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Database result = await vectorsDB.get( + databaseId: '<DATABASE_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-dart/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..ae03da41e --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/list-collections.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +VectorsdbCollectionList result = await vectorsDB.listCollections( + databaseId: '<DATABASE_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-dart/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..596a4c0c4 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/list-documents.md @@ -0,0 +1,19 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) + total: false, // (optional) + ttl: 0, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-dart/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..756abd4a9 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/list-indexes.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +IndexList result = await vectorsDB.listIndexes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-dart/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..eb5058755 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/list-transactions.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +TransactionList result = await vectorsDB.listTransactions( + queries: [], // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/list.md b/examples/2.0.x/server-dart/examples/vectorsdb/list.md new file mode 100644 index 000000000..b257c3843 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/list.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +DatabaseList result = await vectorsDB.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-dart/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..e7e90abe7 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/update-collection.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.updateCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + documentSecurity: false, // (optional) + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/update-document.md b/examples/2.0.x/server-dart/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..eac35a967 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/update-document.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-dart/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..221a5bc91 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/update-documents.md @@ -0,0 +1,18 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.updateDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // (optional) + queries: [], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-dart/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..dd08d5cdb --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/update-transaction.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Transaction result = await vectorsDB.updateTransaction( + transactionId: '<TRANSACTION_ID>', + commit: false, // (optional) + rollback: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/update.md b/examples/2.0.x/server-dart/examples/vectorsdb/update.md new file mode 100644 index 000000000..113ed7bc0 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/update.md @@ -0,0 +1,16 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +Database result = await vectorsDB.update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-dart/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..65f7f2bd8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/upsert-document.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/permission.dart'; +import 'package:dart_appwrite/role.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +VectorsDB vectorsDB = VectorsDB(client); + +Document result = await vectorsDB.upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // (optional) + permissions: [Permission.read(Role.any())], // (optional) + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-dart/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..d6bd3309a --- /dev/null +++ b/examples/2.0.x/server-dart/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,17 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +VectorsDB vectorsDB = VectorsDB(client); + +DocumentList result = await vectorsDB.upsertDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/webhooks/create.md b/examples/2.0.x/server-dart/examples/webhooks/create.md new file mode 100644 index 000000000..fe07d9d6d --- /dev/null +++ b/examples/2.0.x/server-dart/examples/webhooks/create.md @@ -0,0 +1,22 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Webhooks webhooks = Webhooks(client); + +Webhook result = await webhooks.create( + webhookId: '<WEBHOOK_ID>', + url: 'https://example.com/webhook', + name: '<NAME>', + events: [], + enabled: false, // (optional) + tls: false, // (optional) + authUsername: '<AUTH_USERNAME>', // (optional) + authPassword: 'password', // (optional) + secret: '<SECRET>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/webhooks/delete.md b/examples/2.0.x/server-dart/examples/webhooks/delete.md new file mode 100644 index 000000000..5df49aa2c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/webhooks/delete.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Webhooks webhooks = Webhooks(client); + +await webhooks.delete( + webhookId: '<WEBHOOK_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/webhooks/get.md b/examples/2.0.x/server-dart/examples/webhooks/get.md new file mode 100644 index 000000000..60defa832 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/webhooks/get.md @@ -0,0 +1,14 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Webhooks webhooks = Webhooks(client); + +Webhook result = await webhooks.get( + webhookId: '<WEBHOOK_ID>', +); +``` diff --git a/examples/2.0.x/server-dart/examples/webhooks/list.md b/examples/2.0.x/server-dart/examples/webhooks/list.md new file mode 100644 index 000000000..ea2d91e9c --- /dev/null +++ b/examples/2.0.x/server-dart/examples/webhooks/list.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Webhooks webhooks = Webhooks(client); + +WebhookList result = await webhooks.list( + queries: [], // (optional) + total: false, // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/webhooks/update-secret.md b/examples/2.0.x/server-dart/examples/webhooks/update-secret.md new file mode 100644 index 000000000..9aab19bf3 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/webhooks/update-secret.md @@ -0,0 +1,15 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Webhooks webhooks = Webhooks(client); + +Webhook result = await webhooks.updateSecret( + webhookId: '<WEBHOOK_ID>', + secret: '<SECRET>', // (optional) +); +``` diff --git a/examples/2.0.x/server-dart/examples/webhooks/update.md b/examples/2.0.x/server-dart/examples/webhooks/update.md new file mode 100644 index 000000000..99bc21df8 --- /dev/null +++ b/examples/2.0.x/server-dart/examples/webhooks/update.md @@ -0,0 +1,21 @@ +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Webhooks webhooks = Webhooks(client); + +Webhook result = await webhooks.update( + webhookId: '<WEBHOOK_ID>', + name: '<NAME>', + url: 'https://example.com/webhook', + events: [], + enabled: false, // (optional) + tls: false, // (optional) + authUsername: '<AUTH_USERNAME>', // (optional) + authPassword: 'password', // (optional) +); +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-anonymous-session.md b/examples/2.0.x/server-dotnet/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..35b3aab46 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-anonymous-session.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.CreateAnonymousSession(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-email-password-session.md b/examples/2.0.x/server-dotnet/examples/account/create-email-password-session.md new file mode 100644 index 000000000..f24e35ca3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-email-password-session.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.CreateEmailPasswordSession( + email: "email@example.com", + password: "password" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-email-token.md b/examples/2.0.x/server-dotnet/examples/account/create-email-token.md new file mode 100644 index 000000000..be003ffe1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-email-token.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreateEmailToken( + userId: "<USER_ID>", + email: "email@example.com", + phrase: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-email-verification.md b/examples/2.0.x/server-dotnet/examples/account/create-email-verification.md new file mode 100644 index 000000000..b5c4aad48 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-email-verification.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreateEmailVerification( + url: "https://example.com" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-magic-url-token.md b/examples/2.0.x/server-dotnet/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..85e771646 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-magic-url-token.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreateMagicURLToken( + userId: "<USER_ID>", + email: "email@example.com", + url: "https://example.com", // optional + phrase: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-dotnet/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..74e3d1053 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-mfa-authenticator.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaType result = await account.CreateMFAAuthenticator( + type: AuthenticatorType.Totp +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-dotnet/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..8f7a9208b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-mfa-challenge.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaChallenge result = await account.CreateMFAChallenge( + factor: AuthenticationFactor.Email +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-dotnet/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..6869828db --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-dotnet/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..f47f7e5ea --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-o-auth-2-token.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.CreateOAuth2Token( + provider: OAuthProvider.Amazon, + success: "https://example.com", // optional + failure: "https://example.com", // optional + scopes: new List<string>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-phone-token.md b/examples/2.0.x/server-dotnet/examples/account/create-phone-token.md new file mode 100644 index 000000000..e296f8ed7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-phone-token.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreatePhoneToken( + userId: "<USER_ID>", + phone: "+12065550100" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-phone-verification.md b/examples/2.0.x/server-dotnet/examples/account/create-phone-verification.md new file mode 100644 index 000000000..e5f1144da --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-phone-verification.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreatePhoneVerification(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-recovery.md b/examples/2.0.x/server-dotnet/examples/account/create-recovery.md new file mode 100644 index 000000000..7951fcb60 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-recovery.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreateRecovery( + email: "email@example.com", + url: "https://example.com" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-session.md b/examples/2.0.x/server-dotnet/examples/account/create-session.md new file mode 100644 index 000000000..9cd8558a9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-session.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.CreateSession( + userId: "<USER_ID>", + secret: "<SECRET>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create-verification.md b/examples/2.0.x/server-dotnet/examples/account/create-verification.md new file mode 100644 index 000000000..a25aa0de2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create-verification.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreateVerification( + url: "https://example.com" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/create.md b/examples/2.0.x/server-dotnet/examples/account/create.md new file mode 100644 index 000000000..b068e0c36 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/create.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.Create( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/delete-identity.md b/examples/2.0.x/server-dotnet/examples/account/delete-identity.md new file mode 100644 index 000000000..bc4938d68 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/delete-identity.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteIdentity( + identityId: "<IDENTITY_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-dotnet/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..58aa3af1a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteMFAAuthenticator( + type: AuthenticatorType.Totp +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/delete-session.md b/examples/2.0.x/server-dotnet/examples/account/delete-session.md new file mode 100644 index 000000000..9c8e9c1f8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/delete-session.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteSession( + sessionId: "<SESSION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/delete-sessions.md b/examples/2.0.x/server-dotnet/examples/account/delete-sessions.md new file mode 100644 index 000000000..31bd03a12 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/delete-sessions.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteSessions(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-dotnet/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..54ffda453 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/get-prefs.md b/examples/2.0.x/server-dotnet/examples/account/get-prefs.md new file mode 100644 index 000000000..fb891b6e2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/get-prefs.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Preferences result = await account.GetPrefs(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/get-session.md b/examples/2.0.x/server-dotnet/examples/account/get-session.md new file mode 100644 index 000000000..dee7ad1b1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/get-session.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.GetSession( + sessionId: "<SESSION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/get.md b/examples/2.0.x/server-dotnet/examples/account/get.md new file mode 100644 index 000000000..ba7c848bf --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/get.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.Get(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/list-identities.md b/examples/2.0.x/server-dotnet/examples/account/list-identities.md new file mode 100644 index 000000000..f64b03b0a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/list-identities.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +IdentityList result = await account.ListIdentities( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/list-mfa-factors.md b/examples/2.0.x/server-dotnet/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..5fa29c29e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/list-mfa-factors.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaFactors result = await account.ListMFAFactors(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/list-sessions.md b/examples/2.0.x/server-dotnet/examples/account/list-sessions.md new file mode 100644 index 000000000..81402bccf --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/list-sessions.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +SessionList result = await account.ListSessions(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-email-verification.md b/examples/2.0.x/server-dotnet/examples/account/update-email-verification.md new file mode 100644 index 000000000..3b4214e6c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-email-verification.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.UpdateEmailVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-email.md b/examples/2.0.x/server-dotnet/examples/account/update-email.md new file mode 100644 index 000000000..9135dc1c1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-email.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateEmail( + email: "email@example.com", + password: "password" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-magic-url-session.md b/examples/2.0.x/server-dotnet/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..06f707ee5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-magic-url-session.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.UpdateMagicURLSession( + userId: "<USER_ID>", + secret: "<SECRET>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-dotnet/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..a9cdba19d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-mfa-authenticator.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateMFAAuthenticator( + type: AuthenticatorType.Totp, + otp: "<OTP>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-dotnet/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..d74d8d58c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-mfa-challenge.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.UpdateMFAChallenge( + challengeId: "<CHALLENGE_ID>", + otp: "<OTP>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-dotnet/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..eefede0f5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-mfa.md b/examples/2.0.x/server-dotnet/examples/account/update-mfa.md new file mode 100644 index 000000000..449edcb39 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-mfa.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateMFA( + mfa: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-name.md b/examples/2.0.x/server-dotnet/examples/account/update-name.md new file mode 100644 index 000000000..bf88c6626 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-name.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateName( + name: "<NAME>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-password.md b/examples/2.0.x/server-dotnet/examples/account/update-password.md new file mode 100644 index 000000000..323934abc --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-password.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdatePassword( + password: "password", + oldPassword: "password" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-phone-session.md b/examples/2.0.x/server-dotnet/examples/account/update-phone-session.md new file mode 100644 index 000000000..dd7ab0487 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-phone-session.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.UpdatePhoneSession( + userId: "<USER_ID>", + secret: "<SECRET>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-phone-verification.md b/examples/2.0.x/server-dotnet/examples/account/update-phone-verification.md new file mode 100644 index 000000000..c2b7eebb5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-phone-verification.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.UpdatePhoneVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-phone.md b/examples/2.0.x/server-dotnet/examples/account/update-phone.md new file mode 100644 index 000000000..d2b7276b4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-phone.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdatePhone( + phone: "+12065550100", + password: "password" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-prefs.md b/examples/2.0.x/server-dotnet/examples/account/update-prefs.md new file mode 100644 index 000000000..105e69888 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-prefs.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdatePrefs( + prefs: new { + language = "en", + timezone = "UTC", + darkTheme = true + } +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-recovery.md b/examples/2.0.x/server-dotnet/examples/account/update-recovery.md new file mode 100644 index 000000000..5875c5b09 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-recovery.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.UpdateRecovery( + userId: "<USER_ID>", + secret: "<SECRET>", + password: "password" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-session.md b/examples/2.0.x/server-dotnet/examples/account/update-session.md new file mode 100644 index 000000000..d49e556f0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-session.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.UpdateSession( + sessionId: "<SESSION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-status.md b/examples/2.0.x/server-dotnet/examples/account/update-status.md new file mode 100644 index 000000000..95ac938dd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-status.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateStatus(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/account/update-verification.md b/examples/2.0.x/server-dotnet/examples/account/update-verification.md new file mode 100644 index 000000000..16fbc2ce5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/account/update-verification.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.UpdateVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/advisor/delete-report.md b/examples/2.0.x/server-dotnet/examples/advisor/delete-report.md new file mode 100644 index 000000000..4e8f41236 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/advisor/delete-report.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +await advisor.DeleteReport( + reportId: "<REPORT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/advisor/get-insight.md b/examples/2.0.x/server-dotnet/examples/advisor/get-insight.md new file mode 100644 index 000000000..29543bdc8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/advisor/get-insight.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +Insight result = await advisor.GetInsight( + reportId: "<REPORT_ID>", + insightId: "<INSIGHT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/advisor/get-report.md b/examples/2.0.x/server-dotnet/examples/advisor/get-report.md new file mode 100644 index 000000000..2143cbc0a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/advisor/get-report.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +Report result = await advisor.GetReport( + reportId: "<REPORT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/advisor/list-insights.md b/examples/2.0.x/server-dotnet/examples/advisor/list-insights.md new file mode 100644 index 000000000..00322495d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/advisor/list-insights.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +InsightList result = await advisor.ListInsights( + reportId: "<REPORT_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/advisor/list-reports.md b/examples/2.0.x/server-dotnet/examples/advisor/list-reports.md new file mode 100644 index 000000000..e610e521d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/advisor/list-reports.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +ReportList result = await advisor.ListReports( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-browser.md b/examples/2.0.x/server-dotnet/examples/avatars/get-browser.md new file mode 100644 index 000000000..4b53a3e43 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-browser.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetBrowser( + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-credit-card.md b/examples/2.0.x/server-dotnet/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..924d4b6c0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-credit-card.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetCreditCard( + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-favicon.md b/examples/2.0.x/server-dotnet/examples/avatars/get-favicon.md new file mode 100644 index 000000000..d71797488 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-favicon.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetFavicon( + url: "https://example.com" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-flag.md b/examples/2.0.x/server-dotnet/examples/avatars/get-flag.md new file mode 100644 index 000000000..8480c6fb8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-flag.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetFlag( + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-image.md b/examples/2.0.x/server-dotnet/examples/avatars/get-image.md new file mode 100644 index 000000000..86ef67f7a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-image.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetImage( + url: "https://example.com", + width: 0, // optional + height: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-initials.md b/examples/2.0.x/server-dotnet/examples/avatars/get-initials.md new file mode 100644 index 000000000..3c6d7dd16 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-initials.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetInitials( + name: "<NAME>", // optional + width: 0, // optional + height: 0, // optional + background: "FFFFFF" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-photo.md b/examples/2.0.x/server-dotnet/examples/avatars/get-photo.md new file mode 100644 index 000000000..0f65e5396 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-photo.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: "png", // optional + rating: "g", // optional + userId: "current()", // optional + emailHash: "<EMAIL_HASH>", // optional + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-qr.md b/examples/2.0.x/server-dotnet/examples/avatars/get-qr.md new file mode 100644 index 000000000..0be679e65 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-qr.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetQR( + text: "<TEXT>", + size: 1, // optional + margin: 0, // optional + download: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/avatars/get-screenshot.md b/examples/2.0.x/server-dotnet/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..92828bf71 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/avatars/get-screenshot.md @@ -0,0 +1,40 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetScreenshot( + url: "https://example.com", + headers: new { + Authorization = "Bearer token123", + X-Custom-Header = "value" + }, // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: BrowserTheme.Dark, // optional + userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // optional + fullpage: true, // optional + locale: "en-US", // optional + timezone: Timezone.AfricaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: new List<BrowserPermission> { BrowserPermission.Geolocation, BrowserPermission.Notifications }, // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: ImageFormat.Jpeg // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..db06ba5d1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-big-int-attribute.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeBigint result = await databases.CreateBigIntAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 1000000, // optional + default: 0, // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..ba2df46c6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-boolean-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeBoolean result = await databases.CreateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: false, // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-collection.md b/examples/2.0.x/server-dotnet/examples/databases/create-collection.md new file mode 100644 index 000000000..8fbf9538e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-collection.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Collection result = await databases.CreateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: new List<object>(), // optional + indexes: new List<object>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..f9248808b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-datetime-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeDatetime result = await databases.CreateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-document.md b/examples/2.0.x/server-dotnet/examples/databases/create-document.md new file mode 100644 index 000000000..54730c8d0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-document.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.CreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-documents.md b/examples/2.0.x/server-dotnet/examples/databases/create-documents.md new file mode 100644 index 000000000..e490a0b89 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +DocumentList result = await databases.CreateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: new List<object>(), + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-email-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..94757f049 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-email-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeEmail result = await databases.CreateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..d66cb3ac8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-enum-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeEnum result = await databases.CreateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-float-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..26fb95a76 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-float-attribute.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeFloat result = await databases.CreateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 100, // optional + default: 10.5, // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-index.md b/examples/2.0.x/server-dotnet/examples/databases/create-index.md new file mode 100644 index 000000000..748394d95 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-index.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Index result = await databases.CreateIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: DatabasesIndexType.Key, + attributes: new List<string>(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List<long>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..04678b940 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-integer-attribute.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeInteger result = await databases.CreateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 100, // optional + default: 10, // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..b5de19bed --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-ip-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeIp result = await databases.CreateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-line-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..53f1ada4b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-line-attribute.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeLine result = await databases.CreateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..3bf127aa4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-longtext-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeLongtext result = await databases.CreateLongtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..2e758f7bd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeMediumtext result = await databases.CreateMediumtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-operations.md b/examples/2.0.x/server-dotnet/examples/databases/create-operations.md new file mode 100644 index 000000000..7b1501942 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-operations.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Transaction result = await databases.CreateOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-point-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..a08e2b9a6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-point-attribute.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributePoint result = await databases.CreatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [1, 2] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..917a45c98 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-polygon-attribute.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributePolygon result = await databases.CreatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..6f8ac6211 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-relationship-attribute.md @@ -0,0 +1,25 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeRelationship result = await databases.CreateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + relatedCollectionId: "<RELATED_COLLECTION_ID>", + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: "<KEY>", // optional + twoWayKey: "<TWO_WAY_KEY>", // optional + onDelete: RelationMutate.Cascade // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-string-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..ea547aaa6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-string-attribute.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeString result = await databases.CreateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-text-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..dd6fe3cb1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-text-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeText result = await databases.CreateTextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-transaction.md b/examples/2.0.x/server-dotnet/examples/databases/create-transaction.md new file mode 100644 index 000000000..29b18cd4b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Transaction result = await databases.CreateTransaction( + ttl: 60 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-url-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..dd0e356b9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-url-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeUrl result = await databases.CreateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..4c3f3a1e5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create-varchar-attribute.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeVarchar result = await databases.CreateVarcharAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/create.md b/examples/2.0.x/server-dotnet/examples/databases/create.md new file mode 100644 index 000000000..6d0a504c8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/create.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Database result = await databases.Create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..46dd163d6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/decrement-document-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.DecrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, // optional + min: 0, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/delete-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/delete-attribute.md new file mode 100644 index 000000000..05fb3e784 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/delete-attribute.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/delete-collection.md b/examples/2.0.x/server-dotnet/examples/databases/delete-collection.md new file mode 100644 index 000000000..ecebab3a1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/delete-collection.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/delete-document.md b/examples/2.0.x/server-dotnet/examples/databases/delete-document.md new file mode 100644 index 000000000..02adf9992 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/delete-document.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +await databases.DeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/delete-documents.md b/examples/2.0.x/server-dotnet/examples/databases/delete-documents.md new file mode 100644 index 000000000..4b14b138a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/delete-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/delete-index.md b/examples/2.0.x/server-dotnet/examples/databases/delete-index.md new file mode 100644 index 000000000..60303458a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/delete-index.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/delete-transaction.md b/examples/2.0.x/server-dotnet/examples/databases/delete-transaction.md new file mode 100644 index 000000000..2c3b947fa --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/delete-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteTransaction( + transactionId: "<TRANSACTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/delete.md b/examples/2.0.x/server-dotnet/examples/databases/delete.md new file mode 100644 index 000000000..519bcab33 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.Delete( + databaseId: "<DATABASE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/get-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/get-attribute.md new file mode 100644 index 000000000..d131b8141 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/get-attribute.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +object result = await databases.GetAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/get-collection.md b/examples/2.0.x/server-dotnet/examples/databases/get-collection.md new file mode 100644 index 000000000..0798f68e5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/get-collection.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Collection result = await databases.GetCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/get-document.md b/examples/2.0.x/server-dotnet/examples/databases/get-document.md new file mode 100644 index 000000000..102cbb5b4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/get-document.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.GetDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/get-index.md b/examples/2.0.x/server-dotnet/examples/databases/get-index.md new file mode 100644 index 000000000..ad06f1fb3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/get-index.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Index result = await databases.GetIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/get-transaction.md b/examples/2.0.x/server-dotnet/examples/databases/get-transaction.md new file mode 100644 index 000000000..fe449961f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/get-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Transaction result = await databases.GetTransaction( + transactionId: "<TRANSACTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/get.md b/examples/2.0.x/server-dotnet/examples/databases/get.md new file mode 100644 index 000000000..91d9a0ec1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Database result = await databases.Get( + databaseId: "<DATABASE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..230784d7f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/increment-document-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.IncrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, // optional + max: 100, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/list-attributes.md b/examples/2.0.x/server-dotnet/examples/databases/list-attributes.md new file mode 100644 index 000000000..ff57878ce --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/list-attributes.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeList result = await databases.ListAttributes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/list-collections.md b/examples/2.0.x/server-dotnet/examples/databases/list-collections.md new file mode 100644 index 000000000..ed856f6eb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/list-collections.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +CollectionList result = await databases.ListCollections( + databaseId: "<DATABASE_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/list-documents.md b/examples/2.0.x/server-dotnet/examples/databases/list-documents.md new file mode 100644 index 000000000..d8cdff0ab --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/list-documents.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +DocumentList result = await databases.ListDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/list-indexes.md b/examples/2.0.x/server-dotnet/examples/databases/list-indexes.md new file mode 100644 index 000000000..80f4bcf2a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/list-indexes.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +IndexList result = await databases.ListIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/list-transactions.md b/examples/2.0.x/server-dotnet/examples/databases/list-transactions.md new file mode 100644 index 000000000..fc1416744 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/list-transactions.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +TransactionList result = await databases.ListTransactions( + queries: new List<string>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/list.md b/examples/2.0.x/server-dotnet/examples/databases/list.md new file mode 100644 index 000000000..57095184a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +DatabaseList result = await databases.List( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..7fea78b58 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-big-int-attribute.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeBigint result = await databases.UpdateBigIntAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 0, + min: 0, // optional + max: 1000000, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..52b0a767e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-boolean-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeBoolean result = await databases.UpdateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: false, + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-collection.md b/examples/2.0.x/server-dotnet/examples/databases/update-collection.md new file mode 100644 index 000000000..7e3378faa --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-collection.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Collection result = await databases.UpdateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..2a1df23fb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-datetime-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeDatetime result = await databases.UpdateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-document.md b/examples/2.0.x/server-dotnet/examples/databases/update-document.md new file mode 100644 index 000000000..e18a6ef9e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-document.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.UpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 33, + isAdmin = false + }, // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-documents.md b/examples/2.0.x/server-dotnet/examples/databases/update-documents.md new file mode 100644 index 000000000..db3133dfe --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-documents.md @@ -0,0 +1,27 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +DocumentList result = await databases.UpdateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 33, + isAdmin = false + }, // optional + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-email-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..b1f0e37fa --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-email-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeEmail result = await databases.UpdateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..d009b5c79 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-enum-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeEnum result = await databases.UpdateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-float-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..fd8dc4271 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-float-attribute.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeFloat result = await databases.UpdateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 10.5, + min: 0, // optional + max: 100, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..17a0cc8bd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-integer-attribute.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeInteger result = await databases.UpdateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 10, + min: 0, // optional + max: 100, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..432bb4d43 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-ip-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeIp result = await databases.UpdateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-line-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..11dc38400 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-line-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeLine result = await databases.UpdateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..2dba9171f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-longtext-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeLongtext result = await databases.UpdateLongtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..ba356254e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeMediumtext result = await databases.UpdateMediumtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-point-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..7bbf9fb6b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-point-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributePoint result = await databases.UpdatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [1, 2], // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..f35fdcff3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-polygon-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributePolygon result = await databases.UpdatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..aa7fd0308 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-relationship-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeRelationship result = await databases.UpdateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + onDelete: RelationMutate.Cascade, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-string-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..00bf4aed6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-string-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeString result = await databases.UpdateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-text-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..e041f96e0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-text-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeText result = await databases.UpdateTextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-transaction.md b/examples/2.0.x/server-dotnet/examples/databases/update-transaction.md new file mode 100644 index 000000000..b30589352 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-transaction.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Transaction result = await databases.UpdateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, // optional + rollback: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-url-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..4beafd13a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-url-attribute.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeUrl result = await databases.UpdateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-dotnet/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..2d7215129 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update-varchar-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeVarchar result = await databases.UpdateVarcharAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/update.md b/examples/2.0.x/server-dotnet/examples/databases/update.md new file mode 100644 index 000000000..1439c1cea --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/update.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Database result = await databases.Update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/upsert-document.md b/examples/2.0.x/server-dotnet/examples/databases/upsert-document.md new file mode 100644 index 000000000..3eff270e4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/upsert-document.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.UpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/databases/upsert-documents.md b/examples/2.0.x/server-dotnet/examples/databases/upsert-documents.md new file mode 100644 index 000000000..d22184b8f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/databases/upsert-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +DocumentList result = await databases.UpsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: new List<object>(), + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/create-collection.md b/examples/2.0.x/server-dotnet/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..5c42dc563 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/create-collection.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.CreateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: new List<object>(), // optional + indexes: new List<object>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/create-document.md b/examples/2.0.x/server-dotnet/examples/documentsdb/create-document.md new file mode 100644 index 000000000..ccc8bc36b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/create-document.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.CreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/create-documents.md b/examples/2.0.x/server-dotnet/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..6b98311b0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/create-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.CreateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: new List<object>(), + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/create-index.md b/examples/2.0.x/server-dotnet/examples/documentsdb/create-index.md new file mode 100644 index 000000000..31a062921 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/create-index.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Index result = await documentsDB.CreateIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: DocumentsDBIndexType.Key, + attributes: new List<string>(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List<long>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/create-operations.md b/examples/2.0.x/server-dotnet/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..abe507f31 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/create-operations.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.CreateOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-dotnet/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..a948934b1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/create-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.CreateTransaction( + ttl: 60 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/create.md b/examples/2.0.x/server-dotnet/examples/documentsdb/create.md new file mode 100644 index 000000000..b8d866e44 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/create.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-dotnet/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..5ab49cdd7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.DecrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, // optional + min: 0, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..ce55d7953 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-collection.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/delete-document.md b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..eeca145b2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-document.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..c1c885aa9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/delete-index.md b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..fed0c3cc7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-index.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..5ad20ffdd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/delete-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.DeleteTransaction( + transactionId: "<TRANSACTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/delete.md b/examples/2.0.x/server-dotnet/examples/documentsdb/delete.md new file mode 100644 index 000000000..12696db2c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +await documentsDB.Delete( + databaseId: "<DATABASE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/get-collection.md b/examples/2.0.x/server-dotnet/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..f50e03a1b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/get-collection.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.GetCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/get-document.md b/examples/2.0.x/server-dotnet/examples/documentsdb/get-document.md new file mode 100644 index 000000000..1e3bfa5c2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/get-document.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.GetDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/get-index.md b/examples/2.0.x/server-dotnet/examples/documentsdb/get-index.md new file mode 100644 index 000000000..e8c99e38c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/get-index.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Index result = await documentsDB.GetIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-dotnet/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..800897c22 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/get-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.GetTransaction( + transactionId: "<TRANSACTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/get.md b/examples/2.0.x/server-dotnet/examples/documentsdb/get.md new file mode 100644 index 000000000..f8d06919c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Get( + databaseId: "<DATABASE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-dotnet/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..fc9d0795c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.IncrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, // optional + max: 100, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/list-collections.md b/examples/2.0.x/server-dotnet/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..1227361b2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/list-collections.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +CollectionList result = await documentsDB.ListCollections( + databaseId: "<DATABASE_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/list-documents.md b/examples/2.0.x/server-dotnet/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..0838c9c1a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/list-documents.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.ListDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-dotnet/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..aa8435ca5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/list-indexes.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +IndexList result = await documentsDB.ListIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-dotnet/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..84539069c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/list-transactions.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +TransactionList result = await documentsDB.ListTransactions( + queries: new List<string>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/list.md b/examples/2.0.x/server-dotnet/examples/documentsdb/list.md new file mode 100644 index 000000000..95ba811a4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +DatabaseList result = await documentsDB.List( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/update-collection.md b/examples/2.0.x/server-dotnet/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..093d9db90 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/update-collection.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Collection result = await documentsDB.UpdateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/update-document.md b/examples/2.0.x/server-dotnet/examples/documentsdb/update-document.md new file mode 100644 index 000000000..87172a6e5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/update-document.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.UpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [object], // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/update-documents.md b/examples/2.0.x/server-dotnet/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..f325b2eac --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/update-documents.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.UpdateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: [object], // optional + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-dotnet/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..b4a306872 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/update-transaction.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Transaction result = await documentsDB.UpdateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, // optional + rollback: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/update.md b/examples/2.0.x/server-dotnet/examples/documentsdb/update.md new file mode 100644 index 000000000..1572fc7a6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/update.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +Database result = await documentsDB.Update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-dotnet/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..a5de788f0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/upsert-document.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +Document result = await documentsDB.UpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [object], // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-dotnet/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..66f738cf0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/documentsdb/upsert-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +DocumentList result = await documentsDB.UpsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: new List<object>(), + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-dotnet/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..95b97cc0d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Embeddings embeddings = new Embeddings(client); + +EmbeddingList result = await embeddings.CreateTextEmbeddings( + texts: new List<string>(), + model: EmbeddingModel.NomicEmbedText // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/create-deployment.md b/examples/2.0.x/server-dotnet/examples/functions/create-deployment.md new file mode 100644 index 000000000..a445e35f8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/create-deployment.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.CreateDeployment( + functionId: "<FUNCTION_ID>", + code: InputFile.FromPath("./path-to-files/image.jpg"), + activate: false, + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-dotnet/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..20ba6fabe --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.CreateDuplicateDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + buildId: "<BUILD_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/create-execution.md b/examples/2.0.x/server-dotnet/examples/functions/create-execution.md new file mode 100644 index 000000000..38e0b69b3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/create-execution.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +Execution result = await functions.CreateExecution( + functionId: "<FUNCTION_ID>", + body: "<BODY>", // optional + async: false, // optional + path: "<PATH>", // optional + method: ExecutionMethod.GET, // optional + headers: [object], // optional + scheduledAt: "<SCHEDULED_AT>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/create-template-deployment.md b/examples/2.0.x/server-dotnet/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..47edfa96e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/create-template-deployment.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.CreateTemplateDeployment( + functionId: "<FUNCTION_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + type: TemplateReferenceType.Commit, + reference: "<REFERENCE>", + activate: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/create-variable.md b/examples/2.0.x/server-dotnet/examples/functions/create-variable.md new file mode 100644 index 000000000..7e3d32f6f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/create-variable.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Variable result = await functions.CreateVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-dotnet/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..bfc068889 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/create-vcs-deployment.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.CreateVcsDeployment( + functionId: "<FUNCTION_ID>", + type: VCSReferenceType.Branch, + reference: "<REFERENCE>", + activate: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/create.md b/examples/2.0.x/server-dotnet/examples/functions/create.md new file mode 100644 index 000000000..741a659a7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/create.md @@ -0,0 +1,39 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Function result = await functions.Create( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: Runtime.Node145, + execute: ["any"], // optional + events: new List<string>(), // optional + schedule: "0 0 * * *", // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>", // optional + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches: new List<string>(), // optional + providerPaths: new List<string>(), // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/delete-deployment.md b/examples/2.0.x/server-dotnet/examples/functions/delete-deployment.md new file mode 100644 index 000000000..673fc1c86 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/delete-deployment.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +await functions.DeleteDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/delete-execution.md b/examples/2.0.x/server-dotnet/examples/functions/delete-execution.md new file mode 100644 index 000000000..288828159 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/delete-execution.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +await functions.DeleteExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/delete-variable.md b/examples/2.0.x/server-dotnet/examples/functions/delete-variable.md new file mode 100644 index 000000000..7dcb9a9ac --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/delete-variable.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +await functions.DeleteVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/delete.md b/examples/2.0.x/server-dotnet/examples/functions/delete.md new file mode 100644 index 000000000..c814f3219 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +await functions.Delete( + functionId: "<FUNCTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/get-deployment-download.md b/examples/2.0.x/server-dotnet/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..0756473ad --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/get-deployment-download.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +byte[] result = await functions.GetDeploymentDownload( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: DeploymentDownloadType.Source, // optional + token: "<TOKEN>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/get-deployment.md b/examples/2.0.x/server-dotnet/examples/functions/get-deployment.md new file mode 100644 index 000000000..fb0905f58 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/get-deployment.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.GetDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/get-execution.md b/examples/2.0.x/server-dotnet/examples/functions/get-execution.md new file mode 100644 index 000000000..6f2871b4d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/get-execution.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +Execution result = await functions.GetExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/get-variable.md b/examples/2.0.x/server-dotnet/examples/functions/get-variable.md new file mode 100644 index 000000000..7b383b0b7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/get-variable.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Variable result = await functions.GetVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/get.md b/examples/2.0.x/server-dotnet/examples/functions/get.md new file mode 100644 index 000000000..86ffaa29e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Function result = await functions.Get( + functionId: "<FUNCTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/list-deployments.md b/examples/2.0.x/server-dotnet/examples/functions/list-deployments.md new file mode 100644 index 000000000..8e368f9fa --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/list-deployments.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +DeploymentList result = await functions.ListDeployments( + functionId: "<FUNCTION_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/list-executions.md b/examples/2.0.x/server-dotnet/examples/functions/list-executions.md new file mode 100644 index 000000000..85cc2ab48 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/list-executions.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +ExecutionList result = await functions.ListExecutions( + functionId: "<FUNCTION_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/list-runtimes.md b/examples/2.0.x/server-dotnet/examples/functions/list-runtimes.md new file mode 100644 index 000000000..b0b686256 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/list-runtimes.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +RuntimeList result = await functions.ListRuntimes(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/list-specifications.md b/examples/2.0.x/server-dotnet/examples/functions/list-specifications.md new file mode 100644 index 000000000..b97f4cf42 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/list-specifications.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +SpecificationList result = await functions.ListSpecifications( + type: "runtimes" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/list-variables.md b/examples/2.0.x/server-dotnet/examples/functions/list-variables.md new file mode 100644 index 000000000..df8029e3f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/list-variables.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +VariableList result = await functions.ListVariables( + functionId: "<FUNCTION_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/list.md b/examples/2.0.x/server-dotnet/examples/functions/list.md new file mode 100644 index 000000000..b09d8ee62 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +FunctionList result = await functions.List( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/update-deployment-status.md b/examples/2.0.x/server-dotnet/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..ee782aed6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/update-deployment-status.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.UpdateDeploymentStatus( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/update-function-deployment.md b/examples/2.0.x/server-dotnet/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..563d5a216 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/update-function-deployment.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Function result = await functions.UpdateFunctionDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/update-variable.md b/examples/2.0.x/server-dotnet/examples/functions/update-variable.md new file mode 100644 index 000000000..a1fd20ee2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/update-variable.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Variable result = await functions.UpdateVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", // optional + value: "<VALUE>", // optional + secret: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/functions/update.md b/examples/2.0.x/server-dotnet/examples/functions/update.md new file mode 100644 index 000000000..10d4a96bb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/functions/update.md @@ -0,0 +1,39 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Function result = await functions.Update( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: Runtime.Node145, // optional + execute: ["any"], // optional + events: new List<string>(), // optional + schedule: "0 0 * * *", // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>", // optional + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches: new List<string>(), // optional + providerPaths: new List<string>(), // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/graphql/mutation.md b/examples/2.0.x/server-dotnet/examples/graphql/mutation.md new file mode 100644 index 000000000..0145c03c7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/graphql/mutation.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Graphql graphql = new Graphql(client); + +Any result = await graphql.Mutation( + query: [object] +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/graphql/query.md b/examples/2.0.x/server-dotnet/examples/graphql/query.md new file mode 100644 index 000000000..88c82162b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/graphql/query.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Graphql graphql = new Graphql(client); + +Any result = await graphql.Query( + query: [object] +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/locale/get.md b/examples/2.0.x/server-dotnet/examples/locale/get.md new file mode 100644 index 000000000..a1dcbcc94 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/locale/get.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +Locale result = await locale.Get(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/locale/list-codes.md b/examples/2.0.x/server-dotnet/examples/locale/list-codes.md new file mode 100644 index 000000000..a3bfeff55 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/locale/list-codes.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +LocaleCodeList result = await locale.ListCodes(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/locale/list-continents.md b/examples/2.0.x/server-dotnet/examples/locale/list-continents.md new file mode 100644 index 000000000..02b861166 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/locale/list-continents.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +ContinentList result = await locale.ListContinents(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/locale/list-countries-eu.md b/examples/2.0.x/server-dotnet/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..9452cd0e4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/locale/list-countries-eu.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +CountryList result = await locale.ListCountriesEU(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/locale/list-countries-phones.md b/examples/2.0.x/server-dotnet/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..e3b5346e1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/locale/list-countries-phones.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +PhoneList result = await locale.ListCountriesPhones(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/locale/list-countries.md b/examples/2.0.x/server-dotnet/examples/locale/list-countries.md new file mode 100644 index 000000000..c9c1fb946 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/locale/list-countries.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +CountryList result = await locale.ListCountries(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/locale/list-currencies.md b/examples/2.0.x/server-dotnet/examples/locale/list-currencies.md new file mode 100644 index 000000000..18d04a69f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/locale/list-currencies.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +CurrencyList result = await locale.ListCurrencies(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/locale/list-languages.md b/examples/2.0.x/server-dotnet/examples/locale/list-languages.md new file mode 100644 index 000000000..83ed0241c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/locale/list-languages.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +LanguageList result = await locale.ListLanguages(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..55be57aab --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-apns-provider.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + authKey: "<AUTH_KEY>", // optional + authKeyId: "<AUTH_KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + bundleId: "<BUNDLE_ID>", // optional + sandbox: false, // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-email.md b/examples/2.0.x/server-dotnet/examples/messaging/create-email.md new file mode 100644 index 000000000..03c71b147 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-email.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.CreateEmail( + messageId: "<MESSAGE_ID>", + subject: "<SUBJECT>", + content: "<CONTENT>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + cc: new List<string>(), // optional + bcc: new List<string>(), // optional + attachments: new List<string>(), // optional + draft: false, // optional + html: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..4ef0b591f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-fcm-provider.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + serviceAccountJSON: [object], // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..ba278efe1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + domain: "example.com", // optional + isEuRegion: false, // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..e7638b6ec --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + templateId: "<TEMPLATE_ID>", // optional + senderId: "<SENDER_ID>", // optional + authKey: "<AUTH_KEY>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-push.md b/examples/2.0.x/server-dotnet/examples/messaging/create-push.md new file mode 100644 index 000000000..3ee6e4230 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-push.md @@ -0,0 +1,36 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.CreatePush( + messageId: "<MESSAGE_ID>", + title: "<TITLE>", // optional + body: "<BODY>", // optional + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + data: [object], // optional + action: "<ACTION>", // optional + image: "<ID1:ID2>", // optional + icon: "<ICON>", // optional + sound: "<SOUND>", // optional + color: "<COLOR>", // optional + tag: "<TAG>", // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..e2400c9f9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-resend-provider.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateResendProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..f18e9a05c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..ef5697694 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-ses-provider.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateSesProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + accessKey: "<ACCESS_KEY>", // optional + secretKey: "<SECRET_KEY>", // optional + region: "<REGION>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-sms.md b/examples/2.0.x/server-dotnet/examples/messaging/create-sms.md new file mode 100644 index 000000000..2756f28c9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-sms.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.CreateSMS( + messageId: "<MESSAGE_ID>", + content: "<CONTENT>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + draft: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..bbe343568 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-smtp-provider.md @@ -0,0 +1,31 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + host: "<HOST>", + port: 587, // optional + username: "<USERNAME>", // optional + password: "password", // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: "<MAILER>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-subscriber.md b/examples/2.0.x/server-dotnet/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..619abf20e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-subscriber.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetJWT("<YOUR_JWT>"); // Your secret JSON Web Token + +Messaging messaging = new Messaging(client); + +Subscriber result = await messaging.CreateSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>", + targetId: "<TARGET_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..68c37c332 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-telesign-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + customerId: "<CUSTOMER_ID>", // optional + apiKey: "<API_KEY>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..d549516ce --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + username: "<USERNAME>", // optional + apiKey: "<API_KEY>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-topic.md b/examples/2.0.x/server-dotnet/examples/messaging/create-topic.md new file mode 100644 index 000000000..9b4338dc1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-topic.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Topic result = await messaging.CreateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", + subscribe: ["any"] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..a8a5d8c9e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-twilio-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + accountSid: "<ACCOUNT_SID>", // optional + authToken: "<AUTH_TOKEN>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..8fc8335b2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/create-vonage-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/delete-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/delete-provider.md new file mode 100644 index 000000000..fb8bca399 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/delete-provider.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +await messaging.DeleteProvider( + providerId: "<PROVIDER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-dotnet/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..81f1d1ce9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/delete-subscriber.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetJWT("<YOUR_JWT>"); // Your secret JSON Web Token + +Messaging messaging = new Messaging(client); + +await messaging.DeleteSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/delete-topic.md b/examples/2.0.x/server-dotnet/examples/messaging/delete-topic.md new file mode 100644 index 000000000..579cce5b1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/delete-topic.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +await messaging.DeleteTopic( + topicId: "<TOPIC_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/delete.md b/examples/2.0.x/server-dotnet/examples/messaging/delete.md new file mode 100644 index 000000000..a04d0334e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +await messaging.Delete( + messageId: "<MESSAGE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/get-message.md b/examples/2.0.x/server-dotnet/examples/messaging/get-message.md new file mode 100644 index 000000000..535971270 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/get-message.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.GetMessage( + messageId: "<MESSAGE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/get-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/get-provider.md new file mode 100644 index 000000000..fb9c334e8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/get-provider.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.GetProvider( + providerId: "<PROVIDER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/get-subscriber.md b/examples/2.0.x/server-dotnet/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..79e6bb079 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/get-subscriber.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Subscriber result = await messaging.GetSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/get-topic.md b/examples/2.0.x/server-dotnet/examples/messaging/get-topic.md new file mode 100644 index 000000000..6fc890d05 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/get-topic.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Topic result = await messaging.GetTopic( + topicId: "<TOPIC_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/list-messages.md b/examples/2.0.x/server-dotnet/examples/messaging/list-messages.md new file mode 100644 index 000000000..6bc43ea9d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/list-messages.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +MessageList result = await messaging.ListMessages( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/list-providers.md b/examples/2.0.x/server-dotnet/examples/messaging/list-providers.md new file mode 100644 index 000000000..5d2867448 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/list-providers.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +ProviderList result = await messaging.ListProviders( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/list-subscribers.md b/examples/2.0.x/server-dotnet/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..15773d007 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/list-subscribers.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +SubscriberList result = await messaging.ListSubscribers( + topicId: "<TOPIC_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/list-targets.md b/examples/2.0.x/server-dotnet/examples/messaging/list-targets.md new file mode 100644 index 000000000..e5b2cd943 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/list-targets.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +TargetList result = await messaging.ListTargets( + messageId: "<MESSAGE_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/list-topics.md b/examples/2.0.x/server-dotnet/examples/messaging/list-topics.md new file mode 100644 index 000000000..4fa6f4df1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/list-topics.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +TopicList result = await messaging.ListTopics( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..d8a04a49d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-apns-provider.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + authKey: "<AUTH_KEY>", // optional + authKeyId: "<AUTH_KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + bundleId: "<BUNDLE_ID>", // optional + sandbox: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-email.md b/examples/2.0.x/server-dotnet/examples/messaging/update-email.md new file mode 100644 index 000000000..5e87deeb8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-email.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.UpdateEmail( + messageId: "<MESSAGE_ID>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + subject: "<SUBJECT>", // optional + content: "<CONTENT>", // optional + draft: false, // optional + html: false, // optional + cc: new List<string>(), // optional + bcc: new List<string>(), // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional + attachments: new List<string>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..c7381ed28 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-fcm-provider.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + serviceAccountJSON: [object] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..95b8466d2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + apiKey: "<API_KEY>", // optional + domain: "example.com", // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..3652c6a0a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + templateId: "<TEMPLATE_ID>", // optional + senderId: "<SENDER_ID>", // optional + authKey: "<AUTH_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-push.md b/examples/2.0.x/server-dotnet/examples/messaging/update-push.md new file mode 100644 index 000000000..6a151cca7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-push.md @@ -0,0 +1,36 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.UpdatePush( + messageId: "<MESSAGE_ID>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + title: "<TITLE>", // optional + body: "<BODY>", // optional + data: [object], // optional + action: "<ACTION>", // optional + image: "<ID1:ID2>", // optional + icon: "<ICON>", // optional + sound: "<SOUND>", // optional + color: "<COLOR>", // optional + tag: "<TAG>", // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..9bef411a5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-resend-provider.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateResendProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..b98feaa13 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..982cd5493 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-ses-provider.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateSesProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + accessKey: "<ACCESS_KEY>", // optional + secretKey: "<SECRET_KEY>", // optional + region: "<REGION>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-sms.md b/examples/2.0.x/server-dotnet/examples/messaging/update-sms.md new file mode 100644 index 000000000..3d38d9fb6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-sms.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.UpdateSMS( + messageId: "<MESSAGE_ID>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + content: "<CONTENT>", // optional + draft: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..2d9da6ca5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-smtp-provider.md @@ -0,0 +1,31 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + host: "<HOST>", // optional + port: 1, // optional + username: "<USERNAME>", // optional + password: "password", // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: "<MAILER>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..5a7048b1e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-telesign-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + customerId: "<CUSTOMER_ID>", // optional + apiKey: "<API_KEY>", // optional + from: "<FROM>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..4f0a7a0dc --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + username: "<USERNAME>", // optional + apiKey: "<API_KEY>", // optional + from: "<FROM>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-topic.md b/examples/2.0.x/server-dotnet/examples/messaging/update-topic.md new file mode 100644 index 000000000..aa45f99bb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-topic.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Topic result = await messaging.UpdateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", // optional + subscribe: ["any"] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..a1d51e9e2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-twilio-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + accountSid: "<ACCOUNT_SID>", // optional + authToken: "<AUTH_TOKEN>", // optional + from: "<FROM>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-dotnet/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..d26a17dd8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/messaging/update-vonage-provider.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + from: "<FROM>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/organization/create-project.md b/examples/2.0.x/server-dotnet/examples/organization/create-project.md new file mode 100644 index 000000000..ac8e41be1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/organization/create-project.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +Project result = await organization.CreateProject( + projectId: "<PROJECT_ID>", + name: "<NAME>", + region: Region.Default // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/organization/delete-project.md b/examples/2.0.x/server-dotnet/examples/organization/delete-project.md new file mode 100644 index 000000000..df9eb153c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/organization/delete-project.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +await organization.DeleteProject( + projectId: "<PROJECT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/organization/get-project.md b/examples/2.0.x/server-dotnet/examples/organization/get-project.md new file mode 100644 index 000000000..3d64fe0c7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/organization/get-project.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +Project result = await organization.GetProject( + projectId: "<PROJECT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/organization/list-projects.md b/examples/2.0.x/server-dotnet/examples/organization/list-projects.md new file mode 100644 index 000000000..c61a3341a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/organization/list-projects.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +ProjectList result = await organization.ListProjects( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/organization/update-project.md b/examples/2.0.x/server-dotnet/examples/organization/update-project.md new file mode 100644 index 000000000..ae8e2664d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/organization/update-project.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +Project result = await organization.UpdateProject( + projectId: "<PROJECT_ID>", + name: "<NAME>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/presences/delete.md b/examples/2.0.x/server-dotnet/examples/presences/delete.md new file mode 100644 index 000000000..e3540674d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/presences/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +await presences.Delete( + presenceId: "<PRESENCE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/presences/get.md b/examples/2.0.x/server-dotnet/examples/presences/get.md new file mode 100644 index 000000000..85e7287ea --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/presences/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +Presence result = await presences.Get( + presenceId: "<PRESENCE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/presences/list.md b/examples/2.0.x/server-dotnet/examples/presences/list.md new file mode 100644 index 000000000..8285644ef --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/presences/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +PresenceList result = await presences.List( + queries: new List<string>(), // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/presences/update.md b/examples/2.0.x/server-dotnet/examples/presences/update.md new file mode 100644 index 000000000..ed55483b9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/presences/update.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +Presence result = await presences.Update( + presenceId: "<PRESENCE_ID>", + userId: "<USER_ID>", + status: "<STATUS>", // optional + expiresAt: "2020-10-15T06:38:00.000+00:00", // optional + metadata: [object], // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + purge: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/presences/upsert.md b/examples/2.0.x/server-dotnet/examples/presences/upsert.md new file mode 100644 index 000000000..b7868248a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/presences/upsert.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +Presence result = await presences.Upsert( + presenceId: "<PRESENCE_ID>", + userId: "<USER_ID>", + status: "<STATUS>", + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + expiresAt: "2020-10-15T06:38:00.000+00:00", // optional + metadata: [object] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-android-platform.md b/examples/2.0.x/server-dotnet/examples/project/create-android-platform.md new file mode 100644 index 000000000..df8dd6e0f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-android-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformAndroid result = await project.CreateAndroidPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + applicationId: "<APPLICATION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-apple-platform.md b/examples/2.0.x/server-dotnet/examples/project/create-apple-platform.md new file mode 100644 index 000000000..10dc58da1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-apple-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformApple result = await project.CreateApplePlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + bundleIdentifier: "<BUNDLE_IDENTIFIER>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-dotnet/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..5b6226bb8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-ephemeral-key.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +EphemeralKey result = await project.CreateEphemeralKey( + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, + duration: 600 +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-linux-platform.md b/examples/2.0.x/server-dotnet/examples/project/create-linux-platform.md new file mode 100644 index 000000000..7037a09c8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-linux-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformLinux result = await project.CreateLinuxPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageName: "<PACKAGE_NAME>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-mock-phone.md b/examples/2.0.x/server-dotnet/examples/project/create-mock-phone.md new file mode 100644 index 000000000..f8bb1bf57 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-mock-phone.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +MockNumber result = await project.CreateMockPhone( + number: "+12065550100", + otp: "<OTP>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-smtp-test.md b/examples/2.0.x/server-dotnet/examples/project/create-smtp-test.md new file mode 100644 index 000000000..d461c0cde --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-smtp-test.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + + result = await project.CreateSMTPTest( + emails: new List<string>() +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-variable.md b/examples/2.0.x/server-dotnet/examples/project/create-variable.md new file mode 100644 index 000000000..1e361c54b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-variable.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Variable result = await project.CreateVariable( + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-web-platform.md b/examples/2.0.x/server-dotnet/examples/project/create-web-platform.md new file mode 100644 index 000000000..83f148a03 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-web-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformWeb result = await project.CreateWebPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + hostname: "app.example.com" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/create-windows-platform.md b/examples/2.0.x/server-dotnet/examples/project/create-windows-platform.md new file mode 100644 index 000000000..01eb5b90f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/create-windows-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformWindows result = await project.CreateWindowsPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageIdentifierName: "<PACKAGE_IDENTIFIER_NAME>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/delete-key.md b/examples/2.0.x/server-dotnet/examples/project/delete-key.md new file mode 100644 index 000000000..258def649 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/delete-key.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +await project.DeleteKey( + keyId: "<KEY_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/delete-mock-phone.md b/examples/2.0.x/server-dotnet/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..c716be594 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/delete-mock-phone.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +await project.DeleteMockPhone( + number: "+12065550100" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/delete-platform.md b/examples/2.0.x/server-dotnet/examples/project/delete-platform.md new file mode 100644 index 000000000..77ddecdab --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/delete-platform.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +await project.DeletePlatform( + platformId: "<PLATFORM_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/delete-variable.md b/examples/2.0.x/server-dotnet/examples/project/delete-variable.md new file mode 100644 index 000000000..5ef1405e3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/delete-variable.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +await project.DeleteVariable( + variableId: "<VARIABLE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/delete.md b/examples/2.0.x/server-dotnet/examples/project/delete.md new file mode 100644 index 000000000..17f70c47f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/delete.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +await project.Delete(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/get-email-template.md b/examples/2.0.x/server-dotnet/examples/project/get-email-template.md new file mode 100644 index 000000000..11a331a21 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/get-email-template.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +EmailTemplate result = await project.GetEmailTemplate( + templateId: ProjectEmailTemplateId.Verification, + locale: ProjectEmailTemplateLocale.Af // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/get-key.md b/examples/2.0.x/server-dotnet/examples/project/get-key.md new file mode 100644 index 000000000..a84c4602f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/get-key.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Key result = await project.GetKey( + keyId: "<KEY_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/get-mock-phone.md b/examples/2.0.x/server-dotnet/examples/project/get-mock-phone.md new file mode 100644 index 000000000..43fea545d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/get-mock-phone.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +MockNumber result = await project.GetMockPhone( + number: "+12065550100" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-dotnet/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..ea55cb1eb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +object result = await project.GetOAuth2Provider( + providerId: ProjectOAuthProviderId.Amazon +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/get-platform.md b/examples/2.0.x/server-dotnet/examples/project/get-platform.md new file mode 100644 index 000000000..236eeb777 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/get-platform.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +object result = await project.GetPlatform( + platformId: "<PLATFORM_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/get-policy.md b/examples/2.0.x/server-dotnet/examples/project/get-policy.md new file mode 100644 index 000000000..ed4e8a5f8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/get-policy.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +object result = await project.GetPolicy( + policyId: ProjectPolicyId.PasswordDictionary +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/get-variable.md b/examples/2.0.x/server-dotnet/examples/project/get-variable.md new file mode 100644 index 000000000..bda49739d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/get-variable.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Variable result = await project.GetVariable( + variableId: "<VARIABLE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/get.md b/examples/2.0.x/server-dotnet/examples/project/get.md new file mode 100644 index 000000000..8dbf5a582 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/get.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.Get(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/list-email-templates.md b/examples/2.0.x/server-dotnet/examples/project/list-email-templates.md new file mode 100644 index 000000000..0cd3cad12 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/list-email-templates.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +EmailTemplateList result = await project.ListEmailTemplates( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/list-keys.md b/examples/2.0.x/server-dotnet/examples/project/list-keys.md new file mode 100644 index 000000000..f006dd194 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/list-keys.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +KeyList result = await project.ListKeys( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/list-mock-phones.md b/examples/2.0.x/server-dotnet/examples/project/list-mock-phones.md new file mode 100644 index 000000000..3fa07bdcb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/list-mock-phones.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +MockNumberList result = await project.ListMockPhones( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-dotnet/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..9d0e7eae9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2ProviderList result = await project.ListOAuth2Providers( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/list-platforms.md b/examples/2.0.x/server-dotnet/examples/project/list-platforms.md new file mode 100644 index 000000000..2a507c274 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/list-platforms.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformList result = await project.ListPlatforms( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/list-policies.md b/examples/2.0.x/server-dotnet/examples/project/list-policies.md new file mode 100644 index 000000000..bbd49b4c6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/list-policies.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PolicyList result = await project.ListPolicies( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/list-variables.md b/examples/2.0.x/server-dotnet/examples/project/list-variables.md new file mode 100644 index 000000000..e8107ab6c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/list-variables.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +VariableList result = await project.ListVariables( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-android-platform.md b/examples/2.0.x/server-dotnet/examples/project/update-android-platform.md new file mode 100644 index 000000000..77b78b571 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-android-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformAndroid result = await project.UpdateAndroidPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + applicationId: "<APPLICATION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-apple-platform.md b/examples/2.0.x/server-dotnet/examples/project/update-apple-platform.md new file mode 100644 index 000000000..fa9ec4623 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-apple-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformApple result = await project.UpdateApplePlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + bundleIdentifier: "<BUNDLE_IDENTIFIER>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-auth-method.md b/examples/2.0.x/server-dotnet/examples/project/update-auth-method.md new file mode 100644 index 000000000..0b180be24 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-auth-method.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateAuthMethod( + methodId: ProjectAuthMethodId.EmailPassword, + enabled: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-email-template.md b/examples/2.0.x/server-dotnet/examples/project/update-email-template.md new file mode 100644 index 000000000..2c4c747d2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-email-template.md @@ -0,0 +1,25 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +EmailTemplate result = await project.UpdateEmailTemplate( + templateId: ProjectEmailTemplateId.Verification, + locale: ProjectEmailTemplateLocale.Af, // optional + subject: "<SUBJECT>", // optional + message: "<MESSAGE>", // optional + senderName: "<SENDER_NAME>", // optional + senderEmail: "email@example.com", // optional + replyToEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-key.md b/examples/2.0.x/server-dotnet/examples/project/update-key.md new file mode 100644 index 000000000..619fca4b9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-key.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Key result = await project.UpdateKey( + keyId: "<KEY_ID>", + name: "<NAME>", + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead }, + expire: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-labels.md b/examples/2.0.x/server-dotnet/examples/project/update-labels.md new file mode 100644 index 000000000..2dfe3ea86 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-labels.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateLabels( + labels: new List<string>() +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-linux-platform.md b/examples/2.0.x/server-dotnet/examples/project/update-linux-platform.md new file mode 100644 index 000000000..0e0be47d5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-linux-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformLinux result = await project.UpdateLinuxPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageName: "<PACKAGE_NAME>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..3e6102f6d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateMembershipPrivacyPolicy( + userId: false, // optional + userEmail: false, // optional + userPhone: false, // optional + userName: false, // optional + userMFA: false, // optional + userAccessedAt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..aa9ed2a54 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateMFAFactorsPolicy( + totp: false, // optional + email: false, // optional + phone: false, // optional + custom: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-mock-phone.md b/examples/2.0.x/server-dotnet/examples/project/update-mock-phone.md new file mode 100644 index 000000000..e2c699e2b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-mock-phone.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +MockNumber result = await project.UpdateMockPhone( + number: "+12065550100", + otp: "<OTP>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..b104edf02 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Amazon result = await project.UpdateOAuth2Amazon( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..d36a2b983 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Apple result = await project.UpdateOAuth2Apple( + serviceId: "<SERVICE_ID>", // optional + keyId: "<KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + p8File: "<P8_FILE>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..cb38c52d7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Appwrite result = await project.UpdateOAuth2Appwrite( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..081f83231 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Auth0 result = await project.UpdateOAuth2Auth0( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + endpoint: "<ENDPOINT>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..75107594c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Authentik result = await project.UpdateOAuth2Authentik( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + endpoint: "<ENDPOINT>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..836fcc553 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Autodesk result = await project.UpdateOAuth2Autodesk( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..6a72900dd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Bitbucket result = await project.UpdateOAuth2Bitbucket( + key: "<KEY>", // optional + secret: "<SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..f46dd35a6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Bitly result = await project.UpdateOAuth2Bitly( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..1f331e2cb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-box.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Box result = await project.UpdateOAuth2Box( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..2c7fd8099 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Cloudflare result = await project.UpdateOAuth2Cloudflare( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..87c2c4785 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Dailymotion result = await project.UpdateOAuth2Dailymotion( + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..b6a92dbef --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Discord result = await project.UpdateOAuth2Discord( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..a7235621b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Disqus result = await project.UpdateOAuth2Disqus( + publicKey: "<PUBLIC_KEY>", // optional + secretKey: "<SECRET_KEY>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..16dd0f995 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Dropbox result = await project.UpdateOAuth2Dropbox( + appKey: "<APP_KEY>", // optional + appSecret: "<APP_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..7ffcb53fa --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Etsy result = await project.UpdateOAuth2Etsy( + keyString: "<KEY_STRING>", // optional + sharedSecret: "<SHARED_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..a1549973a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Facebook result = await project.UpdateOAuth2Facebook( + appId: "<APP_ID>", // optional + appSecret: "<APP_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..4c2e8bcd2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Figma result = await project.UpdateOAuth2Figma( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..d8515eeab --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2FusionAuth result = await project.UpdateOAuth2FusionAuth( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + endpoint: "<ENDPOINT>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..f57712e35 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Github result = await project.UpdateOAuth2GitHub( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..169b2ec84 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Gitlab result = await project.UpdateOAuth2Gitlab( + applicationId: "<APPLICATION_ID>", // optional + secret: "<SECRET>", // optional + endpoint: "https://example.com", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..ca4989401 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-google.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Google result = await project.UpdateOAuth2Google( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + prompt: new List<ProjectOAuth2GooglePrompt> { ProjectOAuth2GooglePrompt.None }, // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..350640d47 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2HuggingFace result = await project.UpdateOAuth2HuggingFace( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..67b036972 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Keycloak result = await project.UpdateOAuth2Keycloak( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + endpoint: "<ENDPOINT>", // optional + realmName: "<REALM_NAME>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..56cbef852 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Kick result = await project.UpdateOAuth2Kick( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..72c138421 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Linkedin result = await project.UpdateOAuth2Linkedin( + clientId: "<CLIENT_ID>", // optional + primaryClientSecret: "<PRIMARY_CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..8e5afa31b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Microsoft result = await project.UpdateOAuth2Microsoft( + applicationId: "<APPLICATION_ID>", // optional + applicationSecret: "<APPLICATION_SECRET>", // optional + tenant: "<TENANT>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..a3cb77633 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Notion result = await project.UpdateOAuth2Notion( + oauthClientId: "<OAUTH_CLIENT_ID>", // optional + oauthClientSecret: "<OAUTH_CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..5abb49326 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,26 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Oidc result = await project.UpdateOAuth2Oidc( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + wellKnownURL: "https://example.com", // optional + authorizationURL: "https://example.com", // optional + tokenURL: "https://example.com", // optional + userInfoURL: "https://example.com", // optional + prompt: new List<ProjectOAuth2OidcPrompt> { ProjectOAuth2OidcPrompt.None }, // optional + maxAge: 0, // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..fa2a11515 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Okta result = await project.UpdateOAuth2Okta( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + domain: "example.com", // optional + authorizationServerId: "<AUTHORIZATION_SERVER_ID>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..1cbc8c572 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Paypal result = await project.UpdateOAuth2PaypalSandbox( + clientId: "<CLIENT_ID>", // optional + secretKey: "<SECRET_KEY>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..03fc66593 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Paypal result = await project.UpdateOAuth2Paypal( + clientId: "<CLIENT_ID>", // optional + secretKey: "<SECRET_KEY>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..9e8b31f6c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Podio result = await project.UpdateOAuth2Podio( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..3fd799220 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Resend result = await project.UpdateOAuth2Resend( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..e4b6629c1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Salesforce result = await project.UpdateOAuth2Salesforce( + customerKey: "<CUSTOMER_KEY>", // optional + customerSecret: "<CUSTOMER_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..1d7cc149d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Slack result = await project.UpdateOAuth2Slack( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..481634e40 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Spotify result = await project.UpdateOAuth2Spotify( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..97ce54a17 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Stripe result = await project.UpdateOAuth2Stripe( + clientId: "<CLIENT_ID>", // optional + apiSecretKey: "<API_SECRET_KEY>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..72ab7c5a5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Tradeshift result = await project.UpdateOAuth2TradeshiftSandbox( + oauth2ClientId: "<OAUTH2_CLIENT_ID>", // optional + oauth2ClientSecret: "<OAUTH2_CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..01edc689f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Tradeshift result = await project.UpdateOAuth2Tradeshift( + oauth2ClientId: "<OAUTH2_CLIENT_ID>", // optional + oauth2ClientSecret: "<OAUTH2_CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..405b7dc70 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Twitch result = await project.UpdateOAuth2Twitch( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..60bbdfcf9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2WordPress result = await project.UpdateOAuth2WordPress( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..127f97867 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Yahoo result = await project.UpdateOAuth2Yahoo( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..0fcc0dc76 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Yandex result = await project.UpdateOAuth2Yandex( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..6347cb2bb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Zoho result = await project.UpdateOAuth2Zoho( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..2b9d60dd6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2Zoom result = await project.UpdateOAuth2Zoom( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..01bab1404 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-o-auth-2x.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +OAuth2X result = await project.UpdateOAuth2X( + customerKey: "<CUSTOMER_KEY>", // optional + secretKey: "<SECRET_KEY>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..bfcf1c3d4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdatePasswordDictionaryPolicy( + enabled: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-password-history-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..838761546 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-password-history-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdatePasswordHistoryPolicy( + total: 1 +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..e79919f28 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdatePasswordPersonalDataPolicy( + enabled: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..7edf30509 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-password-strength-policy.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PolicyPasswordStrength result = await project.UpdatePasswordStrengthPolicy( + min: 8, // optional + uppercase: false, // optional + lowercase: false, // optional + number: false, // optional + symbols: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-protocol.md b/examples/2.0.x/server-dotnet/examples/project/update-protocol.md new file mode 100644 index 000000000..9a53240a8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-protocol.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateProtocol( + protocolId: ProjectProtocolId.Rest, + enabled: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-service.md b/examples/2.0.x/server-dotnet/examples/project/update-service.md new file mode 100644 index 000000000..8463028b4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-service.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateService( + serviceId: ProjectServiceId.Account, + enabled: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..247fe3ced --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-session-alert-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateSessionAlertPolicy( + enabled: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..1c66cc204 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-session-duration-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateSessionDurationPolicy( + duration: 60 +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..e354b471f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateSessionInvalidationPolicy( + enabled: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..11434253c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-session-limit-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateSessionLimitPolicy( + total: 1 +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-smtp.md b/examples/2.0.x/server-dotnet/examples/project/update-smtp.md new file mode 100644 index 000000000..4af1ceeed --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-smtp.md @@ -0,0 +1,27 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateSMTP( + host: "example.com", // optional + port: 587, // optional + username: "<USERNAME>", // optional + password: "password", // optional + senderEmail: "email@example.com", // optional + senderName: "<SENDER_NAME>", // optional + replyToEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + secure: ProjectSMTPSecure.Tls, // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-dotnet/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..d24957e0c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-user-limit-policy.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Project result = await project.UpdateUserLimitPolicy( + total: 0 +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-variable.md b/examples/2.0.x/server-dotnet/examples/project/update-variable.md new file mode 100644 index 000000000..b612ed863 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-variable.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +Variable result = await project.UpdateVariable( + variableId: "<VARIABLE_ID>", + key: "<KEY>", // optional + value: "<VALUE>", // optional + secret: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-web-platform.md b/examples/2.0.x/server-dotnet/examples/project/update-web-platform.md new file mode 100644 index 000000000..3d03f26d2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-web-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformWeb result = await project.UpdateWebPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + hostname: "app.example.com" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/project/update-windows-platform.md b/examples/2.0.x/server-dotnet/examples/project/update-windows-platform.md new file mode 100644 index 000000000..64e219981 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/project/update-windows-platform.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +PlatformWindows result = await project.UpdateWindowsPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageIdentifierName: "<PACKAGE_IDENTIFIER_NAME>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/proxy/create-api-rule.md b/examples/2.0.x/server-dotnet/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..a5511bd39 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/proxy/create-api-rule.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +ProxyRule result = await proxy.CreateAPIRule( + domain: "example.com" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/proxy/create-function-rule.md b/examples/2.0.x/server-dotnet/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..fe1fd9067 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/proxy/create-function-rule.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +ProxyRule result = await proxy.CreateFunctionRule( + domain: "example.com", + functionId: "<FUNCTION_ID>", + branch: "<BRANCH>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-dotnet/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..71ffbefed --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/proxy/create-redirect-rule.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +ProxyRule result = await proxy.CreateRedirectRule( + domain: "example.com", + url: "https://example.com", + statusCode: StatusCode.MovedPermanently, + resourceId: "<RESOURCE_ID>", + resourceType: ProxyResourceType.Site +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/proxy/create-site-rule.md b/examples/2.0.x/server-dotnet/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..52b6b60e7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/proxy/create-site-rule.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +ProxyRule result = await proxy.CreateSiteRule( + domain: "example.com", + siteId: "<SITE_ID>", + branch: "<BRANCH>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/proxy/delete-rule.md b/examples/2.0.x/server-dotnet/examples/proxy/delete-rule.md new file mode 100644 index 000000000..d9e9b1605 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/proxy/delete-rule.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +await proxy.DeleteRule( + ruleId: "<RULE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/proxy/get-rule.md b/examples/2.0.x/server-dotnet/examples/proxy/get-rule.md new file mode 100644 index 000000000..6834db740 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/proxy/get-rule.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +ProxyRule result = await proxy.GetRule( + ruleId: "<RULE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/proxy/list-rules.md b/examples/2.0.x/server-dotnet/examples/proxy/list-rules.md new file mode 100644 index 000000000..4a962d304 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/proxy/list-rules.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +ProxyRuleList result = await proxy.ListRules( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/proxy/update-rule-status.md b/examples/2.0.x/server-dotnet/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..da3efe372 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/proxy/update-rule-status.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +ProxyRule result = await proxy.UpdateRuleStatus( + ruleId: "<RULE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/create-deployment.md b/examples/2.0.x/server-dotnet/examples/sites/create-deployment.md new file mode 100644 index 000000000..61b562686 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/create-deployment.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.CreateDeployment( + siteId: "<SITE_ID>", + code: InputFile.FromPath("./path-to-files/image.jpg"), + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + activate: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-dotnet/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..22c70c1d6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.CreateDuplicateDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/create-template-deployment.md b/examples/2.0.x/server-dotnet/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..769fcc1c1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/create-template-deployment.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.CreateTemplateDeployment( + siteId: "<SITE_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + type: TemplateReferenceType.Branch, + reference: "<REFERENCE>", + activate: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/create-variable.md b/examples/2.0.x/server-dotnet/examples/sites/create-variable.md new file mode 100644 index 000000000..9e9d1ef73 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/create-variable.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Variable result = await sites.CreateVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-dotnet/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..42ec3756c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/create-vcs-deployment.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.CreateVcsDeployment( + siteId: "<SITE_ID>", + type: VCSReferenceType.Branch, + reference: "<REFERENCE>", + activate: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/create.md b/examples/2.0.x/server-dotnet/examples/sites/create.md new file mode 100644 index 000000000..9b2d5b52e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/create.md @@ -0,0 +1,41 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Site result = await sites.Create( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: Framework.Analog, + buildRuntime: BuildRuntime.Node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + startCommand: "<START_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + adapter: Adapter.Static, // optional + installationId: "<INSTALLATION_ID>", // optional + fallbackFile: "<FALLBACK_FILE>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches: new List<string>(), // optional + providerPaths: new List<string>(), // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0, // optional + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead } // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/delete-deployment.md b/examples/2.0.x/server-dotnet/examples/sites/delete-deployment.md new file mode 100644 index 000000000..be1440888 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/delete-deployment.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +await sites.DeleteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/delete-log.md b/examples/2.0.x/server-dotnet/examples/sites/delete-log.md new file mode 100644 index 000000000..576be3fb4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/delete-log.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +await sites.DeleteLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/delete-variable.md b/examples/2.0.x/server-dotnet/examples/sites/delete-variable.md new file mode 100644 index 000000000..0d7d68bed --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/delete-variable.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +await sites.DeleteVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/delete.md b/examples/2.0.x/server-dotnet/examples/sites/delete.md new file mode 100644 index 000000000..80510f15f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +await sites.Delete( + siteId: "<SITE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/get-deployment-download.md b/examples/2.0.x/server-dotnet/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..e4f0985b6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/get-deployment-download.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +byte[] result = await sites.GetDeploymentDownload( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: DeploymentDownloadType.Source, // optional + token: "<TOKEN>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/get-deployment.md b/examples/2.0.x/server-dotnet/examples/sites/get-deployment.md new file mode 100644 index 000000000..dfd86dfc0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/get-deployment.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.GetDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/get-log.md b/examples/2.0.x/server-dotnet/examples/sites/get-log.md new file mode 100644 index 000000000..caa38be7a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/get-log.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Execution result = await sites.GetLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/get-variable.md b/examples/2.0.x/server-dotnet/examples/sites/get-variable.md new file mode 100644 index 000000000..9a68b6615 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/get-variable.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Variable result = await sites.GetVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/get.md b/examples/2.0.x/server-dotnet/examples/sites/get.md new file mode 100644 index 000000000..7c1885cb2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Site result = await sites.Get( + siteId: "<SITE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/list-deployments.md b/examples/2.0.x/server-dotnet/examples/sites/list-deployments.md new file mode 100644 index 000000000..b25172e26 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/list-deployments.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +DeploymentList result = await sites.ListDeployments( + siteId: "<SITE_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/list-frameworks.md b/examples/2.0.x/server-dotnet/examples/sites/list-frameworks.md new file mode 100644 index 000000000..7a3165f9f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/list-frameworks.md @@ -0,0 +1,16 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +FrameworkList result = await sites.ListFrameworks(); + + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/list-logs.md b/examples/2.0.x/server-dotnet/examples/sites/list-logs.md new file mode 100644 index 000000000..baee6c918 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/list-logs.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +ExecutionList result = await sites.ListLogs( + siteId: "<SITE_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/list-specifications.md b/examples/2.0.x/server-dotnet/examples/sites/list-specifications.md new file mode 100644 index 000000000..12d184080 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/list-specifications.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +SpecificationList result = await sites.ListSpecifications( + type: "runtimes" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/list-variables.md b/examples/2.0.x/server-dotnet/examples/sites/list-variables.md new file mode 100644 index 000000000..8f546817c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/list-variables.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +VariableList result = await sites.ListVariables( + siteId: "<SITE_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/list.md b/examples/2.0.x/server-dotnet/examples/sites/list.md new file mode 100644 index 000000000..27c4f6594 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +SiteList result = await sites.List( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/update-deployment-status.md b/examples/2.0.x/server-dotnet/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..0a6bf240c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/update-deployment-status.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.UpdateDeploymentStatus( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/update-site-deployment.md b/examples/2.0.x/server-dotnet/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..8633ab7ea --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/update-site-deployment.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Site result = await sites.UpdateSiteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/update-variable.md b/examples/2.0.x/server-dotnet/examples/sites/update-variable.md new file mode 100644 index 000000000..e7236cef6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/update-variable.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Variable result = await sites.UpdateVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", // optional + value: "<VALUE>", // optional + secret: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/sites/update.md b/examples/2.0.x/server-dotnet/examples/sites/update.md new file mode 100644 index 000000000..8c8128411 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/sites/update.md @@ -0,0 +1,41 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Site result = await sites.Update( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: Framework.Analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + startCommand: "<START_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + buildRuntime: BuildRuntime.Node145, // optional + adapter: Adapter.Static, // optional + fallbackFile: "<FALLBACK_FILE>", // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches: new List<string>(), // optional + providerPaths: new List<string>(), // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0, // optional + scopes: new List<ProjectKeyScopes> { ProjectKeyScopes.ProjectRead } // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/create-bucket.md b/examples/2.0.x/server-dotnet/examples/storage/create-bucket.md new file mode 100644 index 000000000..bdbd46a9e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/create-bucket.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +Bucket result = await storage.CreateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: new List<string>(), // optional + compression: Compression.None, // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/create-file.md b/examples/2.0.x/server-dotnet/examples/storage/create-file.md new file mode 100644 index 000000000..32cbd1d35 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/create-file.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +File result = await storage.CreateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + file: InputFile.FromPath("./path-to-files/image.jpg"), + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + folder: "photos/2026" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/delete-bucket.md b/examples/2.0.x/server-dotnet/examples/storage/delete-bucket.md new file mode 100644 index 000000000..7203b3fbf --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/delete-bucket.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +await storage.DeleteBucket( + bucketId: "<BUCKET_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/delete-file.md b/examples/2.0.x/server-dotnet/examples/storage/delete-file.md new file mode 100644 index 000000000..cc540d6db --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/delete-file.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +await storage.DeleteFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/get-bucket.md b/examples/2.0.x/server-dotnet/examples/storage/get-bucket.md new file mode 100644 index 000000000..8c1edda21 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/get-bucket.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +Bucket result = await storage.GetBucket( + bucketId: "<BUCKET_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/get-file-download.md b/examples/2.0.x/server-dotnet/examples/storage/get-file-download.md new file mode 100644 index 000000000..0cb454752 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/get-file-download.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +byte[] result = await storage.GetFileDownload( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/get-file-preview.md b/examples/2.0.x/server-dotnet/examples/storage/get-file-preview.md new file mode 100644 index 000000000..0f8ae58de --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/get-file-preview.md @@ -0,0 +1,31 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +byte[] result = await storage.GetFilePreview( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: "FFFFFF", // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: "FFFFFF", // optional + output: ImageFormat.Jpg, // optional + token: "<TOKEN>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/get-file-view.md b/examples/2.0.x/server-dotnet/examples/storage/get-file-view.md new file mode 100644 index 000000000..5639caef2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/get-file-view.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +byte[] result = await storage.GetFileView( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/get-file.md b/examples/2.0.x/server-dotnet/examples/storage/get-file.md new file mode 100644 index 000000000..925a7b5d4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/get-file.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +File result = await storage.GetFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/list-buckets.md b/examples/2.0.x/server-dotnet/examples/storage/list-buckets.md new file mode 100644 index 000000000..df2145676 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/list-buckets.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +BucketList result = await storage.ListBuckets( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/list-files.md b/examples/2.0.x/server-dotnet/examples/storage/list-files.md new file mode 100644 index 000000000..756aeb9f9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/list-files.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +FileList result = await storage.ListFiles( + bucketId: "<BUCKET_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/update-bucket.md b/examples/2.0.x/server-dotnet/examples/storage/update-bucket.md new file mode 100644 index 000000000..6e31cb359 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/update-bucket.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +Bucket result = await storage.UpdateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: new List<string>(), // optional + compression: Compression.None, // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/storage/update-file.md b/examples/2.0.x/server-dotnet/examples/storage/update-file.md new file mode 100644 index 000000000..a2b7013c3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/storage/update-file.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +File result = await storage.UpdateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + name: "<NAME>", // optional + permissions: new List<string> { Permission.Read(Role.Any()) } // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..9849dc441 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnBigint result = await tablesDB.CreateBigIntColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 1000000, // optional + default: 0, // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..d4d177674 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnBoolean result = await tablesDB.CreateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: false, // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..0739c6cfa --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnDatetime result = await tablesDB.CreateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..b5879ca47 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-email-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnEmail result = await tablesDB.CreateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..7a855e5dd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-enum-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnEnum result = await tablesDB.CreateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..8d7293a50 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-float-column.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnFloat result = await tablesDB.CreateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 100, // optional + default: 10.5, // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-index.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-index.md new file mode 100644 index 000000000..df5d61e3e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-index.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIndex result = await tablesDB.CreateIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + type: TablesDBIndexType.Key, + columns: new List<string>(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List<long>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..60ecc4c1a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-integer-column.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnInteger result = await tablesDB.CreateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 100, // optional + default: 10, // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..dea6f8a0f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-ip-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIp result = await tablesDB.CreateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..3f7ae3387 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-line-column.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnLine result = await tablesDB.CreateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..7f63f462e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnLongtext result = await tablesDB.CreateLongtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..f834cf246 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnMediumtext result = await tablesDB.CreateMediumtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-operations.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..e7e92df13 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-operations.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Transaction result = await tablesDB.CreateOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..aa787a482 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-point-column.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPoint result = await tablesDB.CreatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [1, 2] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..c667492ff --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPolygon result = await tablesDB.CreatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..2ad3e3659 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,25 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnRelationship result = await tablesDB.CreateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + relatedTableId: "<RELATED_TABLE_ID>", + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: "<KEY>", // optional + twoWayKey: "<TWO_WAY_KEY>", // optional + onDelete: RelationMutate.Cascade // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-row.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-row.md new file mode 100644 index 000000000..05cbe3ce5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-row.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.CreateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-rows.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..868c515a7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-rows.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +RowList result = await tablesDB.CreateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: new List<object>(), + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..70d552835 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-string-column.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnString result = await tablesDB.CreateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-table.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-table.md new file mode 100644 index 000000000..f7781fc7b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-table.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Table result = await tablesDB.CreateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + rowSecurity: false, // optional + enabled: false, // optional + columns: new List<object>(), // optional + indexes: new List<object>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..ae046a6ae --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-text-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnText result = await tablesDB.CreateTextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..cc3845f05 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Transaction result = await tablesDB.CreateTransaction( + ttl: 60 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..de79303f9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-url-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnUrl result = await tablesDB.CreateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", // optional + array: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..507c8dd4f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnVarchar result = await tablesDB.CreateVarcharColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/create.md b/examples/2.0.x/server-dotnet/examples/tablesdb/create.md new file mode 100644 index 000000000..6d01afb1c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/create.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Database result = await tablesDB.Create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..c7a970202 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.DecrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "<COLUMN>", + value: 1, // optional + min: 0, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/delete-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..fbb622536 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-column.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/delete-index.md b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..ccf44a5ff --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-index.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/delete-row.md b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..51c0168e9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-row.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..1cfdfe72b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-rows.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/delete-table.md b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..486d1cfde --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-table.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..1fc1ced43 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/delete-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteTransaction( + transactionId: "<TRANSACTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/delete.md b/examples/2.0.x/server-dotnet/examples/tablesdb/delete.md new file mode 100644 index 000000000..8af9ed67a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.Delete( + databaseId: "<DATABASE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/get-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/get-column.md new file mode 100644 index 000000000..c0d9c0423 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/get-column.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +object result = await tablesDB.GetColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/get-index.md b/examples/2.0.x/server-dotnet/examples/tablesdb/get-index.md new file mode 100644 index 000000000..45cb48260 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/get-index.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIndex result = await tablesDB.GetIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/get-row.md b/examples/2.0.x/server-dotnet/examples/tablesdb/get-row.md new file mode 100644 index 000000000..83c1f61e9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/get-row.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.GetRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/get-table.md b/examples/2.0.x/server-dotnet/examples/tablesdb/get-table.md new file mode 100644 index 000000000..e5f5c4e45 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/get-table.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Table result = await tablesDB.GetTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-dotnet/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..9bfeeb636 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/get-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Transaction result = await tablesDB.GetTransaction( + transactionId: "<TRANSACTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/get.md b/examples/2.0.x/server-dotnet/examples/tablesdb/get.md new file mode 100644 index 000000000..daa759aba --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Database result = await tablesDB.Get( + databaseId: "<DATABASE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..16d13fbc7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/increment-row-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.IncrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "<COLUMN>", + value: 1, // optional + max: 100, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/list-columns.md b/examples/2.0.x/server-dotnet/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..fdb00a25b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/list-columns.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnList result = await tablesDB.ListColumns( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-dotnet/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..f2b039a4a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/list-indexes.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIndexList result = await tablesDB.ListIndexes( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/list-rows.md b/examples/2.0.x/server-dotnet/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..66e085fd9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/list-rows.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +RowList result = await tablesDB.ListRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/list-tables.md b/examples/2.0.x/server-dotnet/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..89c2e7b52 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/list-tables.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +TableList result = await tablesDB.ListTables( + databaseId: "<DATABASE_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-dotnet/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..6d7db9ab0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/list-transactions.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +TransactionList result = await tablesDB.ListTransactions( + queries: new List<string>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/list.md b/examples/2.0.x/server-dotnet/examples/tablesdb/list.md new file mode 100644 index 000000000..6f0829307 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +DatabaseList result = await tablesDB.List( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..381d02b26 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnBigint result = await tablesDB.UpdateBigIntColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 0, + min: 0, // optional + max: 1000000, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..5f7685ec2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnBoolean result = await tablesDB.UpdateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: false, + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..f659279c1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnDatetime result = await tablesDB.UpdateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..c8f5d9127 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-email-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnEmail result = await tablesDB.UpdateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..404fc413d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-enum-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnEnum result = await tablesDB.UpdateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..7983743ea --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-float-column.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnFloat result = await tablesDB.UpdateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 10.5, + min: 0, // optional + max: 100, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..22b8ab205 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-integer-column.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnInteger result = await tablesDB.UpdateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 10, + min: 0, // optional + max: 100, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..30a9c595b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-ip-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIp result = await tablesDB.UpdateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..91291e3f6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-line-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnLine result = await tablesDB.UpdateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..c240a4965 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnLongtext result = await tablesDB.UpdateLongtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..592d8afac --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnMediumtext result = await tablesDB.UpdateMediumtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..4e2dcc07a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-point-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPoint result = await tablesDB.UpdatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [1, 2], // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..5ecd1b806 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPolygon result = await tablesDB.UpdatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..8d75dd0a0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnRelationship result = await tablesDB.UpdateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + onDelete: RelationMutate.Cascade, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-row.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-row.md new file mode 100644 index 000000000..03f71f613 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-row.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.UpdateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 33, + isAdmin = false + }, // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-rows.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..9e4c497bd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-rows.md @@ -0,0 +1,27 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +RowList result = await tablesDB.UpdateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 33, + isAdmin = false + }, // optional + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..bf0849e2f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-string-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnString result = await tablesDB.UpdateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-table.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-table.md new file mode 100644 index 000000000..e7a228214 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-table.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Table result = await tablesDB.UpdateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + rowSecurity: false, // optional + enabled: false, // optional + purge: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..0ee26e042 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-text-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnText result = await tablesDB.UpdateTextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..2010f673b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-transaction.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Transaction result = await tablesDB.UpdateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, // optional + rollback: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..f32ce01a6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-url-column.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnUrl result = await tablesDB.UpdateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..3cd1f9c09 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnVarchar result = await tablesDB.UpdateVarcharColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, // optional + newKey: "<NEW_KEY>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/update.md b/examples/2.0.x/server-dotnet/examples/tablesdb/update.md new file mode 100644 index 000000000..40b234c0d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/update.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Database result = await tablesDB.Update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-dotnet/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..ef38e305a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/upsert-row.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.UpsertRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 33, + isAdmin = false + }, // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-dotnet/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..41d3bcd8c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tablesdb/upsert-rows.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +RowList result = await tablesDB.UpsertRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: new List<object>(), + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/create-membership.md b/examples/2.0.x/server-dotnet/examples/teams/create-membership.md new file mode 100644 index 000000000..1092050b5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/create-membership.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Membership result = await teams.CreateMembership( + teamId: "<TEAM_ID>", + roles: new List<string>(), + email: "email@example.com", // optional + userId: "<USER_ID>", // optional + phone: "+12065550100", // optional + url: "https://example.com", // optional + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/create.md b/examples/2.0.x/server-dotnet/examples/teams/create.md new file mode 100644 index 000000000..fdc1e09cb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/create.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Team result = await teams.Create( + teamId: "<TEAM_ID>", + name: "<NAME>", + roles: new List<string>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/delete-membership.md b/examples/2.0.x/server-dotnet/examples/teams/delete-membership.md new file mode 100644 index 000000000..e7b8bb31d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/delete-membership.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +await teams.DeleteMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/delete.md b/examples/2.0.x/server-dotnet/examples/teams/delete.md new file mode 100644 index 000000000..b10544185 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +await teams.Delete( + teamId: "<TEAM_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/get-membership.md b/examples/2.0.x/server-dotnet/examples/teams/get-membership.md new file mode 100644 index 000000000..f359df1a6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/get-membership.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Membership result = await teams.GetMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/get-prefs.md b/examples/2.0.x/server-dotnet/examples/teams/get-prefs.md new file mode 100644 index 000000000..95a8c2880 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/get-prefs.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Preferences result = await teams.GetPrefs( + teamId: "<TEAM_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/get.md b/examples/2.0.x/server-dotnet/examples/teams/get.md new file mode 100644 index 000000000..900d932d5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Team result = await teams.Get( + teamId: "<TEAM_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/list-memberships.md b/examples/2.0.x/server-dotnet/examples/teams/list-memberships.md new file mode 100644 index 000000000..64c25747f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/list-memberships.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +MembershipList result = await teams.ListMemberships( + teamId: "<TEAM_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/list.md b/examples/2.0.x/server-dotnet/examples/teams/list.md new file mode 100644 index 000000000..571c86634 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +TeamList result = await teams.List( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/update-membership-status.md b/examples/2.0.x/server-dotnet/examples/teams/update-membership-status.md new file mode 100644 index 000000000..1f172dab3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/update-membership-status.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Membership result = await teams.UpdateMembershipStatus( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + userId: "<USER_ID>", + secret: "<SECRET>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/update-membership.md b/examples/2.0.x/server-dotnet/examples/teams/update-membership.md new file mode 100644 index 000000000..ff4ad455e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/update-membership.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Membership result = await teams.UpdateMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + roles: new List<string>() +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/update-name.md b/examples/2.0.x/server-dotnet/examples/teams/update-name.md new file mode 100644 index 000000000..6f42ce5cb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/update-name.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Team result = await teams.UpdateName( + teamId: "<TEAM_ID>", + name: "<NAME>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/teams/update-prefs.md b/examples/2.0.x/server-dotnet/examples/teams/update-prefs.md new file mode 100644 index 000000000..b2dbac7ac --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/teams/update-prefs.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Preferences result = await teams.UpdatePrefs( + teamId: "<TEAM_ID>", + prefs: [object] +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tokens/create-file-token.md b/examples/2.0.x/server-dotnet/examples/tokens/create-file-token.md new file mode 100644 index 000000000..baf4c376e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tokens/create-file-token.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +ResourceToken result = await tokens.CreateFileToken( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + expire: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tokens/delete.md b/examples/2.0.x/server-dotnet/examples/tokens/delete.md new file mode 100644 index 000000000..9b1863587 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tokens/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +await tokens.Delete( + tokenId: "<TOKEN_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tokens/get.md b/examples/2.0.x/server-dotnet/examples/tokens/get.md new file mode 100644 index 000000000..5466ae879 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tokens/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +ResourceToken result = await tokens.Get( + tokenId: "<TOKEN_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tokens/list.md b/examples/2.0.x/server-dotnet/examples/tokens/list.md new file mode 100644 index 000000000..45e027d49 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tokens/list.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +ResourceTokenList result = await tokens.List( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/tokens/update.md b/examples/2.0.x/server-dotnet/examples/tokens/update.md new file mode 100644 index 000000000..041dce974 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/tokens/update.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +ResourceToken result = await tokens.Update( + tokenId: "<TOKEN_ID>", + expire: "2020-10-15T06:38:00.000+00:00" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-argon-2-user.md b/examples/2.0.x/server-dotnet/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..6c4ba6355 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-argon-2-user.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateArgon2User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-dotnet/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..d4a70e5bd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-bcrypt-user.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateBcryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-jwt.md b/examples/2.0.x/server-dotnet/examples/users/create-jwt.md new file mode 100644 index 000000000..0841f4eaf --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-jwt.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +JWT result = await users.CreateJWT( + userId: "<USER_ID>", + sessionId: "recent()", // optional + duration: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-md-5-user.md b/examples/2.0.x/server-dotnet/examples/users/create-md-5-user.md new file mode 100644 index 000000000..268257113 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-md-5-user.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateMD5User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-dotnet/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..02a34ab97 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-dotnet/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..efcc9f273 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-ph-pass-user.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreatePHPassUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-dotnet/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..687282b20 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateScryptModifiedUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordSaltSeparator: "<PASSWORD_SALT_SEPARATOR>", + passwordSignerKey: "<PASSWORD_SIGNER_KEY>", + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-scrypt-user.md b/examples/2.0.x/server-dotnet/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..ee7e61a12 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-scrypt-user.md @@ -0,0 +1,25 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateScryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-session.md b/examples/2.0.x/server-dotnet/examples/users/create-session.md new file mode 100644 index 000000000..5ca7121fb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-session.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Session result = await users.CreateSession( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-sha-user.md b/examples/2.0.x/server-dotnet/examples/users/create-sha-user.md new file mode 100644 index 000000000..8dd3a160c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-sha-user.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateSHAUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordVersion: PasswordHash.Sha1, // optional + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-target.md b/examples/2.0.x/server-dotnet/examples/users/create-target.md new file mode 100644 index 000000000..281996df0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-target.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Target result = await users.CreateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + providerType: MessagingProviderType.Email, + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>", // optional + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create-token.md b/examples/2.0.x/server-dotnet/examples/users/create-token.md new file mode 100644 index 000000000..3d9293469 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create-token.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Token result = await users.CreateToken( + userId: "<USER_ID>", + length: 4, // optional + expire: 60 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/create.md b/examples/2.0.x/server-dotnet/examples/users/create.md new file mode 100644 index 000000000..fb2a8095a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/create.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.Create( + userId: "<USER_ID>", + email: "email@example.com", // optional + phone: "+12065550100", // optional + password: "password", // optional + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/delete-identity.md b/examples/2.0.x/server-dotnet/examples/users/delete-identity.md new file mode 100644 index 000000000..bc55fed85 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/delete-identity.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteIdentity( + identityId: "<IDENTITY_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-dotnet/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..82ddb00f1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteMFAAuthenticator( + userId: "<USER_ID>", + type: AuthenticatorType.Totp +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/delete-session.md b/examples/2.0.x/server-dotnet/examples/users/delete-session.md new file mode 100644 index 000000000..c0cbbf02e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/delete-session.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteSession( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/delete-sessions.md b/examples/2.0.x/server-dotnet/examples/users/delete-sessions.md new file mode 100644 index 000000000..6fcb9d0cf --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/delete-sessions.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteSessions( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/delete-target.md b/examples/2.0.x/server-dotnet/examples/users/delete-target.md new file mode 100644 index 000000000..b496d6452 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/delete-target.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/delete.md b/examples/2.0.x/server-dotnet/examples/users/delete.md new file mode 100644 index 000000000..426c3007f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.Delete( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-dotnet/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..98f2131b3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/get-mfa-challenge.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaChallengeSecret result = await users.GetMFAChallenge( + userId: "<USER_ID>", + challengeId: "<CHALLENGE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-dotnet/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..b2c1e98a1 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaRecoveryCodes result = await users.GetMFARecoveryCodes( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/get-prefs.md b/examples/2.0.x/server-dotnet/examples/users/get-prefs.md new file mode 100644 index 000000000..70f55411f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/get-prefs.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Preferences result = await users.GetPrefs( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/get-target.md b/examples/2.0.x/server-dotnet/examples/users/get-target.md new file mode 100644 index 000000000..3011e5699 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/get-target.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Target result = await users.GetTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/get.md b/examples/2.0.x/server-dotnet/examples/users/get.md new file mode 100644 index 000000000..047ed83cb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.Get( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/list-identities.md b/examples/2.0.x/server-dotnet/examples/users/list-identities.md new file mode 100644 index 000000000..08ee96bdb --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/list-identities.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +IdentityList result = await users.ListIdentities( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/list-memberships.md b/examples/2.0.x/server-dotnet/examples/users/list-memberships.md new file mode 100644 index 000000000..ad3e77a29 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/list-memberships.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MembershipList result = await users.ListMemberships( + userId: "<USER_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/list-mfa-factors.md b/examples/2.0.x/server-dotnet/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..c1f7365e8 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/list-mfa-factors.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaFactors result = await users.ListMFAFactors( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/list-sessions.md b/examples/2.0.x/server-dotnet/examples/users/list-sessions.md new file mode 100644 index 000000000..495939567 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/list-sessions.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +SessionList result = await users.ListSessions( + userId: "<USER_ID>", + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/list-targets.md b/examples/2.0.x/server-dotnet/examples/users/list-targets.md new file mode 100644 index 000000000..d867b06f0 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/list-targets.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +TargetList result = await users.ListTargets( + userId: "<USER_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/list.md b/examples/2.0.x/server-dotnet/examples/users/list.md new file mode 100644 index 000000000..8f0ad9d5e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +UserList result = await users.List( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-email-verification.md b/examples/2.0.x/server-dotnet/examples/users/update-email-verification.md new file mode 100644 index 000000000..0f6233c38 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-email-verification.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateEmailVerification( + userId: "<USER_ID>", + emailVerification: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-email.md b/examples/2.0.x/server-dotnet/examples/users/update-email.md new file mode 100644 index 000000000..be7bc521e --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-email.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateEmail( + userId: "<USER_ID>", + email: "email@example.com" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-impersonator.md b/examples/2.0.x/server-dotnet/examples/users/update-impersonator.md new file mode 100644 index 000000000..91d94e783 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-impersonator.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateImpersonator( + userId: "<USER_ID>", + impersonator: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-labels.md b/examples/2.0.x/server-dotnet/examples/users/update-labels.md new file mode 100644 index 000000000..f6c0b5547 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-labels.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateLabels( + userId: "<USER_ID>", + labels: new List<string>() +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-dotnet/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..78018690d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( + userId: "<USER_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-mfa.md b/examples/2.0.x/server-dotnet/examples/users/update-mfa.md new file mode 100644 index 000000000..4e51f9f1d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-mfa.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateMFA( + userId: "<USER_ID>", + mfa: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-name.md b/examples/2.0.x/server-dotnet/examples/users/update-name.md new file mode 100644 index 000000000..4a58aa860 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-name.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateName( + userId: "<USER_ID>", + name: "<NAME>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-password.md b/examples/2.0.x/server-dotnet/examples/users/update-password.md new file mode 100644 index 000000000..4306cd73b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-password.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdatePassword( + userId: "<USER_ID>", + password: "password" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-phone-verification.md b/examples/2.0.x/server-dotnet/examples/users/update-phone-verification.md new file mode 100644 index 000000000..81fedf8a7 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-phone-verification.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdatePhoneVerification( + userId: "<USER_ID>", + phoneVerification: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-phone.md b/examples/2.0.x/server-dotnet/examples/users/update-phone.md new file mode 100644 index 000000000..de2a0723b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-phone.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdatePhone( + userId: "<USER_ID>", + number: "+12065550100" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-prefs.md b/examples/2.0.x/server-dotnet/examples/users/update-prefs.md new file mode 100644 index 000000000..db20bfc80 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-prefs.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Preferences result = await users.UpdatePrefs( + userId: "<USER_ID>", + prefs: [object] +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-status.md b/examples/2.0.x/server-dotnet/examples/users/update-status.md new file mode 100644 index 000000000..bd9f4839c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-status.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateStatus( + userId: "<USER_ID>", + status: false +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/users/update-target.md b/examples/2.0.x/server-dotnet/examples/users/update-target.md new file mode 100644 index 000000000..a2c184191 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/users/update-target.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Target result = await users.UpdateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>", // optional + providerId: "<PROVIDER_ID>", // optional + name: "<NAME>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..b0cebcd40 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-collection.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.CreateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + dimension: 1, + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/create-document.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..54260d78d --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.CreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: new { + embeddings = new[] { 0.12, -0.55, 0.88, 1.02 }, + metadata = { key = "value" } + }, + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..af00ea000 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.CreateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: new List<object>(), + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/create-index.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..5adac04cf --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-index.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Index result = await vectorsDB.CreateIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: VectorsDBIndexType.HnswEuclidean, + attributes: new List<string>(), + orders: new List<OrderBy> { OrderBy.Asc }, // optional + lengths: new List<long>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..346c7d247 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-operations.md @@ -0,0 +1,28 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.CreateOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/create-query.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..bcc28eda4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-query.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.CreateQuery( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..133e6bbdd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/create-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.CreateTransaction( + ttl: 60 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/create.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/create.md new file mode 100644 index 000000000..e0ecae456 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/create.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..563f025d3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-collection.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..78ccb33c4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-document.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..e7d21a4ba --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..7764d3ce9 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-index.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..2d706dd26 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.DeleteTransaction( + transactionId: "<TRANSACTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/delete.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete.md new file mode 100644 index 000000000..0f43900d5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +await vectorsDB.Delete( + databaseId: "<DATABASE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..9111b7403 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/get-collection.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.GetCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/get-document.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..98762a930 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/get-document.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.GetDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/get-index.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..6c2d1dfb4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/get-index.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Index result = await vectorsDB.GetIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..4cd0b3fdd --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/get-transaction.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.GetTransaction( + transactionId: "<TRANSACTION_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/get.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/get.md new file mode 100644 index 000000000..5b605e57c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Get( + databaseId: "<DATABASE_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..5e9f2737c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/list-collections.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollectionList result = await vectorsDB.ListCollections( + databaseId: "<DATABASE_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..934116732 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/list-documents.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.ListDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..acf0af7a4 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/list-indexes.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +IndexList result = await vectorsDB.ListIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..54ada0e63 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/list-transactions.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +TransactionList result = await vectorsDB.ListTransactions( + queries: new List<string>() // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/list.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/list.md new file mode 100644 index 000000000..c6eb690e2 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/list.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +DatabaseList result = await vectorsDB.List( + queries: new List<string>(), // optional + search: "<SEARCH>", // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..bcadbda24 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/update-collection.md @@ -0,0 +1,23 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +VectorsdbCollection result = await vectorsDB.UpdateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + dimension: 1, // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + documentSecurity: false, // optional + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/update-document.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..d1d0d0788 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/update-document.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.UpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [object], // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..5833aac17 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/update-documents.md @@ -0,0 +1,21 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.UpdateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: [object], // optional + queries: new List<string>(), // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..65320cc2f --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/update-transaction.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Transaction result = await vectorsDB.UpdateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, // optional + rollback: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/update.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/update.md new file mode 100644 index 000000000..2cdb3d9f5 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/update.md @@ -0,0 +1,19 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +Database result = await vectorsDB.Update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..edb18673b --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/upsert-document.md @@ -0,0 +1,22 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +Document result = await vectorsDB.UpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [object], // optional + permissions: new List<string> { Permission.Read(Role.Any()) }, // optional + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-dotnet/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..d9209fd9a --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,20 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +DocumentList result = await vectorsDB.UpsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: new List<object>(), + transactionId: "<TRANSACTION_ID>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/webhooks/create.md b/examples/2.0.x/server-dotnet/examples/webhooks/create.md new file mode 100644 index 000000000..28a5222fe --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/webhooks/create.md @@ -0,0 +1,25 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +Webhook result = await webhooks.Create( + webhookId: "<WEBHOOK_ID>", + url: "https://example.com/webhook", + name: "<NAME>", + events: new List<string>(), + enabled: false, // optional + tls: false, // optional + authUsername: "<AUTH_USERNAME>", // optional + authPassword: "password", // optional + secret: "<SECRET>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/webhooks/delete.md b/examples/2.0.x/server-dotnet/examples/webhooks/delete.md new file mode 100644 index 000000000..8cb5a4015 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/webhooks/delete.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +await webhooks.Delete( + webhookId: "<WEBHOOK_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/webhooks/get.md b/examples/2.0.x/server-dotnet/examples/webhooks/get.md new file mode 100644 index 000000000..2b6ce7dd3 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/webhooks/get.md @@ -0,0 +1,17 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +Webhook result = await webhooks.Get( + webhookId: "<WEBHOOK_ID>" +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/webhooks/list.md b/examples/2.0.x/server-dotnet/examples/webhooks/list.md new file mode 100644 index 000000000..c8c4b065c --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/webhooks/list.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +WebhookList result = await webhooks.List( + queries: new List<string>(), // optional + total: false // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/webhooks/update-secret.md b/examples/2.0.x/server-dotnet/examples/webhooks/update-secret.md new file mode 100644 index 000000000..c6d945511 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/webhooks/update-secret.md @@ -0,0 +1,18 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +Webhook result = await webhooks.UpdateSecret( + webhookId: "<WEBHOOK_ID>", + secret: "<SECRET>" // optional +); + +``` diff --git a/examples/2.0.x/server-dotnet/examples/webhooks/update.md b/examples/2.0.x/server-dotnet/examples/webhooks/update.md new file mode 100644 index 000000000..795cfafe6 --- /dev/null +++ b/examples/2.0.x/server-dotnet/examples/webhooks/update.md @@ -0,0 +1,24 @@ +```csharp +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +Webhook result = await webhooks.Update( + webhookId: "<WEBHOOK_ID>", + name: "<NAME>", + url: "https://example.com/webhook", + events: new List<string>(), + enabled: false, // optional + tls: false, // optional + authUsername: "<AUTH_USERNAME>", // optional + authPassword: "password" // optional +); + +``` diff --git a/examples/2.0.x/server-go/examples/account/create-anonymous-session.md b/examples/2.0.x/server-go/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..21edaf1f6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-anonymous-session.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateAnonymousSession() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-email-password-session.md b/examples/2.0.x/server-go/examples/account/create-email-password-session.md new file mode 100644 index 000000000..4213fb241 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-email-password-session.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateEmailPasswordSession( + "email@example.com", + "password", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-email-token.md b/examples/2.0.x/server-go/examples/account/create-email-token.md new file mode 100644 index 000000000..9a3468e83 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-email-token.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateEmailToken( + "<USER_ID>", + "email@example.com", + service.WithCreateEmailTokenPhrase(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-email-verification.md b/examples/2.0.x/server-go/examples/account/create-email-verification.md new file mode 100644 index 000000000..42e904f7d --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-email-verification.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateEmailVerification( + "https://example.com", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-magic-url-token.md b/examples/2.0.x/server-go/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..d04974a65 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-magic-url-token.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateMagicURLToken( + "<USER_ID>", + "email@example.com", + service.WithCreateMagicURLTokenUrl("https://example.com"), + service.WithCreateMagicURLTokenPhrase(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-go/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..d2586e6a2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-mfa-authenticator.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateMFAAuthenticator( + "totp", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-go/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..ea40f4d58 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-mfa-challenge.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateMFAChallenge( + "email", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-go/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..7b13ea7f1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateMFARecoveryCodes() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-go/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..62edb85e1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-o-auth-2-token.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateOAuth2Token( + "amazon", + service.WithCreateOAuth2TokenSuccess("https://example.com"), + service.WithCreateOAuth2TokenFailure("https://example.com"), + service.WithCreateOAuth2TokenScopes([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-phone-token.md b/examples/2.0.x/server-go/examples/account/create-phone-token.md new file mode 100644 index 000000000..071f10bc4 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-phone-token.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreatePhoneToken( + "<USER_ID>", + "+12065550100", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-phone-verification.md b/examples/2.0.x/server-go/examples/account/create-phone-verification.md new file mode 100644 index 000000000..df71b4210 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-phone-verification.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreatePhoneVerification() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-recovery.md b/examples/2.0.x/server-go/examples/account/create-recovery.md new file mode 100644 index 000000000..1dd0f0e51 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-recovery.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateRecovery( + "email@example.com", + "https://example.com", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-session.md b/examples/2.0.x/server-go/examples/account/create-session.md new file mode 100644 index 000000000..859d7de32 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-session.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateSession( + "<USER_ID>", + "<SECRET>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create-verification.md b/examples/2.0.x/server-go/examples/account/create-verification.md new file mode 100644 index 000000000..5c94360ab --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create-verification.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.CreateVerification( + "https://example.com", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/create.md b/examples/2.0.x/server-go/examples/account/create.md new file mode 100644 index 000000000..2f8182afc --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/create.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.Create( + "<USER_ID>", + "email@example.com", + "password", + service.WithCreateName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/delete-identity.md b/examples/2.0.x/server-go/examples/account/delete-identity.md new file mode 100644 index 000000000..70d47fe49 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/delete-identity.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.DeleteIdentity( + "<IDENTITY_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-go/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..5cd699a32 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.DeleteMFAAuthenticator( + "totp", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/delete-session.md b/examples/2.0.x/server-go/examples/account/delete-session.md new file mode 100644 index 000000000..263b85d9a --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/delete-session.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.DeleteSession( + "<SESSION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/delete-sessions.md b/examples/2.0.x/server-go/examples/account/delete-sessions.md new file mode 100644 index 000000000..f63ad4d9d --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/delete-sessions.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.DeleteSessions() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-go/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..f0081147f --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.GetMFARecoveryCodes() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/get-prefs.md b/examples/2.0.x/server-go/examples/account/get-prefs.md new file mode 100644 index 000000000..71ebf2a16 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/get-prefs.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.GetPrefs() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/get-session.md b/examples/2.0.x/server-go/examples/account/get-session.md new file mode 100644 index 000000000..fa1cd813c --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/get-session.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.GetSession( + "<SESSION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/get.md b/examples/2.0.x/server-go/examples/account/get.md new file mode 100644 index 000000000..ba4c74f5b --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/get.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.Get() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/list-identities.md b/examples/2.0.x/server-go/examples/account/list-identities.md new file mode 100644 index 000000000..9d67ff4a0 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/list-identities.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.ListIdentities( + service.WithListIdentitiesQueries([]string{"example"}), + service.WithListIdentitiesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/list-mfa-factors.md b/examples/2.0.x/server-go/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..b5ce9adfc --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/list-mfa-factors.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.ListMFAFactors() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/list-sessions.md b/examples/2.0.x/server-go/examples/account/list-sessions.md new file mode 100644 index 000000000..f66e4ccad --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/list-sessions.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.ListSessions() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-email-verification.md b/examples/2.0.x/server-go/examples/account/update-email-verification.md new file mode 100644 index 000000000..8c2696999 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-email-verification.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateEmailVerification( + "<USER_ID>", + "<SECRET>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-email.md b/examples/2.0.x/server-go/examples/account/update-email.md new file mode 100644 index 000000000..feac30bd8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-email.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateEmail( + "email@example.com", + "password", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-magic-url-session.md b/examples/2.0.x/server-go/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..ec859c239 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-magic-url-session.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateMagicURLSession( + "<USER_ID>", + "<SECRET>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-go/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..ded59715c --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-mfa-authenticator.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateMFAAuthenticator( + "totp", + "<OTP>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-go/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..36e150a68 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-mfa-challenge.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateMFAChallenge( + "<CHALLENGE_ID>", + "<OTP>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-go/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..f72f09396 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateMFARecoveryCodes() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-mfa.md b/examples/2.0.x/server-go/examples/account/update-mfa.md new file mode 100644 index 000000000..0df5c3d13 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-mfa.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateMFA( + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-name.md b/examples/2.0.x/server-go/examples/account/update-name.md new file mode 100644 index 000000000..41f97e849 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-name.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateName( + "<NAME>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-password.md b/examples/2.0.x/server-go/examples/account/update-password.md new file mode 100644 index 000000000..7da28c8d4 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-password.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdatePassword( + "password", + service.WithUpdatePasswordOldPassword("password"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-phone-session.md b/examples/2.0.x/server-go/examples/account/update-phone-session.md new file mode 100644 index 000000000..637a56b1e --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-phone-session.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdatePhoneSession( + "<USER_ID>", + "<SECRET>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-phone-verification.md b/examples/2.0.x/server-go/examples/account/update-phone-verification.md new file mode 100644 index 000000000..a6136ea58 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-phone-verification.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdatePhoneVerification( + "<USER_ID>", + "<SECRET>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-phone.md b/examples/2.0.x/server-go/examples/account/update-phone.md new file mode 100644 index 000000000..3c7d05eda --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-phone.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdatePhone( + "+12065550100", + "password", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-prefs.md b/examples/2.0.x/server-go/examples/account/update-prefs.md new file mode 100644 index 000000000..f0ecffe60 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-prefs.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdatePrefs( + map[string]interface{}{"language": "en", "timezone": "UTC", "darkTheme": true}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-recovery.md b/examples/2.0.x/server-go/examples/account/update-recovery.md new file mode 100644 index 000000000..000cf09fa --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-recovery.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateRecovery( + "<USER_ID>", + "<SECRET>", + "password", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-session.md b/examples/2.0.x/server-go/examples/account/update-session.md new file mode 100644 index 000000000..f664a8c49 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-session.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateSession( + "<SESSION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-status.md b/examples/2.0.x/server-go/examples/account/update-status.md new file mode 100644 index 000000000..163891fd5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-status.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateStatus() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/account/update-verification.md b/examples/2.0.x/server-go/examples/account/update-verification.md new file mode 100644 index 000000000..10cf4f496 --- /dev/null +++ b/examples/2.0.x/server-go/examples/account/update-verification.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/account" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := account.New(client) + + response, err := service.UpdateVerification( + "<USER_ID>", + "<SECRET>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/advisor/delete-report.md b/examples/2.0.x/server-go/examples/advisor/delete-report.md new file mode 100644 index 000000000..c8dd9c82d --- /dev/null +++ b/examples/2.0.x/server-go/examples/advisor/delete-report.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/advisor" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := advisor.New(client) + + response, err := service.DeleteReport( + "<REPORT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/advisor/get-insight.md b/examples/2.0.x/server-go/examples/advisor/get-insight.md new file mode 100644 index 000000000..fce8db3ae --- /dev/null +++ b/examples/2.0.x/server-go/examples/advisor/get-insight.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/advisor" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := advisor.New(client) + + response, err := service.GetInsight( + "<REPORT_ID>", + "<INSIGHT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/advisor/get-report.md b/examples/2.0.x/server-go/examples/advisor/get-report.md new file mode 100644 index 000000000..feb9c289c --- /dev/null +++ b/examples/2.0.x/server-go/examples/advisor/get-report.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/advisor" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := advisor.New(client) + + response, err := service.GetReport( + "<REPORT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/advisor/list-insights.md b/examples/2.0.x/server-go/examples/advisor/list-insights.md new file mode 100644 index 000000000..6b74645bc --- /dev/null +++ b/examples/2.0.x/server-go/examples/advisor/list-insights.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/advisor" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := advisor.New(client) + + response, err := service.ListInsights( + "<REPORT_ID>", + service.WithListInsightsQueries([]string{"example"}), + service.WithListInsightsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/advisor/list-reports.md b/examples/2.0.x/server-go/examples/advisor/list-reports.md new file mode 100644 index 000000000..008712605 --- /dev/null +++ b/examples/2.0.x/server-go/examples/advisor/list-reports.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/advisor" + "github.com/appwrite/sdk-for-go/appwrite" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := advisor.New(client) + + response, err := service.ListReports( + service.WithListReportsQueries([]string{"example"}), + service.WithListReportsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-browser.md b/examples/2.0.x/server-go/examples/avatars/get-browser.md new file mode 100644 index 000000000..995a59639 --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-browser.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetBrowser( + "aa", + service.WithGetBrowserWidth(0), + service.WithGetBrowserHeight(0), + service.WithGetBrowserQuality(-1), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-credit-card.md b/examples/2.0.x/server-go/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..d8f733009 --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-credit-card.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetCreditCard( + "amex", + service.WithGetCreditCardWidth(0), + service.WithGetCreditCardHeight(0), + service.WithGetCreditCardQuality(-1), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-favicon.md b/examples/2.0.x/server-go/examples/avatars/get-favicon.md new file mode 100644 index 000000000..3a7737a3e --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-favicon.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetFavicon( + "https://example.com", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-flag.md b/examples/2.0.x/server-go/examples/avatars/get-flag.md new file mode 100644 index 000000000..1989ad578 --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-flag.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetFlag( + "af", + service.WithGetFlagWidth(0), + service.WithGetFlagHeight(0), + service.WithGetFlagQuality(-1), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-image.md b/examples/2.0.x/server-go/examples/avatars/get-image.md new file mode 100644 index 000000000..66ed44a7b --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-image.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetImage( + "https://example.com", + service.WithGetImageWidth(0), + service.WithGetImageHeight(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-initials.md b/examples/2.0.x/server-go/examples/avatars/get-initials.md new file mode 100644 index 000000000..47bbff716 --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-initials.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetInitials( + service.WithGetInitialsName("<NAME>"), + service.WithGetInitialsWidth(0), + service.WithGetInitialsHeight(0), + service.WithGetInitialsBackground("FFFFFF"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-photo.md b/examples/2.0.x/server-go/examples/avatars/get-photo.md new file mode 100644 index 000000000..456760021 --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-photo.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetPhoto( + service.WithGetPhotoWidth(0), + service.WithGetPhotoHeight(0), + service.WithGetPhotoQuality(0), + service.WithGetPhotoOutput("png"), + service.WithGetPhotoRating("g"), + service.WithGetPhotoUserId("current()"), + service.WithGetPhotoEmailHash("<EMAIL_HASH>"), + service.WithGetPhotoName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-qr.md b/examples/2.0.x/server-go/examples/avatars/get-qr.md new file mode 100644 index 000000000..b0c351532 --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-qr.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetQR( + "<TEXT>", + service.WithGetQRSize(1), + service.WithGetQRMargin(0), + service.WithGetQRDownload(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/avatars/get-screenshot.md b/examples/2.0.x/server-go/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..03447e67a --- /dev/null +++ b/examples/2.0.x/server-go/examples/avatars/get-screenshot.md @@ -0,0 +1,44 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/avatars" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := avatars.New(client) + + response, err := service.GetScreenshot( + "https://example.com", + service.WithGetScreenshotHeaders(map[string]interface{}{"Authorization": "Bearer token123", "X-Custom-Header": "value"}), + service.WithGetScreenshotViewportWidth(1920), + service.WithGetScreenshotViewportHeight(1080), + service.WithGetScreenshotScale(2), + service.WithGetScreenshotTheme("dark"), + service.WithGetScreenshotUserAgent("Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15"), + service.WithGetScreenshotFullpage(true), + service.WithGetScreenshotLocale("en-US"), + service.WithGetScreenshotTimezone("America/New_York"), + service.WithGetScreenshotLatitude(37.7749), + service.WithGetScreenshotLongitude(-122.4194), + service.WithGetScreenshotAccuracy(100), + service.WithGetScreenshotTouch(true), + service.WithGetScreenshotPermissions([]string{"geolocation", "notifications"}), + service.WithGetScreenshotSleep(3), + service.WithGetScreenshotWidth(800), + service.WithGetScreenshotHeight(600), + service.WithGetScreenshotQuality(85), + service.WithGetScreenshotOutput("jpeg"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-go/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..dea3412ee --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-big-int-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateBigIntAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateBigIntAttributeMin(0), + service.WithCreateBigIntAttributeMax(1000000), + service.WithCreateBigIntAttributeDefault(0), + service.WithCreateBigIntAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-go/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..ac0b388cd --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-boolean-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateBooleanAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateBooleanAttributeDefault(false), + service.WithCreateBooleanAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-collection.md b/examples/2.0.x/server-go/examples/databases/create-collection.md new file mode 100644 index 000000000..d79e1e315 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-collection.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + service.WithCreateCollectionPermissions([]string{"read(\"any\")"}), + service.WithCreateCollectionDocumentSecurity(false), + service.WithCreateCollectionEnabled(false), + service.WithCreateCollectionAttributes([]interface{}{}), + service.WithCreateCollectionIndexes([]interface{}{}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-go/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..1f32805db --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-datetime-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateDatetimeAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateDatetimeAttributeDefault("2020-10-15T06:38:00.000+00:00"), + service.WithCreateDatetimeAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-document.md b/examples/2.0.x/server-go/examples/databases/create-document.md new file mode 100644 index 000000000..5a7c60655 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := databases.New(client) + + response, err := service.CreateDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 30, "isAdmin": false}, + service.WithCreateDocumentPermissions([]string{"read(\"any\")"}), + service.WithCreateDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-documents.md b/examples/2.0.x/server-go/examples/databases/create-documents.md new file mode 100644 index 000000000..4093e906f --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + []interface{}{}, + service.WithCreateDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-email-attribute.md b/examples/2.0.x/server-go/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..5e7a34acd --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-email-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateEmailAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateEmailAttributeDefault("email@example.com"), + service.WithCreateEmailAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-go/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..e8d0703e6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-enum-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateEnumAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + []string{"active", "inactive"}, + false, + service.WithCreateEnumAttributeDefault("active"), + service.WithCreateEnumAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-float-attribute.md b/examples/2.0.x/server-go/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..6c82ab0d9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-float-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateFloatAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateFloatAttributeMin(0), + service.WithCreateFloatAttributeMax(100), + service.WithCreateFloatAttributeDefault(10.5), + service.WithCreateFloatAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-index.md b/examples/2.0.x/server-go/examples/databases/create-index.md new file mode 100644 index 000000000..56111dec6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-index.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + "key", + []string{"example"}, + service.WithCreateIndexOrders([]string{"example"}), + service.WithCreateIndexLengths([]int{0}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-go/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..38ab1ccba --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-integer-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateIntegerAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateIntegerAttributeMin(0), + service.WithCreateIntegerAttributeMax(100), + service.WithCreateIntegerAttributeDefault(10), + service.WithCreateIntegerAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-go/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..55e211a64 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-ip-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateIpAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateIpAttributeDefault("192.0.2.0"), + service.WithCreateIpAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-line-attribute.md b/examples/2.0.x/server-go/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..5a4bb4a66 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-line-attribute.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateLineAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateLineAttributeDefault([][]interface{}{[]interface{}{1, 2}, []interface{}{3, 4}, []interface{}{5, 6}}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-go/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..edb5e416b --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-longtext-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateLongtextAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateLongtextAttributeDefault("Hello World"), + service.WithCreateLongtextAttributeArray(false), + service.WithCreateLongtextAttributeEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-go/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..9dae68fd9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateMediumtextAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateMediumtextAttributeDefault("Hello World"), + service.WithCreateMediumtextAttributeArray(false), + service.WithCreateMediumtextAttributeEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-operations.md b/examples/2.0.x/server-go/examples/databases/create-operations.md new file mode 100644 index 000000000..bc14bb292 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-operations.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateOperations( + "<TRANSACTION_ID>", + service.WithCreateOperationsOperations([]interface{}{map[string]interface{}{"action": "create", "databaseId": "<DATABASE_ID>", "collectionId": "<COLLECTION_ID>", "documentId": "<DOCUMENT_ID>", "data": map[string]interface{}{"name": "Walter O'Brien"}}}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-point-attribute.md b/examples/2.0.x/server-go/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..b0508aa46 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-point-attribute.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreatePointAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreatePointAttributeDefault([]float64{1, 2}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-go/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..562f5e87d --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-polygon-attribute.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreatePolygonAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreatePolygonAttributeDefault([][]interface{}{[]interface{}{[]interface{}{1, 2}, []interface{}{3, 4}, []interface{}{5, 6}, []interface{}{1, 2}}}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-go/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..903f11275 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-relationship-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateRelationshipAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<RELATED_COLLECTION_ID>", + "oneToOne", + service.WithCreateRelationshipAttributeTwoWay(false), + service.WithCreateRelationshipAttributeKey("<KEY>"), + service.WithCreateRelationshipAttributeTwoWayKey("<TWO_WAY_KEY>"), + service.WithCreateRelationshipAttributeOnDelete("cascade"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-string-attribute.md b/examples/2.0.x/server-go/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..4782b37b9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-string-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateStringAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + 1, + false, + service.WithCreateStringAttributeDefault("Hello World"), + service.WithCreateStringAttributeArray(false), + service.WithCreateStringAttributeEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-text-attribute.md b/examples/2.0.x/server-go/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..015deda52 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-text-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateTextAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateTextAttributeDefault("Hello World"), + service.WithCreateTextAttributeArray(false), + service.WithCreateTextAttributeEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-transaction.md b/examples/2.0.x/server-go/examples/databases/create-transaction.md new file mode 100644 index 000000000..872c9b78d --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateTransaction( + service.WithCreateTransactionTtl(60), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-url-attribute.md b/examples/2.0.x/server-go/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..38cad7f15 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-url-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateUrlAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithCreateUrlAttributeDefault("https://example.com"), + service.WithCreateUrlAttributeArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-go/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..01725bd36 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create-varchar-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.CreateVarcharAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + 1, + false, + service.WithCreateVarcharAttributeDefault("Hello World"), + service.WithCreateVarcharAttributeArray(false), + service.WithCreateVarcharAttributeEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/create.md b/examples/2.0.x/server-go/examples/databases/create.md new file mode 100644 index 000000000..74764aa2a --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/create.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.Create( + "<DATABASE_ID>", + "<NAME>", + service.WithCreateEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-go/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..578a79172 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/decrement-document-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := databases.New(client) + + response, err := service.DecrementDocumentAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "<ATTRIBUTE>", + service.WithDecrementDocumentAttributeValue(1), + service.WithDecrementDocumentAttributeMin(0), + service.WithDecrementDocumentAttributeTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/delete-attribute.md b/examples/2.0.x/server-go/examples/databases/delete-attribute.md new file mode 100644 index 000000000..05982cd9d --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/delete-attribute.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.DeleteAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/delete-collection.md b/examples/2.0.x/server-go/examples/databases/delete-collection.md new file mode 100644 index 000000000..4b8dc892f --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/delete-collection.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.DeleteCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/delete-document.md b/examples/2.0.x/server-go/examples/databases/delete-document.md new file mode 100644 index 000000000..6cb050f11 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/delete-document.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := databases.New(client) + + response, err := service.DeleteDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithDeleteDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/delete-documents.md b/examples/2.0.x/server-go/examples/databases/delete-documents.md new file mode 100644 index 000000000..0ef21073d --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/delete-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.DeleteDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithDeleteDocumentsQueries([]string{"example"}), + service.WithDeleteDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/delete-index.md b/examples/2.0.x/server-go/examples/databases/delete-index.md new file mode 100644 index 000000000..fb6c5d149 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/delete-index.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.DeleteIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/delete-transaction.md b/examples/2.0.x/server-go/examples/databases/delete-transaction.md new file mode 100644 index 000000000..61d65777e --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/delete-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.DeleteTransaction( + "<TRANSACTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/delete.md b/examples/2.0.x/server-go/examples/databases/delete.md new file mode 100644 index 000000000..fde9a76e7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.Delete( + "<DATABASE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/get-attribute.md b/examples/2.0.x/server-go/examples/databases/get-attribute.md new file mode 100644 index 000000000..2140ca0cb --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/get-attribute.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.GetAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/get-collection.md b/examples/2.0.x/server-go/examples/databases/get-collection.md new file mode 100644 index 000000000..5ec0693ff --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/get-collection.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.GetCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/get-document.md b/examples/2.0.x/server-go/examples/databases/get-document.md new file mode 100644 index 000000000..4ff3ce623 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/get-document.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := databases.New(client) + + response, err := service.GetDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithGetDocumentQueries([]string{"example"}), + service.WithGetDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/get-index.md b/examples/2.0.x/server-go/examples/databases/get-index.md new file mode 100644 index 000000000..3da3cb297 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/get-index.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.GetIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/get-transaction.md b/examples/2.0.x/server-go/examples/databases/get-transaction.md new file mode 100644 index 000000000..1aa565c82 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/get-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.GetTransaction( + "<TRANSACTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/get.md b/examples/2.0.x/server-go/examples/databases/get.md new file mode 100644 index 000000000..e38ef9648 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.Get( + "<DATABASE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-go/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..e119c522c --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/increment-document-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := databases.New(client) + + response, err := service.IncrementDocumentAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "<ATTRIBUTE>", + service.WithIncrementDocumentAttributeValue(1), + service.WithIncrementDocumentAttributeMax(100), + service.WithIncrementDocumentAttributeTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/list-attributes.md b/examples/2.0.x/server-go/examples/databases/list-attributes.md new file mode 100644 index 000000000..6a67f5df1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/list-attributes.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.ListAttributes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithListAttributesQueries([]string{"example"}), + service.WithListAttributesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/list-collections.md b/examples/2.0.x/server-go/examples/databases/list-collections.md new file mode 100644 index 000000000..354fd3e96 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/list-collections.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.ListCollections( + "<DATABASE_ID>", + service.WithListCollectionsQueries([]string{"example"}), + service.WithListCollectionsSearch("<SEARCH>"), + service.WithListCollectionsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/list-documents.md b/examples/2.0.x/server-go/examples/databases/list-documents.md new file mode 100644 index 000000000..339b98cbd --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/list-documents.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := databases.New(client) + + response, err := service.ListDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithListDocumentsQueries([]string{"example"}), + service.WithListDocumentsTransactionId("<TRANSACTION_ID>"), + service.WithListDocumentsTotal(false), + service.WithListDocumentsTtl(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/list-indexes.md b/examples/2.0.x/server-go/examples/databases/list-indexes.md new file mode 100644 index 000000000..8b6e7f592 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/list-indexes.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.ListIndexes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithListIndexesQueries([]string{"example"}), + service.WithListIndexesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/list-transactions.md b/examples/2.0.x/server-go/examples/databases/list-transactions.md new file mode 100644 index 000000000..fceed63cf --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/list-transactions.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.ListTransactions( + service.WithListTransactionsQueries([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/list.md b/examples/2.0.x/server-go/examples/databases/list.md new file mode 100644 index 000000000..8c1e598ca --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListSearch("<SEARCH>"), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-go/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..daae03a4f --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-big-int-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateBigIntAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + 0, + service.WithUpdateBigIntAttributeMin(0), + service.WithUpdateBigIntAttributeMax(1000000), + service.WithUpdateBigIntAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-go/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..e87dfd1c8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-boolean-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateBooleanAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + false, + service.WithUpdateBooleanAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-collection.md b/examples/2.0.x/server-go/examples/databases/update-collection.md new file mode 100644 index 000000000..073510768 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-collection.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithUpdateCollectionName("<NAME>"), + service.WithUpdateCollectionPermissions([]string{"read(\"any\")"}), + service.WithUpdateCollectionDocumentSecurity(false), + service.WithUpdateCollectionEnabled(false), + service.WithUpdateCollectionPurge(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-go/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..fd4505a4a --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-datetime-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateDatetimeAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "2020-10-15T06:38:00.000+00:00", + service.WithUpdateDatetimeAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-document.md b/examples/2.0.x/server-go/examples/databases/update-document.md new file mode 100644 index 000000000..0527d7dbe --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := databases.New(client) + + response, err := service.UpdateDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithUpdateDocumentData(map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 33, "isAdmin": false}), + service.WithUpdateDocumentPermissions([]string{"read(\"any\")"}), + service.WithUpdateDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-documents.md b/examples/2.0.x/server-go/examples/databases/update-documents.md new file mode 100644 index 000000000..4d8f57231 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-documents.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithUpdateDocumentsData(map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 33, "isAdmin": false}), + service.WithUpdateDocumentsQueries([]string{"example"}), + service.WithUpdateDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-email-attribute.md b/examples/2.0.x/server-go/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..62f0096f7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-email-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateEmailAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "email@example.com", + service.WithUpdateEmailAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-go/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..6b8f080d9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-enum-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateEnumAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + []string{"active", "inactive"}, + false, + "active", + service.WithUpdateEnumAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-float-attribute.md b/examples/2.0.x/server-go/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..0b5024e95 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-float-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateFloatAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + 10.5, + service.WithUpdateFloatAttributeMin(0), + service.WithUpdateFloatAttributeMax(100), + service.WithUpdateFloatAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-go/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..51e282acd --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-integer-attribute.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateIntegerAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + 10, + service.WithUpdateIntegerAttributeMin(0), + service.WithUpdateIntegerAttributeMax(100), + service.WithUpdateIntegerAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-go/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..559746b24 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-ip-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateIpAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "192.0.2.0", + service.WithUpdateIpAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-line-attribute.md b/examples/2.0.x/server-go/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..099712ca8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-line-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateLineAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithUpdateLineAttributeDefault([][]interface{}{[]interface{}{1, 2}, []interface{}{3, 4}, []interface{}{5, 6}}), + service.WithUpdateLineAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-go/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..f100fb4a0 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-longtext-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateLongtextAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateLongtextAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-go/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..5ad93c22f --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateMediumtextAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateMediumtextAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-point-attribute.md b/examples/2.0.x/server-go/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..58fdf26c7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-point-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdatePointAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithUpdatePointAttributeDefault([]float64{1, 2}), + service.WithUpdatePointAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-go/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..e462802b5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-polygon-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdatePolygonAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + service.WithUpdatePolygonAttributeDefault([][]interface{}{[]interface{}{[]interface{}{1, 2}, []interface{}{3, 4}, []interface{}{5, 6}, []interface{}{1, 2}}}), + service.WithUpdatePolygonAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-go/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..f9fbf349c --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-relationship-attribute.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateRelationshipAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + service.WithUpdateRelationshipAttributeOnDelete("cascade"), + service.WithUpdateRelationshipAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-string-attribute.md b/examples/2.0.x/server-go/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..f7867dbc2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-string-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateStringAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateStringAttributeSize(1), + service.WithUpdateStringAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-text-attribute.md b/examples/2.0.x/server-go/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..ee64a6cff --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-text-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateTextAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateTextAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-transaction.md b/examples/2.0.x/server-go/examples/databases/update-transaction.md new file mode 100644 index 000000000..97ca00b66 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-transaction.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateTransaction( + "<TRANSACTION_ID>", + service.WithUpdateTransactionCommit(false), + service.WithUpdateTransactionRollback(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-url-attribute.md b/examples/2.0.x/server-go/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..95f2d1b73 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-url-attribute.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateUrlAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "https://example.com", + service.WithUpdateUrlAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-go/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..8f3641509 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update-varchar-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpdateVarcharAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateVarcharAttributeSize(1), + service.WithUpdateVarcharAttributeNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/update.md b/examples/2.0.x/server-go/examples/databases/update.md new file mode 100644 index 000000000..fa7fac980 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/update.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.Update( + "<DATABASE_ID>", + service.WithUpdateName("<NAME>"), + service.WithUpdateEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/upsert-document.md b/examples/2.0.x/server-go/examples/databases/upsert-document.md new file mode 100644 index 000000000..71fb157cf --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/upsert-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := databases.New(client) + + response, err := service.UpsertDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithUpsertDocumentData(map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 30, "isAdmin": false}), + service.WithUpsertDocumentPermissions([]string{"read(\"any\")"}), + service.WithUpsertDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/databases/upsert-documents.md b/examples/2.0.x/server-go/examples/databases/upsert-documents.md new file mode 100644 index 000000000..dbb47b8e7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/databases/upsert-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := databases.New(client) + + response, err := service.UpsertDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + []interface{}{}, + service.WithUpsertDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/create-collection.md b/examples/2.0.x/server-go/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..0a096a3cc --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/create-collection.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.CreateCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + service.WithCreateCollectionPermissions([]string{"read(\"any\")"}), + service.WithCreateCollectionDocumentSecurity(false), + service.WithCreateCollectionEnabled(false), + service.WithCreateCollectionAttributes([]interface{}{}), + service.WithCreateCollectionIndexes([]interface{}{}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/create-document.md b/examples/2.0.x/server-go/examples/documentsdb/create-document.md new file mode 100644 index 000000000..ee7b69746 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/create-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.CreateDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 30, "isAdmin": false}, + service.WithCreateDocumentPermissions([]string{"read(\"any\")"}), + service.WithCreateDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/create-documents.md b/examples/2.0.x/server-go/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..f127fd2a9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/create-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.CreateDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + []interface{}{}, + service.WithCreateDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/create-index.md b/examples/2.0.x/server-go/examples/documentsdb/create-index.md new file mode 100644 index 000000000..9ee72426f --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/create-index.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.CreateIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + "key", + []string{"example"}, + service.WithCreateIndexOrders([]string{"example"}), + service.WithCreateIndexLengths([]int{0}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/create-operations.md b/examples/2.0.x/server-go/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..5078c2053 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/create-operations.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.CreateOperations( + "<TRANSACTION_ID>", + service.WithCreateOperationsOperations([]interface{}{map[string]interface{}{"action": "create", "databaseId": "<DATABASE_ID>", "collectionId": "<COLLECTION_ID>", "documentId": "<DOCUMENT_ID>", "data": map[string]interface{}{"name": "Walter O'Brien"}}}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-go/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..c32a72f44 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/create-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.CreateTransaction( + service.WithCreateTransactionTtl(60), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/create.md b/examples/2.0.x/server-go/examples/documentsdb/create.md new file mode 100644 index 000000000..43b54254d --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/create.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.Create( + "<DATABASE_ID>", + "<NAME>", + service.WithCreateEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-go/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..4bcd30e08 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.DecrementDocumentAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "<ATTRIBUTE>", + service.WithDecrementDocumentAttributeValue(1), + service.WithDecrementDocumentAttributeMin(0), + service.WithDecrementDocumentAttributeTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-go/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..de680f58b --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/delete-collection.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.DeleteCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/delete-document.md b/examples/2.0.x/server-go/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..0cce0dbdd --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/delete-document.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.DeleteDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithDeleteDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-go/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..143bbf83a --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/delete-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.DeleteDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithDeleteDocumentsQueries([]string{"example"}), + service.WithDeleteDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/delete-index.md b/examples/2.0.x/server-go/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..cb008c096 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/delete-index.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.DeleteIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-go/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..971485c5f --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/delete-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.DeleteTransaction( + "<TRANSACTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/delete.md b/examples/2.0.x/server-go/examples/documentsdb/delete.md new file mode 100644 index 000000000..66cc0e794 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.Delete( + "<DATABASE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/get-collection.md b/examples/2.0.x/server-go/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..8b7195e3e --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/get-collection.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.GetCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/get-document.md b/examples/2.0.x/server-go/examples/documentsdb/get-document.md new file mode 100644 index 000000000..71a1792ed --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/get-document.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.GetDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithGetDocumentQueries([]string{"example"}), + service.WithGetDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/get-index.md b/examples/2.0.x/server-go/examples/documentsdb/get-index.md new file mode 100644 index 000000000..d50dd78f9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/get-index.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.GetIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-go/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..448e4020b --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/get-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.GetTransaction( + "<TRANSACTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/get.md b/examples/2.0.x/server-go/examples/documentsdb/get.md new file mode 100644 index 000000000..d9328880e --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.Get( + "<DATABASE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-go/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..fb583a45f --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.IncrementDocumentAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "<ATTRIBUTE>", + service.WithIncrementDocumentAttributeValue(1), + service.WithIncrementDocumentAttributeMax(100), + service.WithIncrementDocumentAttributeTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/list-collections.md b/examples/2.0.x/server-go/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..c71344a7d --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/list-collections.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.ListCollections( + "<DATABASE_ID>", + service.WithListCollectionsQueries([]string{"example"}), + service.WithListCollectionsSearch("<SEARCH>"), + service.WithListCollectionsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/list-documents.md b/examples/2.0.x/server-go/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..f88cbedc8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/list-documents.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.ListDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithListDocumentsQueries([]string{"example"}), + service.WithListDocumentsTransactionId("<TRANSACTION_ID>"), + service.WithListDocumentsTotal(false), + service.WithListDocumentsTtl(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-go/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..51dad656e --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/list-indexes.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.ListIndexes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithListIndexesQueries([]string{"example"}), + service.WithListIndexesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-go/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..131ab0057 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/list-transactions.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.ListTransactions( + service.WithListTransactionsQueries([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/list.md b/examples/2.0.x/server-go/examples/documentsdb/list.md new file mode 100644 index 000000000..81fd5c3b8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListSearch("<SEARCH>"), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/update-collection.md b/examples/2.0.x/server-go/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..b1a43716f --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/update-collection.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.UpdateCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + service.WithUpdateCollectionPermissions([]string{"read(\"any\")"}), + service.WithUpdateCollectionDocumentSecurity(false), + service.WithUpdateCollectionEnabled(false), + service.WithUpdateCollectionPurge(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/update-document.md b/examples/2.0.x/server-go/examples/documentsdb/update-document.md new file mode 100644 index 000000000..c8b2ff902 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/update-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.UpdateDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithUpdateDocumentData([]interface{}{}), + service.WithUpdateDocumentPermissions([]string{"read(\"any\")"}), + service.WithUpdateDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/update-documents.md b/examples/2.0.x/server-go/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..d1d7e7cad --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/update-documents.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.UpdateDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithUpdateDocumentsData([]interface{}{}), + service.WithUpdateDocumentsQueries([]string{"example"}), + service.WithUpdateDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-go/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..8b09ba848 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/update-transaction.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.UpdateTransaction( + "<TRANSACTION_ID>", + service.WithUpdateTransactionCommit(false), + service.WithUpdateTransactionRollback(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/update.md b/examples/2.0.x/server-go/examples/documentsdb/update.md new file mode 100644 index 000000000..f167ae2c1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/update.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.Update( + "<DATABASE_ID>", + "<NAME>", + service.WithUpdateEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-go/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..13e971a9c --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/upsert-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := documentsdb.New(client) + + response, err := service.UpsertDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithUpsertDocumentData([]interface{}{}), + service.WithUpsertDocumentPermissions([]string{"read(\"any\")"}), + service.WithUpsertDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-go/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..c251addd8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/documentsdb/upsert-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/documentsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := documentsdb.New(client) + + response, err := service.UpsertDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + []interface{}{}, + service.WithUpsertDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-go/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..0ac772cda --- /dev/null +++ b/examples/2.0.x/server-go/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/embeddings" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := embeddings.New(client) + + response, err := service.CreateTextEmbeddings( + []string{"example"}, + service.WithCreateTextEmbeddingsModel("nomic-embed-text"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/create-deployment.md b/examples/2.0.x/server-go/examples/functions/create-deployment.md new file mode 100644 index 000000000..10d482c3a --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/create-deployment.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/file" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.CreateDeployment( + "<FUNCTION_ID>", + file.NewInputFile("/path/to/file.png", "file.png"), + false, + service.WithCreateDeploymentEntrypoint("<ENTRYPOINT>"), + service.WithCreateDeploymentCommands("<COMMANDS>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-go/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..28dd9d84a --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.CreateDuplicateDeployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + service.WithCreateDuplicateDeploymentBuildId("<BUILD_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/create-execution.md b/examples/2.0.x/server-go/examples/functions/create-execution.md new file mode 100644 index 000000000..4b70a3f99 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/create-execution.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := functions.New(client) + + response, err := service.CreateExecution( + "<FUNCTION_ID>", + service.WithCreateExecutionBody("<BODY>"), + service.WithCreateExecutionAsync(false), + service.WithCreateExecutionPath("<PATH>"), + service.WithCreateExecutionMethod("GET"), + service.WithCreateExecutionHeaders([]interface{}{}), + service.WithCreateExecutionScheduledAt("<SCHEDULED_AT>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/create-template-deployment.md b/examples/2.0.x/server-go/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..6dadff204 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/create-template-deployment.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.CreateTemplateDeployment( + "<FUNCTION_ID>", + "<REPOSITORY>", + "<OWNER>", + "<ROOT_DIRECTORY>", + "commit", + "<REFERENCE>", + service.WithCreateTemplateDeploymentActivate(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/create-variable.md b/examples/2.0.x/server-go/examples/functions/create-variable.md new file mode 100644 index 000000000..4e65cc608 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/create-variable.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.CreateVariable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", + "<KEY>", + "<VALUE>", + service.WithCreateVariableSecret(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-go/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..eaeb8eb8d --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/create-vcs-deployment.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.CreateVcsDeployment( + "<FUNCTION_ID>", + "branch", + "<REFERENCE>", + service.WithCreateVcsDeploymentActivate(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/create.md b/examples/2.0.x/server-go/examples/functions/create.md new file mode 100644 index 000000000..e749507ab --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/create.md @@ -0,0 +1,46 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.Create( + "<FUNCTION_ID>", + "<NAME>", + "node-14.5", + service.WithCreateExecute([]string{"any"}), + service.WithCreateEvents([]string{"example"}), + service.WithCreateSchedule("0 0 * * *"), + service.WithCreateTimeout(1), + service.WithCreateEnabled(false), + service.WithCreateLogging(false), + service.WithCreateEntrypoint("<ENTRYPOINT>"), + service.WithCreateCommands("<COMMANDS>"), + service.WithCreateScopes([]string{"example"}), + service.WithCreateInstallationId("<INSTALLATION_ID>"), + service.WithCreateProviderRepositoryId("<PROVIDER_REPOSITORY_ID>"), + service.WithCreateProviderBranch("<PROVIDER_BRANCH>"), + service.WithCreateProviderSilentMode(false), + service.WithCreateProviderRootDirectory("<PROVIDER_ROOT_DIRECTORY>"), + service.WithCreateProviderBranches([]string{"example"}), + service.WithCreateProviderPaths([]string{"example"}), + service.WithCreateBuildSpecification("s-1vcpu-512mb"), + service.WithCreateRuntimeSpecification("s-1vcpu-512mb"), + service.WithCreateDeploymentRetention(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/delete-deployment.md b/examples/2.0.x/server-go/examples/functions/delete-deployment.md new file mode 100644 index 000000000..85dddf88f --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/delete-deployment.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.DeleteDeployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/delete-execution.md b/examples/2.0.x/server-go/examples/functions/delete-execution.md new file mode 100644 index 000000000..482e6a0fc --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/delete-execution.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.DeleteExecution( + "<FUNCTION_ID>", + "<EXECUTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/delete-variable.md b/examples/2.0.x/server-go/examples/functions/delete-variable.md new file mode 100644 index 000000000..6cfddc3bd --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/delete-variable.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.DeleteVariable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/delete.md b/examples/2.0.x/server-go/examples/functions/delete.md new file mode 100644 index 000000000..2554a8a80 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.Delete( + "<FUNCTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/get-deployment-download.md b/examples/2.0.x/server-go/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..455954aa2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/get-deployment-download.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.GetDeploymentDownload( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + service.WithGetDeploymentDownloadType("source"), + service.WithGetDeploymentDownloadToken("<TOKEN>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/get-deployment.md b/examples/2.0.x/server-go/examples/functions/get-deployment.md new file mode 100644 index 000000000..73fb3ec10 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/get-deployment.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.GetDeployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/get-execution.md b/examples/2.0.x/server-go/examples/functions/get-execution.md new file mode 100644 index 000000000..19cec6ba4 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/get-execution.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := functions.New(client) + + response, err := service.GetExecution( + "<FUNCTION_ID>", + "<EXECUTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/get-variable.md b/examples/2.0.x/server-go/examples/functions/get-variable.md new file mode 100644 index 000000000..e2e064729 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/get-variable.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.GetVariable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/get.md b/examples/2.0.x/server-go/examples/functions/get.md new file mode 100644 index 000000000..4a465c229 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.Get( + "<FUNCTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/list-deployments.md b/examples/2.0.x/server-go/examples/functions/list-deployments.md new file mode 100644 index 000000000..b6fa4d2cb --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/list-deployments.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.ListDeployments( + "<FUNCTION_ID>", + service.WithListDeploymentsQueries([]string{"example"}), + service.WithListDeploymentsSearch("<SEARCH>"), + service.WithListDeploymentsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/list-executions.md b/examples/2.0.x/server-go/examples/functions/list-executions.md new file mode 100644 index 000000000..bbbd417d8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/list-executions.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := functions.New(client) + + response, err := service.ListExecutions( + "<FUNCTION_ID>", + service.WithListExecutionsQueries([]string{"example"}), + service.WithListExecutionsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/list-runtimes.md b/examples/2.0.x/server-go/examples/functions/list-runtimes.md new file mode 100644 index 000000000..a1c843e89 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/list-runtimes.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.ListRuntimes() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/list-specifications.md b/examples/2.0.x/server-go/examples/functions/list-specifications.md new file mode 100644 index 000000000..a93a222b3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/list-specifications.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.ListSpecifications( + service.WithListSpecificationsType("runtimes"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/list-variables.md b/examples/2.0.x/server-go/examples/functions/list-variables.md new file mode 100644 index 000000000..5a922b0e3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/list-variables.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.ListVariables( + "<FUNCTION_ID>", + service.WithListVariablesQueries([]string{"example"}), + service.WithListVariablesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/list.md b/examples/2.0.x/server-go/examples/functions/list.md new file mode 100644 index 000000000..6000e753c --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListSearch("<SEARCH>"), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/update-deployment-status.md b/examples/2.0.x/server-go/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..0c09f8d74 --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/update-deployment-status.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.UpdateDeploymentStatus( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/update-function-deployment.md b/examples/2.0.x/server-go/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..bd3342d4b --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/update-function-deployment.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.UpdateFunctionDeployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/update-variable.md b/examples/2.0.x/server-go/examples/functions/update-variable.md new file mode 100644 index 000000000..f16ac41be --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/update-variable.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.UpdateVariable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", + service.WithUpdateVariableKey("<KEY>"), + service.WithUpdateVariableValue("<VALUE>"), + service.WithUpdateVariableSecret(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/functions/update.md b/examples/2.0.x/server-go/examples/functions/update.md new file mode 100644 index 000000000..13e10010e --- /dev/null +++ b/examples/2.0.x/server-go/examples/functions/update.md @@ -0,0 +1,46 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/functions" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := functions.New(client) + + response, err := service.Update( + "<FUNCTION_ID>", + "<NAME>", + service.WithUpdateRuntime("node-14.5"), + service.WithUpdateExecute([]string{"any"}), + service.WithUpdateEvents([]string{"example"}), + service.WithUpdateSchedule("0 0 * * *"), + service.WithUpdateTimeout(1), + service.WithUpdateEnabled(false), + service.WithUpdateLogging(false), + service.WithUpdateEntrypoint("<ENTRYPOINT>"), + service.WithUpdateCommands("<COMMANDS>"), + service.WithUpdateScopes([]string{"example"}), + service.WithUpdateInstallationId("<INSTALLATION_ID>"), + service.WithUpdateProviderRepositoryId("<PROVIDER_REPOSITORY_ID>"), + service.WithUpdateProviderBranch("<PROVIDER_BRANCH>"), + service.WithUpdateProviderSilentMode(false), + service.WithUpdateProviderRootDirectory("<PROVIDER_ROOT_DIRECTORY>"), + service.WithUpdateProviderBranches([]string{"example"}), + service.WithUpdateProviderPaths([]string{"example"}), + service.WithUpdateBuildSpecification("s-1vcpu-512mb"), + service.WithUpdateRuntimeSpecification("s-1vcpu-512mb"), + service.WithUpdateDeploymentRetention(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/graphql/mutation.md b/examples/2.0.x/server-go/examples/graphql/mutation.md new file mode 100644 index 000000000..5ef1f21f7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/graphql/mutation.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/graphql" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := graphql.New(client) + + response, err := service.Mutation( + []interface{}{}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/graphql/query.md b/examples/2.0.x/server-go/examples/graphql/query.md new file mode 100644 index 000000000..ce05cba32 --- /dev/null +++ b/examples/2.0.x/server-go/examples/graphql/query.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/graphql" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := graphql.New(client) + + response, err := service.Query( + []interface{}{}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/locale/get.md b/examples/2.0.x/server-go/examples/locale/get.md new file mode 100644 index 000000000..b025c5e1e --- /dev/null +++ b/examples/2.0.x/server-go/examples/locale/get.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/locale" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := locale.New(client) + + response, err := service.Get() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/locale/list-codes.md b/examples/2.0.x/server-go/examples/locale/list-codes.md new file mode 100644 index 000000000..337a3069f --- /dev/null +++ b/examples/2.0.x/server-go/examples/locale/list-codes.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/locale" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := locale.New(client) + + response, err := service.ListCodes() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/locale/list-continents.md b/examples/2.0.x/server-go/examples/locale/list-continents.md new file mode 100644 index 000000000..30a4f279b --- /dev/null +++ b/examples/2.0.x/server-go/examples/locale/list-continents.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/locale" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := locale.New(client) + + response, err := service.ListContinents() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/locale/list-countries-eu.md b/examples/2.0.x/server-go/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..efed36db5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/locale/list-countries-eu.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/locale" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := locale.New(client) + + response, err := service.ListCountriesEU() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/locale/list-countries-phones.md b/examples/2.0.x/server-go/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..2edf40aab --- /dev/null +++ b/examples/2.0.x/server-go/examples/locale/list-countries-phones.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/locale" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := locale.New(client) + + response, err := service.ListCountriesPhones() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/locale/list-countries.md b/examples/2.0.x/server-go/examples/locale/list-countries.md new file mode 100644 index 000000000..dff9f9c88 --- /dev/null +++ b/examples/2.0.x/server-go/examples/locale/list-countries.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/locale" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := locale.New(client) + + response, err := service.ListCountries() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/locale/list-currencies.md b/examples/2.0.x/server-go/examples/locale/list-currencies.md new file mode 100644 index 000000000..6036ee0bd --- /dev/null +++ b/examples/2.0.x/server-go/examples/locale/list-currencies.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/locale" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := locale.New(client) + + response, err := service.ListCurrencies() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/locale/list-languages.md b/examples/2.0.x/server-go/examples/locale/list-languages.md new file mode 100644 index 000000000..b442649e2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/locale/list-languages.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/locale" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := locale.New(client) + + response, err := service.ListLanguages() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-go/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..e5a3e1bca --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-apns-provider.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateAPNSProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateAPNSProviderAuthKey("<AUTH_KEY>"), + service.WithCreateAPNSProviderAuthKeyId("<AUTH_KEY_ID>"), + service.WithCreateAPNSProviderTeamId("<TEAM_ID>"), + service.WithCreateAPNSProviderBundleId("<BUNDLE_ID>"), + service.WithCreateAPNSProviderSandbox(false), + service.WithCreateAPNSProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-email.md b/examples/2.0.x/server-go/examples/messaging/create-email.md new file mode 100644 index 000000000..8c5e7e853 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-email.md @@ -0,0 +1,36 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateEmail( + "<MESSAGE_ID>", + "<SUBJECT>", + "<CONTENT>", + service.WithCreateEmailTopics([]string{"example"}), + service.WithCreateEmailUsers([]string{"example"}), + service.WithCreateEmailTargets([]string{"example"}), + service.WithCreateEmailCc([]string{"example"}), + service.WithCreateEmailBcc([]string{"example"}), + service.WithCreateEmailAttachments([]string{"example"}), + service.WithCreateEmailDraft(false), + service.WithCreateEmailHtml(false), + service.WithCreateEmailScheduledAt("2020-10-15T06:38:00.000+00:00"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-go/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..c19a326bf --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-fcm-provider.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateFCMProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateFCMProviderServiceAccountJSON([]interface{}{}), + service.WithCreateFCMProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-go/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..98af3e63b --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,34 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateMailgunProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateMailgunProviderApiKey("<API_KEY>"), + service.WithCreateMailgunProviderDomain("example.com"), + service.WithCreateMailgunProviderIsEuRegion(false), + service.WithCreateMailgunProviderFromName("<FROM_NAME>"), + service.WithCreateMailgunProviderFromEmail("email@example.com"), + service.WithCreateMailgunProviderReplyToName("<REPLY_TO_NAME>"), + service.WithCreateMailgunProviderReplyToEmail("email@example.com"), + service.WithCreateMailgunProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-go/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..794c7b20a --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateMsg91Provider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateMsg91ProviderTemplateId("<TEMPLATE_ID>"), + service.WithCreateMsg91ProviderSenderId("<SENDER_ID>"), + service.WithCreateMsg91ProviderAuthKey("<AUTH_KEY>"), + service.WithCreateMsg91ProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-push.md b/examples/2.0.x/server-go/examples/messaging/create-push.md new file mode 100644 index 000000000..0013cd36f --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-push.md @@ -0,0 +1,43 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreatePush( + "<MESSAGE_ID>", + service.WithCreatePushTitle("<TITLE>"), + service.WithCreatePushBody("<BODY>"), + service.WithCreatePushTopics([]string{"example"}), + service.WithCreatePushUsers([]string{"example"}), + service.WithCreatePushTargets([]string{"example"}), + service.WithCreatePushData([]interface{}{}), + service.WithCreatePushAction("<ACTION>"), + service.WithCreatePushImage("<ID1:ID2>"), + service.WithCreatePushIcon("<ICON>"), + service.WithCreatePushSound("<SOUND>"), + service.WithCreatePushColor("<COLOR>"), + service.WithCreatePushTag("<TAG>"), + service.WithCreatePushBadge(1), + service.WithCreatePushDraft(false), + service.WithCreatePushScheduledAt("2020-10-15T06:38:00.000+00:00"), + service.WithCreatePushContentAvailable(false), + service.WithCreatePushCritical(false), + service.WithCreatePushPriority("normal"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-go/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..099e930f9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-resend-provider.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateResendProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateResendProviderApiKey("<API_KEY>"), + service.WithCreateResendProviderFromName("<FROM_NAME>"), + service.WithCreateResendProviderFromEmail("email@example.com"), + service.WithCreateResendProviderReplyToName("<REPLY_TO_NAME>"), + service.WithCreateResendProviderReplyToEmail("email@example.com"), + service.WithCreateResendProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-go/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..56b804b3f --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateSendgridProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateSendgridProviderApiKey("<API_KEY>"), + service.WithCreateSendgridProviderFromName("<FROM_NAME>"), + service.WithCreateSendgridProviderFromEmail("email@example.com"), + service.WithCreateSendgridProviderReplyToName("<REPLY_TO_NAME>"), + service.WithCreateSendgridProviderReplyToEmail("email@example.com"), + service.WithCreateSendgridProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-go/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..5a2189c5f --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-ses-provider.md @@ -0,0 +1,34 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateSesProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateSesProviderAccessKey("<ACCESS_KEY>"), + service.WithCreateSesProviderSecretKey("<SECRET_KEY>"), + service.WithCreateSesProviderRegion("<REGION>"), + service.WithCreateSesProviderFromName("<FROM_NAME>"), + service.WithCreateSesProviderFromEmail("email@example.com"), + service.WithCreateSesProviderReplyToName("<REPLY_TO_NAME>"), + service.WithCreateSesProviderReplyToEmail("email@example.com"), + service.WithCreateSesProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-sms.md b/examples/2.0.x/server-go/examples/messaging/create-sms.md new file mode 100644 index 000000000..cc4489423 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-sms.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateSMS( + "<MESSAGE_ID>", + "<CONTENT>", + service.WithCreateSMSTopics([]string{"example"}), + service.WithCreateSMSUsers([]string{"example"}), + service.WithCreateSMSTargets([]string{"example"}), + service.WithCreateSMSDraft(false), + service.WithCreateSMSScheduledAt("2020-10-15T06:38:00.000+00:00"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-go/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..9f9cee76c --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-smtp-provider.md @@ -0,0 +1,38 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateSMTPProvider( + "<PROVIDER_ID>", + "<NAME>", + "<HOST>", + service.WithCreateSMTPProviderPort(587), + service.WithCreateSMTPProviderUsername("<USERNAME>"), + service.WithCreateSMTPProviderPassword("password"), + service.WithCreateSMTPProviderEncryption("none"), + service.WithCreateSMTPProviderAutoTLS(false), + service.WithCreateSMTPProviderMailer("<MAILER>"), + service.WithCreateSMTPProviderFromName("<FROM_NAME>"), + service.WithCreateSMTPProviderFromEmail("email@example.com"), + service.WithCreateSMTPProviderReplyToName("<REPLY_TO_NAME>"), + service.WithCreateSMTPProviderReplyToEmail("email@example.com"), + service.WithCreateSMTPProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-subscriber.md b/examples/2.0.x/server-go/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..9b6f5adef --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-subscriber.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithJWT("<YOUR_JWT>"), + ) + + service := messaging.New(client) + + response, err := service.CreateSubscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>", + "<TARGET_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-go/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..9b5c61f51 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-telesign-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateTelesignProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateTelesignProviderFrom("+12065550100"), + service.WithCreateTelesignProviderCustomerId("<CUSTOMER_ID>"), + service.WithCreateTelesignProviderApiKey("<API_KEY>"), + service.WithCreateTelesignProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-go/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..cf044e4ee --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateTextmagicProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateTextmagicProviderFrom("+12065550100"), + service.WithCreateTextmagicProviderUsername("<USERNAME>"), + service.WithCreateTextmagicProviderApiKey("<API_KEY>"), + service.WithCreateTextmagicProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-topic.md b/examples/2.0.x/server-go/examples/messaging/create-topic.md new file mode 100644 index 000000000..6c15cb275 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-topic.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateTopic( + "<TOPIC_ID>", + "<NAME>", + service.WithCreateTopicSubscribe([]string{"any"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-go/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..c91ffa35f --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-twilio-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateTwilioProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateTwilioProviderFrom("+12065550100"), + service.WithCreateTwilioProviderAccountSid("<ACCOUNT_SID>"), + service.WithCreateTwilioProviderAuthToken("<AUTH_TOKEN>"), + service.WithCreateTwilioProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-go/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..ee1a94922 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/create-vonage-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.CreateVonageProvider( + "<PROVIDER_ID>", + "<NAME>", + service.WithCreateVonageProviderFrom("+12065550100"), + service.WithCreateVonageProviderApiKey("<API_KEY>"), + service.WithCreateVonageProviderApiSecret("<API_SECRET>"), + service.WithCreateVonageProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/delete-provider.md b/examples/2.0.x/server-go/examples/messaging/delete-provider.md new file mode 100644 index 000000000..5fda94526 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/delete-provider.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.DeleteProvider( + "<PROVIDER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-go/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..25beceb93 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/delete-subscriber.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithJWT("<YOUR_JWT>"), + ) + + service := messaging.New(client) + + response, err := service.DeleteSubscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/delete-topic.md b/examples/2.0.x/server-go/examples/messaging/delete-topic.md new file mode 100644 index 000000000..27c934ab0 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/delete-topic.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.DeleteTopic( + "<TOPIC_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/delete.md b/examples/2.0.x/server-go/examples/messaging/delete.md new file mode 100644 index 000000000..65eacb96c --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.Delete( + "<MESSAGE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/get-message.md b/examples/2.0.x/server-go/examples/messaging/get-message.md new file mode 100644 index 000000000..9b28d58c6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/get-message.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.GetMessage( + "<MESSAGE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/get-provider.md b/examples/2.0.x/server-go/examples/messaging/get-provider.md new file mode 100644 index 000000000..377204592 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/get-provider.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.GetProvider( + "<PROVIDER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/get-subscriber.md b/examples/2.0.x/server-go/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..a9dd01bca --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/get-subscriber.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.GetSubscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/get-topic.md b/examples/2.0.x/server-go/examples/messaging/get-topic.md new file mode 100644 index 000000000..fccba6fc6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/get-topic.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.GetTopic( + "<TOPIC_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/list-messages.md b/examples/2.0.x/server-go/examples/messaging/list-messages.md new file mode 100644 index 000000000..203f619f5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/list-messages.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.ListMessages( + service.WithListMessagesQueries([]string{"example"}), + service.WithListMessagesSearch("<SEARCH>"), + service.WithListMessagesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/list-providers.md b/examples/2.0.x/server-go/examples/messaging/list-providers.md new file mode 100644 index 000000000..734a26a95 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/list-providers.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.ListProviders( + service.WithListProvidersQueries([]string{"example"}), + service.WithListProvidersSearch("<SEARCH>"), + service.WithListProvidersTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/list-subscribers.md b/examples/2.0.x/server-go/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..ec9c3426b --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/list-subscribers.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.ListSubscribers( + "<TOPIC_ID>", + service.WithListSubscribersQueries([]string{"example"}), + service.WithListSubscribersSearch("<SEARCH>"), + service.WithListSubscribersTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/list-targets.md b/examples/2.0.x/server-go/examples/messaging/list-targets.md new file mode 100644 index 000000000..b6ab92574 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/list-targets.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.ListTargets( + "<MESSAGE_ID>", + service.WithListTargetsQueries([]string{"example"}), + service.WithListTargetsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/list-topics.md b/examples/2.0.x/server-go/examples/messaging/list-topics.md new file mode 100644 index 000000000..3c61598ef --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/list-topics.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.ListTopics( + service.WithListTopicsQueries([]string{"example"}), + service.WithListTopicsSearch("<SEARCH>"), + service.WithListTopicsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-go/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..87362c094 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-apns-provider.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateAPNSProvider( + "<PROVIDER_ID>", + service.WithUpdateAPNSProviderName("<NAME>"), + service.WithUpdateAPNSProviderEnabled(false), + service.WithUpdateAPNSProviderAuthKey("<AUTH_KEY>"), + service.WithUpdateAPNSProviderAuthKeyId("<AUTH_KEY_ID>"), + service.WithUpdateAPNSProviderTeamId("<TEAM_ID>"), + service.WithUpdateAPNSProviderBundleId("<BUNDLE_ID>"), + service.WithUpdateAPNSProviderSandbox(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-email.md b/examples/2.0.x/server-go/examples/messaging/update-email.md new file mode 100644 index 000000000..b2d9300af --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-email.md @@ -0,0 +1,36 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateEmail( + "<MESSAGE_ID>", + service.WithUpdateEmailTopics([]string{"example"}), + service.WithUpdateEmailUsers([]string{"example"}), + service.WithUpdateEmailTargets([]string{"example"}), + service.WithUpdateEmailSubject("<SUBJECT>"), + service.WithUpdateEmailContent("<CONTENT>"), + service.WithUpdateEmailDraft(false), + service.WithUpdateEmailHtml(false), + service.WithUpdateEmailCc([]string{"example"}), + service.WithUpdateEmailBcc([]string{"example"}), + service.WithUpdateEmailScheduledAt("2020-10-15T06:38:00.000+00:00"), + service.WithUpdateEmailAttachments([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-go/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..55daa25c7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-fcm-provider.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateFCMProvider( + "<PROVIDER_ID>", + service.WithUpdateFCMProviderName("<NAME>"), + service.WithUpdateFCMProviderEnabled(false), + service.WithUpdateFCMProviderServiceAccountJSON([]interface{}{}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-go/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..4fa32a300 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,34 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateMailgunProvider( + "<PROVIDER_ID>", + service.WithUpdateMailgunProviderName("<NAME>"), + service.WithUpdateMailgunProviderApiKey("<API_KEY>"), + service.WithUpdateMailgunProviderDomain("example.com"), + service.WithUpdateMailgunProviderIsEuRegion(false), + service.WithUpdateMailgunProviderEnabled(false), + service.WithUpdateMailgunProviderFromName("<FROM_NAME>"), + service.WithUpdateMailgunProviderFromEmail("email@example.com"), + service.WithUpdateMailgunProviderReplyToName("<REPLY_TO_NAME>"), + service.WithUpdateMailgunProviderReplyToEmail("<REPLY_TO_EMAIL>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-go/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..868f1e299 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateMsg91Provider( + "<PROVIDER_ID>", + service.WithUpdateMsg91ProviderName("<NAME>"), + service.WithUpdateMsg91ProviderEnabled(false), + service.WithUpdateMsg91ProviderTemplateId("<TEMPLATE_ID>"), + service.WithUpdateMsg91ProviderSenderId("<SENDER_ID>"), + service.WithUpdateMsg91ProviderAuthKey("<AUTH_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-push.md b/examples/2.0.x/server-go/examples/messaging/update-push.md new file mode 100644 index 000000000..1f5f9931d --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-push.md @@ -0,0 +1,43 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdatePush( + "<MESSAGE_ID>", + service.WithUpdatePushTopics([]string{"example"}), + service.WithUpdatePushUsers([]string{"example"}), + service.WithUpdatePushTargets([]string{"example"}), + service.WithUpdatePushTitle("<TITLE>"), + service.WithUpdatePushBody("<BODY>"), + service.WithUpdatePushData([]interface{}{}), + service.WithUpdatePushAction("<ACTION>"), + service.WithUpdatePushImage("<ID1:ID2>"), + service.WithUpdatePushIcon("<ICON>"), + service.WithUpdatePushSound("<SOUND>"), + service.WithUpdatePushColor("<COLOR>"), + service.WithUpdatePushTag("<TAG>"), + service.WithUpdatePushBadge(1), + service.WithUpdatePushDraft(false), + service.WithUpdatePushScheduledAt("2020-10-15T06:38:00.000+00:00"), + service.WithUpdatePushContentAvailable(false), + service.WithUpdatePushCritical(false), + service.WithUpdatePushPriority("normal"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-go/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..7e1a3f9aa --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-resend-provider.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateResendProvider( + "<PROVIDER_ID>", + service.WithUpdateResendProviderName("<NAME>"), + service.WithUpdateResendProviderEnabled(false), + service.WithUpdateResendProviderApiKey("<API_KEY>"), + service.WithUpdateResendProviderFromName("<FROM_NAME>"), + service.WithUpdateResendProviderFromEmail("email@example.com"), + service.WithUpdateResendProviderReplyToName("<REPLY_TO_NAME>"), + service.WithUpdateResendProviderReplyToEmail("<REPLY_TO_EMAIL>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-go/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..95aa9dc73 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateSendgridProvider( + "<PROVIDER_ID>", + service.WithUpdateSendgridProviderName("<NAME>"), + service.WithUpdateSendgridProviderEnabled(false), + service.WithUpdateSendgridProviderApiKey("<API_KEY>"), + service.WithUpdateSendgridProviderFromName("<FROM_NAME>"), + service.WithUpdateSendgridProviderFromEmail("email@example.com"), + service.WithUpdateSendgridProviderReplyToName("<REPLY_TO_NAME>"), + service.WithUpdateSendgridProviderReplyToEmail("<REPLY_TO_EMAIL>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-go/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..59f5023d6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-ses-provider.md @@ -0,0 +1,34 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateSesProvider( + "<PROVIDER_ID>", + service.WithUpdateSesProviderName("<NAME>"), + service.WithUpdateSesProviderEnabled(false), + service.WithUpdateSesProviderAccessKey("<ACCESS_KEY>"), + service.WithUpdateSesProviderSecretKey("<SECRET_KEY>"), + service.WithUpdateSesProviderRegion("<REGION>"), + service.WithUpdateSesProviderFromName("<FROM_NAME>"), + service.WithUpdateSesProviderFromEmail("email@example.com"), + service.WithUpdateSesProviderReplyToName("<REPLY_TO_NAME>"), + service.WithUpdateSesProviderReplyToEmail("<REPLY_TO_EMAIL>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-sms.md b/examples/2.0.x/server-go/examples/messaging/update-sms.md new file mode 100644 index 000000000..d202c24db --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-sms.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateSMS( + "<MESSAGE_ID>", + service.WithUpdateSMSTopics([]string{"example"}), + service.WithUpdateSMSUsers([]string{"example"}), + service.WithUpdateSMSTargets([]string{"example"}), + service.WithUpdateSMSContent("<CONTENT>"), + service.WithUpdateSMSDraft(false), + service.WithUpdateSMSScheduledAt("2020-10-15T06:38:00.000+00:00"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-go/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..86b34ef5b --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-smtp-provider.md @@ -0,0 +1,38 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateSMTPProvider( + "<PROVIDER_ID>", + service.WithUpdateSMTPProviderName("<NAME>"), + service.WithUpdateSMTPProviderHost("<HOST>"), + service.WithUpdateSMTPProviderPort(1), + service.WithUpdateSMTPProviderUsername("<USERNAME>"), + service.WithUpdateSMTPProviderPassword("password"), + service.WithUpdateSMTPProviderEncryption("none"), + service.WithUpdateSMTPProviderAutoTLS(false), + service.WithUpdateSMTPProviderMailer("<MAILER>"), + service.WithUpdateSMTPProviderFromName("<FROM_NAME>"), + service.WithUpdateSMTPProviderFromEmail("email@example.com"), + service.WithUpdateSMTPProviderReplyToName("<REPLY_TO_NAME>"), + service.WithUpdateSMTPProviderReplyToEmail("<REPLY_TO_EMAIL>"), + service.WithUpdateSMTPProviderEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-go/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..e86fdbfa5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-telesign-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateTelesignProvider( + "<PROVIDER_ID>", + service.WithUpdateTelesignProviderName("<NAME>"), + service.WithUpdateTelesignProviderEnabled(false), + service.WithUpdateTelesignProviderCustomerId("<CUSTOMER_ID>"), + service.WithUpdateTelesignProviderApiKey("<API_KEY>"), + service.WithUpdateTelesignProviderFrom("<FROM>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-go/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..7fce6bfe5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateTextmagicProvider( + "<PROVIDER_ID>", + service.WithUpdateTextmagicProviderName("<NAME>"), + service.WithUpdateTextmagicProviderEnabled(false), + service.WithUpdateTextmagicProviderUsername("<USERNAME>"), + service.WithUpdateTextmagicProviderApiKey("<API_KEY>"), + service.WithUpdateTextmagicProviderFrom("<FROM>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-topic.md b/examples/2.0.x/server-go/examples/messaging/update-topic.md new file mode 100644 index 000000000..a3c6ade4c --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-topic.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateTopic( + "<TOPIC_ID>", + service.WithUpdateTopicName("<NAME>"), + service.WithUpdateTopicSubscribe([]string{"any"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-go/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..057bfa001 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-twilio-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateTwilioProvider( + "<PROVIDER_ID>", + service.WithUpdateTwilioProviderName("<NAME>"), + service.WithUpdateTwilioProviderEnabled(false), + service.WithUpdateTwilioProviderAccountSid("<ACCOUNT_SID>"), + service.WithUpdateTwilioProviderAuthToken("<AUTH_TOKEN>"), + service.WithUpdateTwilioProviderFrom("<FROM>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-go/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..830a0cf12 --- /dev/null +++ b/examples/2.0.x/server-go/examples/messaging/update-vonage-provider.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/messaging" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := messaging.New(client) + + response, err := service.UpdateVonageProvider( + "<PROVIDER_ID>", + service.WithUpdateVonageProviderName("<NAME>"), + service.WithUpdateVonageProviderEnabled(false), + service.WithUpdateVonageProviderApiKey("<API_KEY>"), + service.WithUpdateVonageProviderApiSecret("<API_SECRET>"), + service.WithUpdateVonageProviderFrom("<FROM>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/organization/create-project.md b/examples/2.0.x/server-go/examples/organization/create-project.md new file mode 100644 index 000000000..770dc70ba --- /dev/null +++ b/examples/2.0.x/server-go/examples/organization/create-project.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/organization" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := organization.New(client) + + response, err := service.CreateProject( + "<PROJECT_ID>", + "<NAME>", + service.WithCreateProjectRegion("default"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/organization/delete-project.md b/examples/2.0.x/server-go/examples/organization/delete-project.md new file mode 100644 index 000000000..1d463fb53 --- /dev/null +++ b/examples/2.0.x/server-go/examples/organization/delete-project.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/organization" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := organization.New(client) + + response, err := service.DeleteProject( + "<PROJECT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/organization/get-project.md b/examples/2.0.x/server-go/examples/organization/get-project.md new file mode 100644 index 000000000..6b622b5cd --- /dev/null +++ b/examples/2.0.x/server-go/examples/organization/get-project.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/organization" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := organization.New(client) + + response, err := service.GetProject( + "<PROJECT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/organization/list-projects.md b/examples/2.0.x/server-go/examples/organization/list-projects.md new file mode 100644 index 000000000..87357a2ea --- /dev/null +++ b/examples/2.0.x/server-go/examples/organization/list-projects.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/organization" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := organization.New(client) + + response, err := service.ListProjects( + service.WithListProjectsQueries([]string{"example"}), + service.WithListProjectsSearch("<SEARCH>"), + service.WithListProjectsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/organization/update-project.md b/examples/2.0.x/server-go/examples/organization/update-project.md new file mode 100644 index 000000000..2c838dc96 --- /dev/null +++ b/examples/2.0.x/server-go/examples/organization/update-project.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/organization" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := organization.New(client) + + response, err := service.UpdateProject( + "<PROJECT_ID>", + "<NAME>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/presences/delete.md b/examples/2.0.x/server-go/examples/presences/delete.md new file mode 100644 index 000000000..77c13601c --- /dev/null +++ b/examples/2.0.x/server-go/examples/presences/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/presences" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := presences.New(client) + + response, err := service.Delete( + "<PRESENCE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/presences/get.md b/examples/2.0.x/server-go/examples/presences/get.md new file mode 100644 index 000000000..901ba5ff3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/presences/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/presences" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := presences.New(client) + + response, err := service.Get( + "<PRESENCE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/presences/list.md b/examples/2.0.x/server-go/examples/presences/list.md new file mode 100644 index 000000000..5b9512a32 --- /dev/null +++ b/examples/2.0.x/server-go/examples/presences/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/presences" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := presences.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListTotal(false), + service.WithListTtl(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/presences/update.md b/examples/2.0.x/server-go/examples/presences/update.md new file mode 100644 index 000000000..7b1c2f01c --- /dev/null +++ b/examples/2.0.x/server-go/examples/presences/update.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/presences" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := presences.New(client) + + response, err := service.Update( + "<PRESENCE_ID>", + "<USER_ID>", + service.WithUpdateStatus("<STATUS>"), + service.WithUpdateExpiresAt("2020-10-15T06:38:00.000+00:00"), + service.WithUpdateMetadata([]interface{}{}), + service.WithUpdatePermissions([]string{"read(\"any\")"}), + service.WithUpdatePurge(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/presences/upsert.md b/examples/2.0.x/server-go/examples/presences/upsert.md new file mode 100644 index 000000000..81eaa3fd1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/presences/upsert.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/presences" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := presences.New(client) + + response, err := service.Upsert( + "<PRESENCE_ID>", + "<USER_ID>", + "<STATUS>", + service.WithUpsertPermissions([]string{"read(\"any\")"}), + service.WithUpsertExpiresAt("2020-10-15T06:38:00.000+00:00"), + service.WithUpsertMetadata([]interface{}{}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-android-platform.md b/examples/2.0.x/server-go/examples/project/create-android-platform.md new file mode 100644 index 000000000..b2ddb5279 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-android-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateAndroidPlatform( + "<PLATFORM_ID>", + "<NAME>", + "<APPLICATION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-apple-platform.md b/examples/2.0.x/server-go/examples/project/create-apple-platform.md new file mode 100644 index 000000000..758045088 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-apple-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateApplePlatform( + "<PLATFORM_ID>", + "<NAME>", + "<BUNDLE_IDENTIFIER>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-go/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..aa53d32c2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-ephemeral-key.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateEphemeralKey( + []string{"example"}, + 600, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-linux-platform.md b/examples/2.0.x/server-go/examples/project/create-linux-platform.md new file mode 100644 index 000000000..41d1d7187 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-linux-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateLinuxPlatform( + "<PLATFORM_ID>", + "<NAME>", + "<PACKAGE_NAME>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-mock-phone.md b/examples/2.0.x/server-go/examples/project/create-mock-phone.md new file mode 100644 index 000000000..40d609f68 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-mock-phone.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateMockPhone( + "+12065550100", + "<OTP>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-smtp-test.md b/examples/2.0.x/server-go/examples/project/create-smtp-test.md new file mode 100644 index 000000000..6a11ed49f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-smtp-test.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateSMTPTest( + []string{"example"}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-variable.md b/examples/2.0.x/server-go/examples/project/create-variable.md new file mode 100644 index 000000000..e29b66d7e --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-variable.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateVariable( + "<VARIABLE_ID>", + "<KEY>", + "<VALUE>", + service.WithCreateVariableSecret(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-web-platform.md b/examples/2.0.x/server-go/examples/project/create-web-platform.md new file mode 100644 index 000000000..7c346bb7a --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-web-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateWebPlatform( + "<PLATFORM_ID>", + "<NAME>", + "app.example.com", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/create-windows-platform.md b/examples/2.0.x/server-go/examples/project/create-windows-platform.md new file mode 100644 index 000000000..0d42b86f5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/create-windows-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.CreateWindowsPlatform( + "<PLATFORM_ID>", + "<NAME>", + "<PACKAGE_IDENTIFIER_NAME>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/delete-key.md b/examples/2.0.x/server-go/examples/project/delete-key.md new file mode 100644 index 000000000..e6aab4df3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/delete-key.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.DeleteKey( + "<KEY_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/delete-mock-phone.md b/examples/2.0.x/server-go/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..f97df0c68 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/delete-mock-phone.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.DeleteMockPhone( + "+12065550100", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/delete-platform.md b/examples/2.0.x/server-go/examples/project/delete-platform.md new file mode 100644 index 000000000..050e5ac7c --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/delete-platform.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.DeletePlatform( + "<PLATFORM_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/delete-variable.md b/examples/2.0.x/server-go/examples/project/delete-variable.md new file mode 100644 index 000000000..c1520d101 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/delete-variable.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.DeleteVariable( + "<VARIABLE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/delete.md b/examples/2.0.x/server-go/examples/project/delete.md new file mode 100644 index 000000000..bea390393 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/delete.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.Delete() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/get-email-template.md b/examples/2.0.x/server-go/examples/project/get-email-template.md new file mode 100644 index 000000000..a0c6831cb --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/get-email-template.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.GetEmailTemplate( + "verification", + service.WithGetEmailTemplateLocale("af"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/get-key.md b/examples/2.0.x/server-go/examples/project/get-key.md new file mode 100644 index 000000000..865b99e16 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/get-key.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.GetKey( + "<KEY_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/get-mock-phone.md b/examples/2.0.x/server-go/examples/project/get-mock-phone.md new file mode 100644 index 000000000..91b057e98 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/get-mock-phone.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.GetMockPhone( + "+12065550100", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-go/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..dd45f459d --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.GetOAuth2Provider( + "amazon", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/get-platform.md b/examples/2.0.x/server-go/examples/project/get-platform.md new file mode 100644 index 000000000..74a6ed0db --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/get-platform.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.GetPlatform( + "<PLATFORM_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/get-policy.md b/examples/2.0.x/server-go/examples/project/get-policy.md new file mode 100644 index 000000000..826e95075 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/get-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.GetPolicy( + "password-dictionary", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/get-variable.md b/examples/2.0.x/server-go/examples/project/get-variable.md new file mode 100644 index 000000000..3e9a317e3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/get-variable.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.GetVariable( + "<VARIABLE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/get.md b/examples/2.0.x/server-go/examples/project/get.md new file mode 100644 index 000000000..476d1acd6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/get.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.Get() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/list-email-templates.md b/examples/2.0.x/server-go/examples/project/list-email-templates.md new file mode 100644 index 000000000..9c41322e8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/list-email-templates.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.ListEmailTemplates( + service.WithListEmailTemplatesQueries([]string{"example"}), + service.WithListEmailTemplatesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/list-keys.md b/examples/2.0.x/server-go/examples/project/list-keys.md new file mode 100644 index 000000000..73334b11c --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/list-keys.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.ListKeys( + service.WithListKeysQueries([]string{"example"}), + service.WithListKeysTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/list-mock-phones.md b/examples/2.0.x/server-go/examples/project/list-mock-phones.md new file mode 100644 index 000000000..deed3e3c5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/list-mock-phones.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.ListMockPhones( + service.WithListMockPhonesQueries([]string{"example"}), + service.WithListMockPhonesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-go/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..8b56064c9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.ListOAuth2Providers( + service.WithListOAuth2ProvidersQueries([]string{"example"}), + service.WithListOAuth2ProvidersTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/list-platforms.md b/examples/2.0.x/server-go/examples/project/list-platforms.md new file mode 100644 index 000000000..8db7c4326 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/list-platforms.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.ListPlatforms( + service.WithListPlatformsQueries([]string{"example"}), + service.WithListPlatformsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/list-policies.md b/examples/2.0.x/server-go/examples/project/list-policies.md new file mode 100644 index 000000000..b7b88e00c --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/list-policies.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.ListPolicies( + service.WithListPoliciesQueries([]string{"example"}), + service.WithListPoliciesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/list-variables.md b/examples/2.0.x/server-go/examples/project/list-variables.md new file mode 100644 index 000000000..5a8a9d85f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/list-variables.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.ListVariables( + service.WithListVariablesQueries([]string{"example"}), + service.WithListVariablesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-android-platform.md b/examples/2.0.x/server-go/examples/project/update-android-platform.md new file mode 100644 index 000000000..f834a275b --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-android-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateAndroidPlatform( + "<PLATFORM_ID>", + "<NAME>", + "<APPLICATION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-apple-platform.md b/examples/2.0.x/server-go/examples/project/update-apple-platform.md new file mode 100644 index 000000000..ffccb85b1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-apple-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateApplePlatform( + "<PLATFORM_ID>", + "<NAME>", + "<BUNDLE_IDENTIFIER>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-auth-method.md b/examples/2.0.x/server-go/examples/project/update-auth-method.md new file mode 100644 index 000000000..233e39a78 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-auth-method.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateAuthMethod( + "email-password", + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-email-template.md b/examples/2.0.x/server-go/examples/project/update-email-template.md new file mode 100644 index 000000000..4fcf25eff --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-email-template.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateEmailTemplate( + "verification", + service.WithUpdateEmailTemplateLocale("af"), + service.WithUpdateEmailTemplateSubject("<SUBJECT>"), + service.WithUpdateEmailTemplateMessage("<MESSAGE>"), + service.WithUpdateEmailTemplateSenderName("<SENDER_NAME>"), + service.WithUpdateEmailTemplateSenderEmail("email@example.com"), + service.WithUpdateEmailTemplateReplyToEmail("email@example.com"), + service.WithUpdateEmailTemplateReplyToName("<REPLY_TO_NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-key.md b/examples/2.0.x/server-go/examples/project/update-key.md new file mode 100644 index 000000000..265ca84a1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-key.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateKey( + "<KEY_ID>", + "<NAME>", + []string{"example"}, + service.WithUpdateKeyExpire("2020-10-15T06:38:00.000+00:00"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-labels.md b/examples/2.0.x/server-go/examples/project/update-labels.md new file mode 100644 index 000000000..e41ce9df1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-labels.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateLabels( + []string{"example"}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-linux-platform.md b/examples/2.0.x/server-go/examples/project/update-linux-platform.md new file mode 100644 index 000000000..a4a543cb3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-linux-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateLinuxPlatform( + "<PLATFORM_ID>", + "<NAME>", + "<PACKAGE_NAME>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-go/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..4b6b680b2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateMembershipPrivacyPolicy( + service.WithUpdateMembershipPrivacyPolicyUserId(false), + service.WithUpdateMembershipPrivacyPolicyUserEmail(false), + service.WithUpdateMembershipPrivacyPolicyUserPhone(false), + service.WithUpdateMembershipPrivacyPolicyUserName(false), + service.WithUpdateMembershipPrivacyPolicyUserMFA(false), + service.WithUpdateMembershipPrivacyPolicyUserAccessedAt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-go/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..ff2bc6118 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateMFAFactorsPolicy( + service.WithUpdateMFAFactorsPolicyTotp(false), + service.WithUpdateMFAFactorsPolicyEmail(false), + service.WithUpdateMFAFactorsPolicyPhone(false), + service.WithUpdateMFAFactorsPolicyCustom(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-mock-phone.md b/examples/2.0.x/server-go/examples/project/update-mock-phone.md new file mode 100644 index 000000000..294b599d2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-mock-phone.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateMockPhone( + "+12065550100", + "<OTP>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..7dc8ecea2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Amazon( + service.WithUpdateOAuth2AmazonClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2AmazonClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2AmazonEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..6a1805bd8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Apple( + service.WithUpdateOAuth2AppleServiceId("<SERVICE_ID>"), + service.WithUpdateOAuth2AppleKeyId("<KEY_ID>"), + service.WithUpdateOAuth2AppleTeamId("<TEAM_ID>"), + service.WithUpdateOAuth2AppleP8File("<P8_FILE>"), + service.WithUpdateOAuth2AppleEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..51728cca2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Appwrite( + service.WithUpdateOAuth2AppwriteClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2AppwriteClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2AppwriteEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..1c1b66117 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Auth0( + service.WithUpdateOAuth2Auth0ClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2Auth0ClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2Auth0Endpoint("<ENDPOINT>"), + service.WithUpdateOAuth2Auth0Enabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..ef71c5c3e --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Authentik( + service.WithUpdateOAuth2AuthentikClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2AuthentikClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2AuthentikEndpoint("<ENDPOINT>"), + service.WithUpdateOAuth2AuthentikEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..01fad498f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Autodesk( + service.WithUpdateOAuth2AutodeskClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2AutodeskClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2AutodeskEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..94ae9ca6f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Bitbucket( + service.WithUpdateOAuth2BitbucketKey("<KEY>"), + service.WithUpdateOAuth2BitbucketSecret("<SECRET>"), + service.WithUpdateOAuth2BitbucketEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..6a8fe6e1d --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Bitly( + service.WithUpdateOAuth2BitlyClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2BitlyClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2BitlyEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..57fe57400 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-box.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Box( + service.WithUpdateOAuth2BoxClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2BoxClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2BoxEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..e29d63ff4 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Cloudflare( + service.WithUpdateOAuth2CloudflareClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2CloudflareClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2CloudflareEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..9ea6f368f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Dailymotion( + service.WithUpdateOAuth2DailymotionApiKey("<API_KEY>"), + service.WithUpdateOAuth2DailymotionApiSecret("<API_SECRET>"), + service.WithUpdateOAuth2DailymotionEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..97a87e372 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Discord( + service.WithUpdateOAuth2DiscordClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2DiscordClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2DiscordEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..e0761dcd9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Disqus( + service.WithUpdateOAuth2DisqusPublicKey("<PUBLIC_KEY>"), + service.WithUpdateOAuth2DisqusSecretKey("<SECRET_KEY>"), + service.WithUpdateOAuth2DisqusEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..9d1681226 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Dropbox( + service.WithUpdateOAuth2DropboxAppKey("<APP_KEY>"), + service.WithUpdateOAuth2DropboxAppSecret("<APP_SECRET>"), + service.WithUpdateOAuth2DropboxEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..4950233d6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Etsy( + service.WithUpdateOAuth2EtsyKeyString("<KEY_STRING>"), + service.WithUpdateOAuth2EtsySharedSecret("<SHARED_SECRET>"), + service.WithUpdateOAuth2EtsyEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..a8b415ade --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Facebook( + service.WithUpdateOAuth2FacebookAppId("<APP_ID>"), + service.WithUpdateOAuth2FacebookAppSecret("<APP_SECRET>"), + service.WithUpdateOAuth2FacebookEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..d2a41f594 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Figma( + service.WithUpdateOAuth2FigmaClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2FigmaClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2FigmaEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..97ab0413a --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2FusionAuth( + service.WithUpdateOAuth2FusionAuthClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2FusionAuthClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2FusionAuthEndpoint("<ENDPOINT>"), + service.WithUpdateOAuth2FusionAuthEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..c794adc02 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2GitHub( + service.WithUpdateOAuth2GitHubClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2GitHubClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2GitHubEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..5ec0fc50a --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Gitlab( + service.WithUpdateOAuth2GitlabApplicationId("<APPLICATION_ID>"), + service.WithUpdateOAuth2GitlabSecret("<SECRET>"), + service.WithUpdateOAuth2GitlabEndpoint("https://example.com"), + service.WithUpdateOAuth2GitlabEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..1b3219ccd --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-google.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Google( + service.WithUpdateOAuth2GoogleClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2GoogleClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2GooglePrompt([]string{"example"}), + service.WithUpdateOAuth2GoogleEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..ea9d6d34b --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2HuggingFace( + service.WithUpdateOAuth2HuggingFaceClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2HuggingFaceClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2HuggingFaceEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..f120a00a2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Keycloak( + service.WithUpdateOAuth2KeycloakClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2KeycloakClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2KeycloakEndpoint("<ENDPOINT>"), + service.WithUpdateOAuth2KeycloakRealmName("<REALM_NAME>"), + service.WithUpdateOAuth2KeycloakEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..59c9a41b2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Kick( + service.WithUpdateOAuth2KickClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2KickClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2KickEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..77ce01846 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Linkedin( + service.WithUpdateOAuth2LinkedinClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2LinkedinPrimaryClientSecret("<PRIMARY_CLIENT_SECRET>"), + service.WithUpdateOAuth2LinkedinEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..1d45b5ceb --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Microsoft( + service.WithUpdateOAuth2MicrosoftApplicationId("<APPLICATION_ID>"), + service.WithUpdateOAuth2MicrosoftApplicationSecret("<APPLICATION_SECRET>"), + service.WithUpdateOAuth2MicrosoftTenant("<TENANT>"), + service.WithUpdateOAuth2MicrosoftEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..4f78847b8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Notion( + service.WithUpdateOAuth2NotionOauthClientId("<OAUTH_CLIENT_ID>"), + service.WithUpdateOAuth2NotionOauthClientSecret("<OAUTH_CLIENT_SECRET>"), + service.WithUpdateOAuth2NotionEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..1923e1a0f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,33 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Oidc( + service.WithUpdateOAuth2OidcClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2OidcClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2OidcWellKnownURL("https://example.com"), + service.WithUpdateOAuth2OidcAuthorizationURL("https://example.com"), + service.WithUpdateOAuth2OidcTokenURL("https://example.com"), + service.WithUpdateOAuth2OidcUserInfoURL("https://example.com"), + service.WithUpdateOAuth2OidcPrompt([]string{"example"}), + service.WithUpdateOAuth2OidcMaxAge(0), + service.WithUpdateOAuth2OidcEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..472c5d443 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Okta( + service.WithUpdateOAuth2OktaClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2OktaClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2OktaDomain("example.com"), + service.WithUpdateOAuth2OktaAuthorizationServerId("<AUTHORIZATION_SERVER_ID>"), + service.WithUpdateOAuth2OktaEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..f2d47f0e8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2PaypalSandbox( + service.WithUpdateOAuth2PaypalSandboxClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2PaypalSandboxSecretKey("<SECRET_KEY>"), + service.WithUpdateOAuth2PaypalSandboxEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..3e313d220 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Paypal( + service.WithUpdateOAuth2PaypalClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2PaypalSecretKey("<SECRET_KEY>"), + service.WithUpdateOAuth2PaypalEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..718d7cb06 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Podio( + service.WithUpdateOAuth2PodioClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2PodioClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2PodioEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..0cbc52d1e --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Resend( + service.WithUpdateOAuth2ResendClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2ResendClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2ResendEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..eabff4e27 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Salesforce( + service.WithUpdateOAuth2SalesforceCustomerKey("<CUSTOMER_KEY>"), + service.WithUpdateOAuth2SalesforceCustomerSecret("<CUSTOMER_SECRET>"), + service.WithUpdateOAuth2SalesforceEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..70955752f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Slack( + service.WithUpdateOAuth2SlackClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2SlackClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2SlackEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..ba3278fac --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Spotify( + service.WithUpdateOAuth2SpotifyClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2SpotifyClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2SpotifyEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..c75c6ce18 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Stripe( + service.WithUpdateOAuth2StripeClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2StripeApiSecretKey("<API_SECRET_KEY>"), + service.WithUpdateOAuth2StripeEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..c45d2dc1b --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2TradeshiftSandbox( + service.WithUpdateOAuth2TradeshiftSandboxOauth2ClientId("<OAUTH2_CLIENT_ID>"), + service.WithUpdateOAuth2TradeshiftSandboxOauth2ClientSecret("<OAUTH2_CLIENT_SECRET>"), + service.WithUpdateOAuth2TradeshiftSandboxEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..612664da3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Tradeshift( + service.WithUpdateOAuth2TradeshiftOauth2ClientId("<OAUTH2_CLIENT_ID>"), + service.WithUpdateOAuth2TradeshiftOauth2ClientSecret("<OAUTH2_CLIENT_SECRET>"), + service.WithUpdateOAuth2TradeshiftEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..fb36d9a6c --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Twitch( + service.WithUpdateOAuth2TwitchClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2TwitchClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2TwitchEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..2ee13e748 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2WordPress( + service.WithUpdateOAuth2WordPressClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2WordPressClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2WordPressEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..2c86ab6a4 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Yahoo( + service.WithUpdateOAuth2YahooClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2YahooClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2YahooEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..48f2c7cbd --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Yandex( + service.WithUpdateOAuth2YandexClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2YandexClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2YandexEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..983853e0d --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Zoho( + service.WithUpdateOAuth2ZohoClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2ZohoClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2ZohoEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..d5f854b3f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2Zoom( + service.WithUpdateOAuth2ZoomClientId("<CLIENT_ID>"), + service.WithUpdateOAuth2ZoomClientSecret("<CLIENT_SECRET>"), + service.WithUpdateOAuth2ZoomEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-go/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..1dfc98f08 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-o-auth-2x.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateOAuth2X( + service.WithUpdateOAuth2XCustomerKey("<CUSTOMER_KEY>"), + service.WithUpdateOAuth2XSecretKey("<SECRET_KEY>"), + service.WithUpdateOAuth2XEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-go/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..c610e4621 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdatePasswordDictionaryPolicy( + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-password-history-policy.md b/examples/2.0.x/server-go/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..6fa150661 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-password-history-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdatePasswordHistoryPolicy( + 1, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-go/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..f97b5c34e --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdatePasswordPersonalDataPolicy( + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-go/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..c521b9329 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-password-strength-policy.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdatePasswordStrengthPolicy( + service.WithUpdatePasswordStrengthPolicyMin(8), + service.WithUpdatePasswordStrengthPolicyUppercase(false), + service.WithUpdatePasswordStrengthPolicyLowercase(false), + service.WithUpdatePasswordStrengthPolicyNumber(false), + service.WithUpdatePasswordStrengthPolicySymbols(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-protocol.md b/examples/2.0.x/server-go/examples/project/update-protocol.md new file mode 100644 index 000000000..b57a2a0c1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-protocol.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateProtocol( + "rest", + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-service.md b/examples/2.0.x/server-go/examples/project/update-service.md new file mode 100644 index 000000000..76e9e487c --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-service.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateService( + "account", + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-go/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..00340b89f --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-session-alert-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateSessionAlertPolicy( + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-go/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..4dc7454db --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-session-duration-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateSessionDurationPolicy( + 60, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-go/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..3eb354a97 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateSessionInvalidationPolicy( + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-go/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..67708d412 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-session-limit-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateSessionLimitPolicy( + 1, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-smtp.md b/examples/2.0.x/server-go/examples/project/update-smtp.md new file mode 100644 index 000000000..841cdbd4e --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-smtp.md @@ -0,0 +1,34 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateSMTP( + service.WithUpdateSMTPHost("example.com"), + service.WithUpdateSMTPPort(587), + service.WithUpdateSMTPUsername("<USERNAME>"), + service.WithUpdateSMTPPassword("password"), + service.WithUpdateSMTPSenderEmail("email@example.com"), + service.WithUpdateSMTPSenderName("<SENDER_NAME>"), + service.WithUpdateSMTPReplyToEmail("email@example.com"), + service.WithUpdateSMTPReplyToName("<REPLY_TO_NAME>"), + service.WithUpdateSMTPSecure("tls"), + service.WithUpdateSMTPEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-go/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..d16b5d905 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-user-limit-policy.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateUserLimitPolicy( + 0, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-variable.md b/examples/2.0.x/server-go/examples/project/update-variable.md new file mode 100644 index 000000000..db15fa9f4 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-variable.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateVariable( + "<VARIABLE_ID>", + service.WithUpdateVariableKey("<KEY>"), + service.WithUpdateVariableValue("<VALUE>"), + service.WithUpdateVariableSecret(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-web-platform.md b/examples/2.0.x/server-go/examples/project/update-web-platform.md new file mode 100644 index 000000000..e0a721322 --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-web-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateWebPlatform( + "<PLATFORM_ID>", + "<NAME>", + "app.example.com", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/project/update-windows-platform.md b/examples/2.0.x/server-go/examples/project/update-windows-platform.md new file mode 100644 index 000000000..51571ae5a --- /dev/null +++ b/examples/2.0.x/server-go/examples/project/update-windows-platform.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/project" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := project.New(client) + + response, err := service.UpdateWindowsPlatform( + "<PLATFORM_ID>", + "<NAME>", + "<PACKAGE_IDENTIFIER_NAME>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/proxy/create-api-rule.md b/examples/2.0.x/server-go/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..2c74ea097 --- /dev/null +++ b/examples/2.0.x/server-go/examples/proxy/create-api-rule.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/proxy" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := proxy.New(client) + + response, err := service.CreateAPIRule( + "example.com", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/proxy/create-function-rule.md b/examples/2.0.x/server-go/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..0e37ae915 --- /dev/null +++ b/examples/2.0.x/server-go/examples/proxy/create-function-rule.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/proxy" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := proxy.New(client) + + response, err := service.CreateFunctionRule( + "example.com", + "<FUNCTION_ID>", + service.WithCreateFunctionRuleBranch("<BRANCH>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-go/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..e25fbad96 --- /dev/null +++ b/examples/2.0.x/server-go/examples/proxy/create-redirect-rule.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/proxy" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := proxy.New(client) + + response, err := service.CreateRedirectRule( + "example.com", + "https://example.com", + "301", + "<RESOURCE_ID>", + "site", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/proxy/create-site-rule.md b/examples/2.0.x/server-go/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..510b1a0f3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/proxy/create-site-rule.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/proxy" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := proxy.New(client) + + response, err := service.CreateSiteRule( + "example.com", + "<SITE_ID>", + service.WithCreateSiteRuleBranch("<BRANCH>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/proxy/delete-rule.md b/examples/2.0.x/server-go/examples/proxy/delete-rule.md new file mode 100644 index 000000000..1eaa6fd9d --- /dev/null +++ b/examples/2.0.x/server-go/examples/proxy/delete-rule.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/proxy" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := proxy.New(client) + + response, err := service.DeleteRule( + "<RULE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/proxy/get-rule.md b/examples/2.0.x/server-go/examples/proxy/get-rule.md new file mode 100644 index 000000000..c2fc233e2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/proxy/get-rule.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/proxy" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := proxy.New(client) + + response, err := service.GetRule( + "<RULE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/proxy/list-rules.md b/examples/2.0.x/server-go/examples/proxy/list-rules.md new file mode 100644 index 000000000..820f5acd7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/proxy/list-rules.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/proxy" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := proxy.New(client) + + response, err := service.ListRules( + service.WithListRulesQueries([]string{"example"}), + service.WithListRulesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/proxy/update-rule-status.md b/examples/2.0.x/server-go/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..f69e89176 --- /dev/null +++ b/examples/2.0.x/server-go/examples/proxy/update-rule-status.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/proxy" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := proxy.New(client) + + response, err := service.UpdateRuleStatus( + "<RULE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/create-deployment.md b/examples/2.0.x/server-go/examples/sites/create-deployment.md new file mode 100644 index 000000000..99e26f94e --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/create-deployment.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/file" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.CreateDeployment( + "<SITE_ID>", + file.NewInputFile("/path/to/file.png", "file.png"), + service.WithCreateDeploymentInstallCommand("<INSTALL_COMMAND>"), + service.WithCreateDeploymentBuildCommand("<BUILD_COMMAND>"), + service.WithCreateDeploymentOutputDirectory("<OUTPUT_DIRECTORY>"), + service.WithCreateDeploymentActivate(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-go/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..d19f8adab --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.CreateDuplicateDeployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/create-template-deployment.md b/examples/2.0.x/server-go/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..d8a7e2070 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/create-template-deployment.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.CreateTemplateDeployment( + "<SITE_ID>", + "<REPOSITORY>", + "<OWNER>", + "<ROOT_DIRECTORY>", + "branch", + "<REFERENCE>", + service.WithCreateTemplateDeploymentActivate(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/create-variable.md b/examples/2.0.x/server-go/examples/sites/create-variable.md new file mode 100644 index 000000000..ef4f06286 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/create-variable.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.CreateVariable( + "<SITE_ID>", + "<VARIABLE_ID>", + "<KEY>", + "<VALUE>", + service.WithCreateVariableSecret(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-go/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..03a787c3a --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/create-vcs-deployment.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.CreateVcsDeployment( + "<SITE_ID>", + "branch", + "<REFERENCE>", + service.WithCreateVcsDeploymentActivate(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/create.md b/examples/2.0.x/server-go/examples/sites/create.md new file mode 100644 index 000000000..2df016457 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/create.md @@ -0,0 +1,48 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.Create( + "<SITE_ID>", + "<NAME>", + "analog", + "node-14.5", + service.WithCreateEnabled(false), + service.WithCreateLogging(false), + service.WithCreateTimeout(1), + service.WithCreateInstallCommand("<INSTALL_COMMAND>"), + service.WithCreateBuildCommand("<BUILD_COMMAND>"), + service.WithCreateStartCommand("<START_COMMAND>"), + service.WithCreateOutputDirectory("<OUTPUT_DIRECTORY>"), + service.WithCreateAdapter("static"), + service.WithCreateInstallationId("<INSTALLATION_ID>"), + service.WithCreateFallbackFile("<FALLBACK_FILE>"), + service.WithCreateProviderRepositoryId("<PROVIDER_REPOSITORY_ID>"), + service.WithCreateProviderBranch("<PROVIDER_BRANCH>"), + service.WithCreateProviderSilentMode(false), + service.WithCreateProviderRootDirectory("<PROVIDER_ROOT_DIRECTORY>"), + service.WithCreateProviderBranches([]string{"example"}), + service.WithCreateProviderPaths([]string{"example"}), + service.WithCreateBuildSpecification("s-1vcpu-512mb"), + service.WithCreateRuntimeSpecification("s-1vcpu-512mb"), + service.WithCreateDeploymentRetention(0), + service.WithCreateScopes([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/delete-deployment.md b/examples/2.0.x/server-go/examples/sites/delete-deployment.md new file mode 100644 index 000000000..1c78c8549 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/delete-deployment.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.DeleteDeployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/delete-log.md b/examples/2.0.x/server-go/examples/sites/delete-log.md new file mode 100644 index 000000000..01e2f00c8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/delete-log.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.DeleteLog( + "<SITE_ID>", + "<LOG_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/delete-variable.md b/examples/2.0.x/server-go/examples/sites/delete-variable.md new file mode 100644 index 000000000..39933ed5d --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/delete-variable.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.DeleteVariable( + "<SITE_ID>", + "<VARIABLE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/delete.md b/examples/2.0.x/server-go/examples/sites/delete.md new file mode 100644 index 000000000..f9e54662c --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.Delete( + "<SITE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/get-deployment-download.md b/examples/2.0.x/server-go/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..725cb1a5d --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/get-deployment-download.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.GetDeploymentDownload( + "<SITE_ID>", + "<DEPLOYMENT_ID>", + service.WithGetDeploymentDownloadType("source"), + service.WithGetDeploymentDownloadToken("<TOKEN>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/get-deployment.md b/examples/2.0.x/server-go/examples/sites/get-deployment.md new file mode 100644 index 000000000..c2e4f96cc --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/get-deployment.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.GetDeployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/get-log.md b/examples/2.0.x/server-go/examples/sites/get-log.md new file mode 100644 index 000000000..161686790 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/get-log.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.GetLog( + "<SITE_ID>", + "<LOG_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/get-variable.md b/examples/2.0.x/server-go/examples/sites/get-variable.md new file mode 100644 index 000000000..58b3531dc --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/get-variable.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.GetVariable( + "<SITE_ID>", + "<VARIABLE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/get.md b/examples/2.0.x/server-go/examples/sites/get.md new file mode 100644 index 000000000..02533ed67 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.Get( + "<SITE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/list-deployments.md b/examples/2.0.x/server-go/examples/sites/list-deployments.md new file mode 100644 index 000000000..b7ce01b51 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/list-deployments.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.ListDeployments( + "<SITE_ID>", + service.WithListDeploymentsQueries([]string{"example"}), + service.WithListDeploymentsSearch("<SEARCH>"), + service.WithListDeploymentsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/list-frameworks.md b/examples/2.0.x/server-go/examples/sites/list-frameworks.md new file mode 100644 index 000000000..190932ead --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/list-frameworks.md @@ -0,0 +1,23 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.ListFrameworks() + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/list-logs.md b/examples/2.0.x/server-go/examples/sites/list-logs.md new file mode 100644 index 000000000..f79b1cb00 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/list-logs.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.ListLogs( + "<SITE_ID>", + service.WithListLogsQueries([]string{"example"}), + service.WithListLogsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/list-specifications.md b/examples/2.0.x/server-go/examples/sites/list-specifications.md new file mode 100644 index 000000000..1f0878837 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/list-specifications.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.ListSpecifications( + service.WithListSpecificationsType("runtimes"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/list-variables.md b/examples/2.0.x/server-go/examples/sites/list-variables.md new file mode 100644 index 000000000..580cfd01d --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/list-variables.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.ListVariables( + "<SITE_ID>", + service.WithListVariablesQueries([]string{"example"}), + service.WithListVariablesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/list.md b/examples/2.0.x/server-go/examples/sites/list.md new file mode 100644 index 000000000..39ca28de7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListSearch("<SEARCH>"), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/update-deployment-status.md b/examples/2.0.x/server-go/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..da56857a2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/update-deployment-status.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.UpdateDeploymentStatus( + "<SITE_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/update-site-deployment.md b/examples/2.0.x/server-go/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..494f533a2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/update-site-deployment.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.UpdateSiteDeployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/update-variable.md b/examples/2.0.x/server-go/examples/sites/update-variable.md new file mode 100644 index 000000000..b23d74862 --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/update-variable.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.UpdateVariable( + "<SITE_ID>", + "<VARIABLE_ID>", + service.WithUpdateVariableKey("<KEY>"), + service.WithUpdateVariableValue("<VALUE>"), + service.WithUpdateVariableSecret(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/sites/update.md b/examples/2.0.x/server-go/examples/sites/update.md new file mode 100644 index 000000000..5e000858b --- /dev/null +++ b/examples/2.0.x/server-go/examples/sites/update.md @@ -0,0 +1,48 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/sites" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := sites.New(client) + + response, err := service.Update( + "<SITE_ID>", + "<NAME>", + "analog", + service.WithUpdateEnabled(false), + service.WithUpdateLogging(false), + service.WithUpdateTimeout(1), + service.WithUpdateInstallCommand("<INSTALL_COMMAND>"), + service.WithUpdateBuildCommand("<BUILD_COMMAND>"), + service.WithUpdateStartCommand("<START_COMMAND>"), + service.WithUpdateOutputDirectory("<OUTPUT_DIRECTORY>"), + service.WithUpdateBuildRuntime("node-14.5"), + service.WithUpdateAdapter("static"), + service.WithUpdateFallbackFile("<FALLBACK_FILE>"), + service.WithUpdateInstallationId("<INSTALLATION_ID>"), + service.WithUpdateProviderRepositoryId("<PROVIDER_REPOSITORY_ID>"), + service.WithUpdateProviderBranch("<PROVIDER_BRANCH>"), + service.WithUpdateProviderSilentMode(false), + service.WithUpdateProviderRootDirectory("<PROVIDER_ROOT_DIRECTORY>"), + service.WithUpdateProviderBranches([]string{"example"}), + service.WithUpdateProviderPaths([]string{"example"}), + service.WithUpdateBuildSpecification("s-1vcpu-512mb"), + service.WithUpdateRuntimeSpecification("s-1vcpu-512mb"), + service.WithUpdateDeploymentRetention(0), + service.WithUpdateScopes([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/create-bucket.md b/examples/2.0.x/server-go/examples/storage/create-bucket.md new file mode 100644 index 000000000..e2700cb95 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/create-bucket.md @@ -0,0 +1,35 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := storage.New(client) + + response, err := service.CreateBucket( + "<BUCKET_ID>", + "<NAME>", + service.WithCreateBucketPermissions([]string{"read(\"any\")"}), + service.WithCreateBucketFileSecurity(false), + service.WithCreateBucketEnabled(false), + service.WithCreateBucketMaximumFileSize(1), + service.WithCreateBucketAllowedFileExtensions([]string{"example"}), + service.WithCreateBucketCompression("none"), + service.WithCreateBucketEncryption(false), + service.WithCreateBucketAntivirus(false), + service.WithCreateBucketTransformations(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/create-file.md b/examples/2.0.x/server-go/examples/storage/create-file.md new file mode 100644 index 000000000..5edb05a66 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/create-file.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/file" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := storage.New(client) + + response, err := service.CreateFile( + "<BUCKET_ID>", + "<FILE_ID>", + file.NewInputFile("/path/to/file.png", "file.png"), + service.WithCreateFilePermissions([]string{"read(\"any\")"}), + service.WithCreateFileFolder("photos/2026"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/delete-bucket.md b/examples/2.0.x/server-go/examples/storage/delete-bucket.md new file mode 100644 index 000000000..be210d585 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/delete-bucket.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := storage.New(client) + + response, err := service.DeleteBucket( + "<BUCKET_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/delete-file.md b/examples/2.0.x/server-go/examples/storage/delete-file.md new file mode 100644 index 000000000..215d0f956 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/delete-file.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := storage.New(client) + + response, err := service.DeleteFile( + "<BUCKET_ID>", + "<FILE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/get-bucket.md b/examples/2.0.x/server-go/examples/storage/get-bucket.md new file mode 100644 index 000000000..541f89681 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/get-bucket.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := storage.New(client) + + response, err := service.GetBucket( + "<BUCKET_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/get-file-download.md b/examples/2.0.x/server-go/examples/storage/get-file-download.md new file mode 100644 index 000000000..ed4430153 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/get-file-download.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := storage.New(client) + + response, err := service.GetFileDownload( + "<BUCKET_ID>", + "<FILE_ID>", + service.WithGetFileDownloadToken("<TOKEN>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/get-file-preview.md b/examples/2.0.x/server-go/examples/storage/get-file-preview.md new file mode 100644 index 000000000..b6610d882 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/get-file-preview.md @@ -0,0 +1,38 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := storage.New(client) + + response, err := service.GetFilePreview( + "<BUCKET_ID>", + "<FILE_ID>", + service.WithGetFilePreviewWidth(0), + service.WithGetFilePreviewHeight(0), + service.WithGetFilePreviewGravity("center"), + service.WithGetFilePreviewQuality(-1), + service.WithGetFilePreviewBorderWidth(0), + service.WithGetFilePreviewBorderColor("FFFFFF"), + service.WithGetFilePreviewBorderRadius(0), + service.WithGetFilePreviewOpacity(0), + service.WithGetFilePreviewRotation(-360), + service.WithGetFilePreviewBackground("FFFFFF"), + service.WithGetFilePreviewOutput("jpg"), + service.WithGetFilePreviewToken("<TOKEN>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/get-file-view.md b/examples/2.0.x/server-go/examples/storage/get-file-view.md new file mode 100644 index 000000000..0b8cf7b30 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/get-file-view.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := storage.New(client) + + response, err := service.GetFileView( + "<BUCKET_ID>", + "<FILE_ID>", + service.WithGetFileViewToken("<TOKEN>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/get-file.md b/examples/2.0.x/server-go/examples/storage/get-file.md new file mode 100644 index 000000000..bbd3c05ad --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/get-file.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := storage.New(client) + + response, err := service.GetFile( + "<BUCKET_ID>", + "<FILE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/list-buckets.md b/examples/2.0.x/server-go/examples/storage/list-buckets.md new file mode 100644 index 000000000..d54e083c9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/list-buckets.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := storage.New(client) + + response, err := service.ListBuckets( + service.WithListBucketsQueries([]string{"example"}), + service.WithListBucketsSearch("<SEARCH>"), + service.WithListBucketsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/list-files.md b/examples/2.0.x/server-go/examples/storage/list-files.md new file mode 100644 index 000000000..1b2d5e8e1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/list-files.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := storage.New(client) + + response, err := service.ListFiles( + "<BUCKET_ID>", + service.WithListFilesQueries([]string{"example"}), + service.WithListFilesSearch("<SEARCH>"), + service.WithListFilesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/update-bucket.md b/examples/2.0.x/server-go/examples/storage/update-bucket.md new file mode 100644 index 000000000..1aa2725a6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/update-bucket.md @@ -0,0 +1,35 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := storage.New(client) + + response, err := service.UpdateBucket( + "<BUCKET_ID>", + "<NAME>", + service.WithUpdateBucketPermissions([]string{"read(\"any\")"}), + service.WithUpdateBucketFileSecurity(false), + service.WithUpdateBucketEnabled(false), + service.WithUpdateBucketMaximumFileSize(1), + service.WithUpdateBucketAllowedFileExtensions([]string{"example"}), + service.WithUpdateBucketCompression("none"), + service.WithUpdateBucketEncryption(false), + service.WithUpdateBucketAntivirus(false), + service.WithUpdateBucketTransformations(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/storage/update-file.md b/examples/2.0.x/server-go/examples/storage/update-file.md new file mode 100644 index 000000000..4c382f199 --- /dev/null +++ b/examples/2.0.x/server-go/examples/storage/update-file.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/storage" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := storage.New(client) + + response, err := service.UpdateFile( + "<BUCKET_ID>", + "<FILE_ID>", + service.WithUpdateFileName("<NAME>"), + service.WithUpdateFilePermissions([]string{"read(\"any\")"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..089bcc1f3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateBigIntColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateBigIntColumnMin(0), + service.WithCreateBigIntColumnMax(1000000), + service.WithCreateBigIntColumnDefault(0), + service.WithCreateBigIntColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..fa24f3502 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateBooleanColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateBooleanColumnDefault(false), + service.WithCreateBooleanColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..c2c9b9098 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateDatetimeColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateDatetimeColumnDefault("2020-10-15T06:38:00.000+00:00"), + service.WithCreateDatetimeColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..0ddecf214 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-email-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateEmailColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateEmailColumnDefault("email@example.com"), + service.WithCreateEmailColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..a9636e221 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-enum-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateEnumColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + []string{"active", "inactive"}, + false, + service.WithCreateEnumColumnDefault("active"), + service.WithCreateEnumColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..a8b9e13a0 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-float-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateFloatColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateFloatColumnMin(0), + service.WithCreateFloatColumnMax(100), + service.WithCreateFloatColumnDefault(10.5), + service.WithCreateFloatColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-index.md b/examples/2.0.x/server-go/examples/tablesdb/create-index.md new file mode 100644 index 000000000..18cc2e365 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-index.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateIndex( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + "key", + []string{"example"}, + service.WithCreateIndexOrders([]string{"example"}), + service.WithCreateIndexLengths([]int{0}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..66fa02b19 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-integer-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateIntegerColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateIntegerColumnMin(0), + service.WithCreateIntegerColumnMax(100), + service.WithCreateIntegerColumnDefault(10), + service.WithCreateIntegerColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..b3384a41c --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-ip-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateIpColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateIpColumnDefault("192.0.2.0"), + service.WithCreateIpColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..5d4b008cf --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-line-column.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateLineColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateLineColumnDefault([][]interface{}{[]interface{}{1, 2}, []interface{}{3, 4}, []interface{}{5, 6}}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..42dd75b63 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateLongtextColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateLongtextColumnDefault("Hello World"), + service.WithCreateLongtextColumnArray(false), + service.WithCreateLongtextColumnEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..c00d30dbe --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateMediumtextColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateMediumtextColumnDefault("Hello World"), + service.WithCreateMediumtextColumnArray(false), + service.WithCreateMediumtextColumnEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-operations.md b/examples/2.0.x/server-go/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..ed12e3c1f --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-operations.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateOperations( + "<TRANSACTION_ID>", + service.WithCreateOperationsOperations([]interface{}{map[string]interface{}{"action": "create", "databaseId": "<DATABASE_ID>", "tableId": "<TABLE_ID>", "rowId": "<ROW_ID>", "data": map[string]interface{}{"name": "Walter O'Brien"}}}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..e88c474eb --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-point-column.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreatePointColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreatePointColumnDefault([]float64{1, 2}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..5b2333645 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreatePolygonColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreatePolygonColumnDefault([][]interface{}{[]interface{}{[]interface{}{1, 2}, []interface{}{3, 4}, []interface{}{5, 6}, []interface{}{1, 2}}}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..9ba4ef95d --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateRelationshipColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<RELATED_TABLE_ID>", + "oneToOne", + service.WithCreateRelationshipColumnTwoWay(false), + service.WithCreateRelationshipColumnKey("<KEY>"), + service.WithCreateRelationshipColumnTwoWayKey("<TWO_WAY_KEY>"), + service.WithCreateRelationshipColumnOnDelete("cascade"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-row.md b/examples/2.0.x/server-go/examples/tablesdb/create-row.md new file mode 100644 index 000000000..30292877a --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-row.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := tablesdb.New(client) + + response, err := service.CreateRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 30, "isAdmin": false}, + service.WithCreateRowPermissions([]string{"read(\"any\")"}), + service.WithCreateRowTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-rows.md b/examples/2.0.x/server-go/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..1bcb6f2ba --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-rows.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateRows( + "<DATABASE_ID>", + "<TABLE_ID>", + []interface{}{}, + service.WithCreateRowsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..09651db23 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-string-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateStringColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + 1, + false, + service.WithCreateStringColumnDefault("Hello World"), + service.WithCreateStringColumnArray(false), + service.WithCreateStringColumnEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-table.md b/examples/2.0.x/server-go/examples/tablesdb/create-table.md new file mode 100644 index 000000000..506252359 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-table.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateTable( + "<DATABASE_ID>", + "<TABLE_ID>", + "<NAME>", + service.WithCreateTablePermissions([]string{"read(\"any\")"}), + service.WithCreateTableRowSecurity(false), + service.WithCreateTableEnabled(false), + service.WithCreateTableColumns([]interface{}{}), + service.WithCreateTableIndexes([]interface{}{}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..27b94a490 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-text-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateTextColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateTextColumnDefault("Hello World"), + service.WithCreateTextColumnArray(false), + service.WithCreateTextColumnEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-go/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..61bb3c1fc --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateTransaction( + service.WithCreateTransactionTtl(60), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..dbd437ae4 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-url-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateUrlColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithCreateUrlColumnDefault("https://example.com"), + service.WithCreateUrlColumnArray(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-go/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..c76020b04 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.CreateVarcharColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + 1, + false, + service.WithCreateVarcharColumnDefault("Hello World"), + service.WithCreateVarcharColumnArray(false), + service.WithCreateVarcharColumnEncrypt(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/create.md b/examples/2.0.x/server-go/examples/tablesdb/create.md new file mode 100644 index 000000000..c39ffc924 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/create.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.Create( + "<DATABASE_ID>", + "<NAME>", + service.WithCreateEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-go/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..af6201add --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := tablesdb.New(client) + + response, err := service.DecrementRowColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + "<COLUMN>", + service.WithDecrementRowColumnValue(1), + service.WithDecrementRowColumnMin(0), + service.WithDecrementRowColumnTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/delete-column.md b/examples/2.0.x/server-go/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..479a190db --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/delete-column.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.DeleteColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/delete-index.md b/examples/2.0.x/server-go/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..e183b331f --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/delete-index.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.DeleteIndex( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/delete-row.md b/examples/2.0.x/server-go/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..8c9ec59cc --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/delete-row.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := tablesdb.New(client) + + response, err := service.DeleteRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + service.WithDeleteRowTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-go/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..08f8307c5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/delete-rows.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.DeleteRows( + "<DATABASE_ID>", + "<TABLE_ID>", + service.WithDeleteRowsQueries([]string{"example"}), + service.WithDeleteRowsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/delete-table.md b/examples/2.0.x/server-go/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..1116093a5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/delete-table.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.DeleteTable( + "<DATABASE_ID>", + "<TABLE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-go/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..89c54e19d --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/delete-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.DeleteTransaction( + "<TRANSACTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/delete.md b/examples/2.0.x/server-go/examples/tablesdb/delete.md new file mode 100644 index 000000000..431e55430 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.Delete( + "<DATABASE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/get-column.md b/examples/2.0.x/server-go/examples/tablesdb/get-column.md new file mode 100644 index 000000000..bf48d8f65 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/get-column.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.GetColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/get-index.md b/examples/2.0.x/server-go/examples/tablesdb/get-index.md new file mode 100644 index 000000000..d62cc93a0 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/get-index.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.GetIndex( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/get-row.md b/examples/2.0.x/server-go/examples/tablesdb/get-row.md new file mode 100644 index 000000000..208a39ceb --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/get-row.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := tablesdb.New(client) + + response, err := service.GetRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + service.WithGetRowQueries([]string{"example"}), + service.WithGetRowTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/get-table.md b/examples/2.0.x/server-go/examples/tablesdb/get-table.md new file mode 100644 index 000000000..d1356a7db --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/get-table.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.GetTable( + "<DATABASE_ID>", + "<TABLE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-go/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..cd0f35516 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/get-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.GetTransaction( + "<TRANSACTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/get.md b/examples/2.0.x/server-go/examples/tablesdb/get.md new file mode 100644 index 000000000..0674506d4 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.Get( + "<DATABASE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-go/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..a1ce5b572 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/increment-row-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := tablesdb.New(client) + + response, err := service.IncrementRowColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + "<COLUMN>", + service.WithIncrementRowColumnValue(1), + service.WithIncrementRowColumnMax(100), + service.WithIncrementRowColumnTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/list-columns.md b/examples/2.0.x/server-go/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..1e0bab3b3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/list-columns.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.ListColumns( + "<DATABASE_ID>", + "<TABLE_ID>", + service.WithListColumnsQueries([]string{"example"}), + service.WithListColumnsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-go/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..47ade0e2d --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/list-indexes.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.ListIndexes( + "<DATABASE_ID>", + "<TABLE_ID>", + service.WithListIndexesQueries([]string{"example"}), + service.WithListIndexesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/list-rows.md b/examples/2.0.x/server-go/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..008755d00 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/list-rows.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := tablesdb.New(client) + + response, err := service.ListRows( + "<DATABASE_ID>", + "<TABLE_ID>", + service.WithListRowsQueries([]string{"example"}), + service.WithListRowsTransactionId("<TRANSACTION_ID>"), + service.WithListRowsTotal(false), + service.WithListRowsTtl(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/list-tables.md b/examples/2.0.x/server-go/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..2814d674e --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/list-tables.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.ListTables( + "<DATABASE_ID>", + service.WithListTablesQueries([]string{"example"}), + service.WithListTablesSearch("<SEARCH>"), + service.WithListTablesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-go/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..11793483b --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/list-transactions.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.ListTransactions( + service.WithListTransactionsQueries([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/list.md b/examples/2.0.x/server-go/examples/tablesdb/list.md new file mode 100644 index 000000000..13ef179eb --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListSearch("<SEARCH>"), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..c8a2e646a --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateBigIntColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + 0, + service.WithUpdateBigIntColumnMin(0), + service.WithUpdateBigIntColumnMax(1000000), + service.WithUpdateBigIntColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..61f863e15 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateBooleanColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + false, + service.WithUpdateBooleanColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..8515e3fe9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateDatetimeColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "2020-10-15T06:38:00.000+00:00", + service.WithUpdateDatetimeColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..b33ff1eac --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-email-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateEmailColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "email@example.com", + service.WithUpdateEmailColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..3ddaff10a --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-enum-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateEnumColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + []string{"active", "inactive"}, + false, + "active", + service.WithUpdateEnumColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..659fad37d --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-float-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateFloatColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + 10.5, + service.WithUpdateFloatColumnMin(0), + service.WithUpdateFloatColumnMax(100), + service.WithUpdateFloatColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..e43b801dc --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-integer-column.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateIntegerColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + 10, + service.WithUpdateIntegerColumnMin(0), + service.WithUpdateIntegerColumnMax(100), + service.WithUpdateIntegerColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..e539dcb92 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-ip-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateIpColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "192.0.2.0", + service.WithUpdateIpColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..0d41b2b05 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-line-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateLineColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithUpdateLineColumnDefault([][]interface{}{[]interface{}{1, 2}, []interface{}{3, 4}, []interface{}{5, 6}}), + service.WithUpdateLineColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..3b5fbe66b --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateLongtextColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateLongtextColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..acb970e04 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateMediumtextColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateMediumtextColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..27c6f62c9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-point-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdatePointColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithUpdatePointColumnDefault([]float64{1, 2}), + service.WithUpdatePointColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..28d434278 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdatePolygonColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + service.WithUpdatePolygonColumnDefault([][]interface{}{[]interface{}{[]interface{}{1, 2}, []interface{}{3, 4}, []interface{}{5, 6}, []interface{}{1, 2}}}), + service.WithUpdatePolygonColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..86058f78e --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateRelationshipColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + service.WithUpdateRelationshipColumnOnDelete("cascade"), + service.WithUpdateRelationshipColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-row.md b/examples/2.0.x/server-go/examples/tablesdb/update-row.md new file mode 100644 index 000000000..4e70267f3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-row.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + service.WithUpdateRowData(map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 33, "isAdmin": false}), + service.WithUpdateRowPermissions([]string{"read(\"any\")"}), + service.WithUpdateRowTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-rows.md b/examples/2.0.x/server-go/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..cd27907a2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-rows.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateRows( + "<DATABASE_ID>", + "<TABLE_ID>", + service.WithUpdateRowsData(map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 33, "isAdmin": false}), + service.WithUpdateRowsQueries([]string{"example"}), + service.WithUpdateRowsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..6f9cac476 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-string-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateStringColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateStringColumnSize(1), + service.WithUpdateStringColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-table.md b/examples/2.0.x/server-go/examples/tablesdb/update-table.md new file mode 100644 index 000000000..cf4e70b0e --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-table.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateTable( + "<DATABASE_ID>", + "<TABLE_ID>", + service.WithUpdateTableName("<NAME>"), + service.WithUpdateTablePermissions([]string{"read(\"any\")"}), + service.WithUpdateTableRowSecurity(false), + service.WithUpdateTableEnabled(false), + service.WithUpdateTablePurge(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..b6cdda246 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-text-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateTextColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateTextColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-go/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..8e18a17a1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-transaction.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateTransaction( + "<TRANSACTION_ID>", + service.WithUpdateTransactionCommit(false), + service.WithUpdateTransactionRollback(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..58a4adf15 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-url-column.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateUrlColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "https://example.com", + service.WithUpdateUrlColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-go/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..e3e1474b6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpdateVarcharColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + "Hello World", + service.WithUpdateVarcharColumnSize(1), + service.WithUpdateVarcharColumnNewKey("<NEW_KEY>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/update.md b/examples/2.0.x/server-go/examples/tablesdb/update.md new file mode 100644 index 000000000..f15e31130 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/update.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.Update( + "<DATABASE_ID>", + service.WithUpdateName("<NAME>"), + service.WithUpdateEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-go/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..b8e9f29a5 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/upsert-row.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := tablesdb.New(client) + + response, err := service.UpsertRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + service.WithUpsertRowData(map[string]interface{}{"username": "walter.obrien", "email": "walter.obrien@example.com", "fullName": "Walter O'Brien", "age": 33, "isAdmin": false}), + service.WithUpsertRowPermissions([]string{"read(\"any\")"}), + service.WithUpsertRowTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-go/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..72cd4b125 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tablesdb/upsert-rows.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tablesdb.New(client) + + response, err := service.UpsertRows( + "<DATABASE_ID>", + "<TABLE_ID>", + []interface{}{}, + service.WithUpsertRowsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/create-membership.md b/examples/2.0.x/server-go/examples/teams/create-membership.md new file mode 100644 index 000000000..4af6eba21 --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/create-membership.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.CreateMembership( + "<TEAM_ID>", + []string{"example"}, + service.WithCreateMembershipEmail("email@example.com"), + service.WithCreateMembershipUserId("<USER_ID>"), + service.WithCreateMembershipPhone("+12065550100"), + service.WithCreateMembershipUrl("https://example.com"), + service.WithCreateMembershipName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/create.md b/examples/2.0.x/server-go/examples/teams/create.md new file mode 100644 index 000000000..c8ea8b7ab --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/create.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.Create( + "<TEAM_ID>", + "<NAME>", + service.WithCreateRoles([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/delete-membership.md b/examples/2.0.x/server-go/examples/teams/delete-membership.md new file mode 100644 index 000000000..80699cddf --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/delete-membership.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.DeleteMembership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/delete.md b/examples/2.0.x/server-go/examples/teams/delete.md new file mode 100644 index 000000000..e72d295b3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.Delete( + "<TEAM_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/get-membership.md b/examples/2.0.x/server-go/examples/teams/get-membership.md new file mode 100644 index 000000000..f700b8b95 --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/get-membership.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.GetMembership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/get-prefs.md b/examples/2.0.x/server-go/examples/teams/get-prefs.md new file mode 100644 index 000000000..23b7bfffd --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/get-prefs.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.GetPrefs( + "<TEAM_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/get.md b/examples/2.0.x/server-go/examples/teams/get.md new file mode 100644 index 000000000..e54a38b31 --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.Get( + "<TEAM_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/list-memberships.md b/examples/2.0.x/server-go/examples/teams/list-memberships.md new file mode 100644 index 000000000..a1fad2302 --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/list-memberships.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.ListMemberships( + "<TEAM_ID>", + service.WithListMembershipsQueries([]string{"example"}), + service.WithListMembershipsSearch("<SEARCH>"), + service.WithListMembershipsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/list.md b/examples/2.0.x/server-go/examples/teams/list.md new file mode 100644 index 000000000..d529920c7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListSearch("<SEARCH>"), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/update-membership-status.md b/examples/2.0.x/server-go/examples/teams/update-membership-status.md new file mode 100644 index 000000000..c252fc1f1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/update-membership-status.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.UpdateMembershipStatus( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", + "<USER_ID>", + "<SECRET>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/update-membership.md b/examples/2.0.x/server-go/examples/teams/update-membership.md new file mode 100644 index 000000000..04b0f06aa --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/update-membership.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.UpdateMembership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", + []string{"example"}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/update-name.md b/examples/2.0.x/server-go/examples/teams/update-name.md new file mode 100644 index 000000000..f99f26e4a --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/update-name.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.UpdateName( + "<TEAM_ID>", + "<NAME>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/teams/update-prefs.md b/examples/2.0.x/server-go/examples/teams/update-prefs.md new file mode 100644 index 000000000..161e864be --- /dev/null +++ b/examples/2.0.x/server-go/examples/teams/update-prefs.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/teams" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := teams.New(client) + + response, err := service.UpdatePrefs( + "<TEAM_ID>", + []interface{}{}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tokens/create-file-token.md b/examples/2.0.x/server-go/examples/tokens/create-file-token.md new file mode 100644 index 000000000..38bc9f72c --- /dev/null +++ b/examples/2.0.x/server-go/examples/tokens/create-file-token.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tokens" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tokens.New(client) + + response, err := service.CreateFileToken( + "<BUCKET_ID>", + "<FILE_ID>", + service.WithCreateFileTokenExpire("2020-10-15T06:38:00.000+00:00"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tokens/delete.md b/examples/2.0.x/server-go/examples/tokens/delete.md new file mode 100644 index 000000000..8c84a9584 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tokens/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tokens" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tokens.New(client) + + response, err := service.Delete( + "<TOKEN_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tokens/get.md b/examples/2.0.x/server-go/examples/tokens/get.md new file mode 100644 index 000000000..486c2bf85 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tokens/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tokens" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tokens.New(client) + + response, err := service.Get( + "<TOKEN_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tokens/list.md b/examples/2.0.x/server-go/examples/tokens/list.md new file mode 100644 index 000000000..0651bf813 --- /dev/null +++ b/examples/2.0.x/server-go/examples/tokens/list.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tokens" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tokens.New(client) + + response, err := service.List( + "<BUCKET_ID>", + "<FILE_ID>", + service.WithListQueries([]string{"example"}), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/tokens/update.md b/examples/2.0.x/server-go/examples/tokens/update.md new file mode 100644 index 000000000..f124c55af --- /dev/null +++ b/examples/2.0.x/server-go/examples/tokens/update.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/tokens" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := tokens.New(client) + + response, err := service.Update( + "<TOKEN_ID>", + service.WithUpdateExpire("2020-10-15T06:38:00.000+00:00"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-argon-2-user.md b/examples/2.0.x/server-go/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..823d7f483 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-argon-2-user.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateArgon2User( + "<USER_ID>", + "email@example.com", + "password", + service.WithCreateArgon2UserName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-go/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..5180d9a94 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-bcrypt-user.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateBcryptUser( + "<USER_ID>", + "email@example.com", + "password", + service.WithCreateBcryptUserName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-jwt.md b/examples/2.0.x/server-go/examples/users/create-jwt.md new file mode 100644 index 000000000..f2eb9f623 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-jwt.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateJWT( + "<USER_ID>", + service.WithCreateJWTSessionId("recent()"), + service.WithCreateJWTDuration(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-md-5-user.md b/examples/2.0.x/server-go/examples/users/create-md-5-user.md new file mode 100644 index 000000000..8754db59e --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-md-5-user.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateMD5User( + "<USER_ID>", + "email@example.com", + "password", + service.WithCreateMD5UserName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-go/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..5eaa210cc --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateMFARecoveryCodes( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-go/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..586293ca2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-ph-pass-user.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreatePHPassUser( + "<USER_ID>", + "email@example.com", + "password", + service.WithCreatePHPassUserName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-go/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..d9b1d6b34 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateScryptModifiedUser( + "<USER_ID>", + "email@example.com", + "password", + "<PASSWORD_SALT>", + "<PASSWORD_SALT_SEPARATOR>", + "<PASSWORD_SIGNER_KEY>", + service.WithCreateScryptModifiedUserName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-scrypt-user.md b/examples/2.0.x/server-go/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..a07c2712f --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-scrypt-user.md @@ -0,0 +1,33 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateScryptUser( + "<USER_ID>", + "email@example.com", + "password", + "<PASSWORD_SALT>", + 8, + 65536, + 1, + 64, + service.WithCreateScryptUserName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-session.md b/examples/2.0.x/server-go/examples/users/create-session.md new file mode 100644 index 000000000..869a88886 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-session.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateSession( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-sha-user.md b/examples/2.0.x/server-go/examples/users/create-sha-user.md new file mode 100644 index 000000000..11a81e8f1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-sha-user.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateSHAUser( + "<USER_ID>", + "email@example.com", + "password", + service.WithCreateSHAUserPasswordVersion("sha1"), + service.WithCreateSHAUserName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-target.md b/examples/2.0.x/server-go/examples/users/create-target.md new file mode 100644 index 000000000..9aadfa981 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-target.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateTarget( + "<USER_ID>", + "<TARGET_ID>", + "email", + "<IDENTIFIER>", + service.WithCreateTargetProviderId("<PROVIDER_ID>"), + service.WithCreateTargetName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create-token.md b/examples/2.0.x/server-go/examples/users/create-token.md new file mode 100644 index 000000000..8aef465f0 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create-token.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.CreateToken( + "<USER_ID>", + service.WithCreateTokenLength(4), + service.WithCreateTokenExpire(60), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/create.md b/examples/2.0.x/server-go/examples/users/create.md new file mode 100644 index 000000000..6f0ef1373 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/create.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.Create( + "<USER_ID>", + service.WithCreateEmail("email@example.com"), + service.WithCreatePhone("+12065550100"), + service.WithCreatePassword("password"), + service.WithCreateName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/delete-identity.md b/examples/2.0.x/server-go/examples/users/delete-identity.md new file mode 100644 index 000000000..3752b4d5b --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/delete-identity.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.DeleteIdentity( + "<IDENTITY_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-go/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..cd071620e --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.DeleteMFAAuthenticator( + "<USER_ID>", + "totp", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/delete-session.md b/examples/2.0.x/server-go/examples/users/delete-session.md new file mode 100644 index 000000000..a7e8465a8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/delete-session.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.DeleteSession( + "<USER_ID>", + "<SESSION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/delete-sessions.md b/examples/2.0.x/server-go/examples/users/delete-sessions.md new file mode 100644 index 000000000..8a5cefe40 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/delete-sessions.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.DeleteSessions( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/delete-target.md b/examples/2.0.x/server-go/examples/users/delete-target.md new file mode 100644 index 000000000..5e1877e6e --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/delete-target.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.DeleteTarget( + "<USER_ID>", + "<TARGET_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/delete.md b/examples/2.0.x/server-go/examples/users/delete.md new file mode 100644 index 000000000..677fa37d6 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.Delete( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-go/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..d24443145 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/get-mfa-challenge.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.GetMFAChallenge( + "<USER_ID>", + "<CHALLENGE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-go/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..9b8c218a3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.GetMFARecoveryCodes( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/get-prefs.md b/examples/2.0.x/server-go/examples/users/get-prefs.md new file mode 100644 index 000000000..dd5314cbb --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/get-prefs.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.GetPrefs( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/get-target.md b/examples/2.0.x/server-go/examples/users/get-target.md new file mode 100644 index 000000000..226f8c08a --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/get-target.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.GetTarget( + "<USER_ID>", + "<TARGET_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/get.md b/examples/2.0.x/server-go/examples/users/get.md new file mode 100644 index 000000000..183c2342c --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.Get( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/list-identities.md b/examples/2.0.x/server-go/examples/users/list-identities.md new file mode 100644 index 000000000..cd953f3dd --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/list-identities.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.ListIdentities( + service.WithListIdentitiesQueries([]string{"example"}), + service.WithListIdentitiesSearch("<SEARCH>"), + service.WithListIdentitiesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/list-memberships.md b/examples/2.0.x/server-go/examples/users/list-memberships.md new file mode 100644 index 000000000..3680f1ccf --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/list-memberships.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.ListMemberships( + "<USER_ID>", + service.WithListMembershipsQueries([]string{"example"}), + service.WithListMembershipsSearch("<SEARCH>"), + service.WithListMembershipsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/list-mfa-factors.md b/examples/2.0.x/server-go/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..2bc56d475 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/list-mfa-factors.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.ListMFAFactors( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/list-sessions.md b/examples/2.0.x/server-go/examples/users/list-sessions.md new file mode 100644 index 000000000..95fb50f37 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/list-sessions.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.ListSessions( + "<USER_ID>", + service.WithListSessionsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/list-targets.md b/examples/2.0.x/server-go/examples/users/list-targets.md new file mode 100644 index 000000000..a149d3af3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/list-targets.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.ListTargets( + "<USER_ID>", + service.WithListTargetsQueries([]string{"example"}), + service.WithListTargetsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/list.md b/examples/2.0.x/server-go/examples/users/list.md new file mode 100644 index 000000000..c81377a6f --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListSearch("<SEARCH>"), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-email-verification.md b/examples/2.0.x/server-go/examples/users/update-email-verification.md new file mode 100644 index 000000000..5052d5ccf --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-email-verification.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateEmailVerification( + "<USER_ID>", + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-email.md b/examples/2.0.x/server-go/examples/users/update-email.md new file mode 100644 index 000000000..295859651 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-email.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateEmail( + "<USER_ID>", + "email@example.com", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-impersonator.md b/examples/2.0.x/server-go/examples/users/update-impersonator.md new file mode 100644 index 000000000..2ed2595ce --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-impersonator.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateImpersonator( + "<USER_ID>", + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-labels.md b/examples/2.0.x/server-go/examples/users/update-labels.md new file mode 100644 index 000000000..8837b0c9c --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-labels.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateLabels( + "<USER_ID>", + []string{"example"}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-go/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..8cf8d25d3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateMFARecoveryCodes( + "<USER_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-mfa.md b/examples/2.0.x/server-go/examples/users/update-mfa.md new file mode 100644 index 000000000..ef550e40a --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-mfa.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateMFA( + "<USER_ID>", + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-name.md b/examples/2.0.x/server-go/examples/users/update-name.md new file mode 100644 index 000000000..cedee1025 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-name.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateName( + "<USER_ID>", + "<NAME>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-password.md b/examples/2.0.x/server-go/examples/users/update-password.md new file mode 100644 index 000000000..c97480bb3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-password.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdatePassword( + "<USER_ID>", + "password", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-phone-verification.md b/examples/2.0.x/server-go/examples/users/update-phone-verification.md new file mode 100644 index 000000000..d1e7ba050 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-phone-verification.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdatePhoneVerification( + "<USER_ID>", + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-phone.md b/examples/2.0.x/server-go/examples/users/update-phone.md new file mode 100644 index 000000000..4d60db8af --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-phone.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdatePhone( + "<USER_ID>", + "+12065550100", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-prefs.md b/examples/2.0.x/server-go/examples/users/update-prefs.md new file mode 100644 index 000000000..c391e4041 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-prefs.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdatePrefs( + "<USER_ID>", + []interface{}{}, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-status.md b/examples/2.0.x/server-go/examples/users/update-status.md new file mode 100644 index 000000000..f14ba1823 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-status.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateStatus( + "<USER_ID>", + false, + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/users/update-target.md b/examples/2.0.x/server-go/examples/users/update-target.md new file mode 100644 index 000000000..7d4fa8ae0 --- /dev/null +++ b/examples/2.0.x/server-go/examples/users/update-target.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/users" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := users.New(client) + + response, err := service.UpdateTarget( + "<USER_ID>", + "<TARGET_ID>", + service.WithUpdateTargetIdentifier("<IDENTIFIER>"), + service.WithUpdateTargetProviderId("<PROVIDER_ID>"), + service.WithUpdateTargetName("<NAME>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-go/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..6b605cba1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/create-collection.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.CreateCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + 1, + service.WithCreateCollectionPermissions([]string{"read(\"any\")"}), + service.WithCreateCollectionDocumentSecurity(false), + service.WithCreateCollectionEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/create-document.md b/examples/2.0.x/server-go/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..79ece5b79 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/create-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := vectorsdb.New(client) + + response, err := service.CreateDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + map[string]interface{}{"embeddings": []interface{}{0.12, -0.55, 0.88, 1.02}, "metadata": map[string]interface{}{"key": "value"}}, + service.WithCreateDocumentPermissions([]string{"read(\"any\")"}), + service.WithCreateDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-go/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..272e5fd09 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/create-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.CreateDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + []interface{}{}, + service.WithCreateDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/create-index.md b/examples/2.0.x/server-go/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..9a6b7111d --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/create-index.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.CreateIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + "hnsw_euclidean", + []string{"example"}, + service.WithCreateIndexOrders([]string{"example"}), + service.WithCreateIndexLengths([]int{0}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-go/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..42eeb98c3 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.CreateOperations( + "<TRANSACTION_ID>", + service.WithCreateOperationsOperations([]interface{}{map[string]interface{}{"action": "create", "databaseId": "<DATABASE_ID>", "collectionId": "<COLLECTION_ID>", "documentId": "<DOCUMENT_ID>", "data": map[string]interface{}{"name": "Walter O'Brien"}}}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/create-query.md b/examples/2.0.x/server-go/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..0632ad7e9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/create-query.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := vectorsdb.New(client) + + response, err := service.CreateQuery( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithCreateQueryQueries([]string{"example"}), + service.WithCreateQueryTransactionId("<TRANSACTION_ID>"), + service.WithCreateQueryTotal(false), + service.WithCreateQueryTtl(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-go/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..79bc1f778 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/create-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.CreateTransaction( + service.WithCreateTransactionTtl(60), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/create.md b/examples/2.0.x/server-go/examples/vectorsdb/create.md new file mode 100644 index 000000000..dd3d7a3f1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/create.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.Create( + "<DATABASE_ID>", + "<NAME>", + service.WithCreateEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-go/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..19d0b53c2 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/delete-collection.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.DeleteCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-go/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..00ca46daa --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/delete-document.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := vectorsdb.New(client) + + response, err := service.DeleteDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithDeleteDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-go/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..579ce0e2d --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/delete-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.DeleteDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithDeleteDocumentsQueries([]string{"example"}), + service.WithDeleteDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-go/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..a85ee2f79 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/delete-index.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.DeleteIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-go/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..148457dc1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.DeleteTransaction( + "<TRANSACTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/delete.md b/examples/2.0.x/server-go/examples/vectorsdb/delete.md new file mode 100644 index 000000000..8cb6a1d3c --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.Delete( + "<DATABASE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-go/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..cc1fd13ee --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/get-collection.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.GetCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/get-document.md b/examples/2.0.x/server-go/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..e13c5bc55 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/get-document.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := vectorsdb.New(client) + + response, err := service.GetDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithGetDocumentQueries([]string{"example"}), + service.WithGetDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/get-index.md b/examples/2.0.x/server-go/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..984404ea1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/get-index.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.GetIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-go/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..014deabfe --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/get-transaction.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.GetTransaction( + "<TRANSACTION_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/get.md b/examples/2.0.x/server-go/examples/vectorsdb/get.md new file mode 100644 index 000000000..d123982dc --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.Get( + "<DATABASE_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-go/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..d59730c19 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/list-collections.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.ListCollections( + "<DATABASE_ID>", + service.WithListCollectionsQueries([]string{"example"}), + service.WithListCollectionsSearch("<SEARCH>"), + service.WithListCollectionsTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-go/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..4398515c7 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/list-documents.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := vectorsdb.New(client) + + response, err := service.ListDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithListDocumentsQueries([]string{"example"}), + service.WithListDocumentsTransactionId("<TRANSACTION_ID>"), + service.WithListDocumentsTotal(false), + service.WithListDocumentsTtl(0), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-go/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..c7868be0d --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/list-indexes.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.ListIndexes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithListIndexesQueries([]string{"example"}), + service.WithListIndexesTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-go/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..669d8982d --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/list-transactions.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.ListTransactions( + service.WithListTransactionsQueries([]string{"example"}), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/list.md b/examples/2.0.x/server-go/examples/vectorsdb/list.md new file mode 100644 index 000000000..a5b4612d1 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/list.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListSearch("<SEARCH>"), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-go/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..c865f0711 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/update-collection.md @@ -0,0 +1,31 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.UpdateCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + service.WithUpdateCollectionDimension(1), + service.WithUpdateCollectionPermissions([]string{"read(\"any\")"}), + service.WithUpdateCollectionDocumentSecurity(false), + service.WithUpdateCollectionEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/update-document.md b/examples/2.0.x/server-go/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..42e5e4f51 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/update-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := vectorsdb.New(client) + + response, err := service.UpdateDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithUpdateDocumentData([]interface{}{}), + service.WithUpdateDocumentPermissions([]string{"read(\"any\")"}), + service.WithUpdateDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-go/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..73c0fdfc9 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/update-documents.md @@ -0,0 +1,29 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.UpdateDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + service.WithUpdateDocumentsData([]interface{}{}), + service.WithUpdateDocumentsQueries([]string{"example"}), + service.WithUpdateDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-go/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..913a25d1e --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/update-transaction.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.UpdateTransaction( + "<TRANSACTION_ID>", + service.WithUpdateTransactionCommit(false), + service.WithUpdateTransactionRollback(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/update.md b/examples/2.0.x/server-go/examples/vectorsdb/update.md new file mode 100644 index 000000000..2762e01c8 --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/update.md @@ -0,0 +1,27 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.Update( + "<DATABASE_ID>", + "<NAME>", + service.WithUpdateEnabled(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-go/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..11cb23c2b --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/upsert-document.md @@ -0,0 +1,30 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithSession(""), + ) + + service := vectorsdb.New(client) + + response, err := service.UpsertDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + service.WithUpsertDocumentData([]interface{}{}), + service.WithUpsertDocumentPermissions([]string{"read(\"any\")"}), + service.WithUpsertDocumentTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-go/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..ba6777a0a --- /dev/null +++ b/examples/2.0.x/server-go/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,28 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/vectorsdb" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := vectorsdb.New(client) + + response, err := service.UpsertDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + []interface{}{}, + service.WithUpsertDocumentsTransactionId("<TRANSACTION_ID>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/webhooks/create.md b/examples/2.0.x/server-go/examples/webhooks/create.md new file mode 100644 index 000000000..ec9ada3b0 --- /dev/null +++ b/examples/2.0.x/server-go/examples/webhooks/create.md @@ -0,0 +1,33 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/webhooks" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := webhooks.New(client) + + response, err := service.Create( + "<WEBHOOK_ID>", + "https://example.com/webhook", + "<NAME>", + []string{"example"}, + service.WithCreateEnabled(false), + service.WithCreateTls(false), + service.WithCreateAuthUsername("<AUTH_USERNAME>"), + service.WithCreateAuthPassword("password"), + service.WithCreateSecret("<SECRET>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/webhooks/delete.md b/examples/2.0.x/server-go/examples/webhooks/delete.md new file mode 100644 index 000000000..0f1de0b44 --- /dev/null +++ b/examples/2.0.x/server-go/examples/webhooks/delete.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/webhooks" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := webhooks.New(client) + + response, err := service.Delete( + "<WEBHOOK_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/webhooks/get.md b/examples/2.0.x/server-go/examples/webhooks/get.md new file mode 100644 index 000000000..9175e3e3d --- /dev/null +++ b/examples/2.0.x/server-go/examples/webhooks/get.md @@ -0,0 +1,25 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/webhooks" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := webhooks.New(client) + + response, err := service.Get( + "<WEBHOOK_ID>", + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/webhooks/list.md b/examples/2.0.x/server-go/examples/webhooks/list.md new file mode 100644 index 000000000..d6d7aae8d --- /dev/null +++ b/examples/2.0.x/server-go/examples/webhooks/list.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/webhooks" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := webhooks.New(client) + + response, err := service.List( + service.WithListQueries([]string{"example"}), + service.WithListTotal(false), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/webhooks/update-secret.md b/examples/2.0.x/server-go/examples/webhooks/update-secret.md new file mode 100644 index 000000000..c924cd535 --- /dev/null +++ b/examples/2.0.x/server-go/examples/webhooks/update-secret.md @@ -0,0 +1,26 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/webhooks" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := webhooks.New(client) + + response, err := service.UpdateSecret( + "<WEBHOOK_ID>", + service.WithUpdateSecretSecret("<SECRET>"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-go/examples/webhooks/update.md b/examples/2.0.x/server-go/examples/webhooks/update.md new file mode 100644 index 000000000..32698b179 --- /dev/null +++ b/examples/2.0.x/server-go/examples/webhooks/update.md @@ -0,0 +1,32 @@ +```go +package main + +import ( + "fmt" + + "github.com/appwrite/sdk-for-go/appwrite" + "github.com/appwrite/sdk-for-go/webhooks" +) + +func main() { + client := appwrite.NewClient( + appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"), + appwrite.WithProject("<YOUR_PROJECT_ID>"), + appwrite.WithKey("<YOUR_API_KEY>"), + ) + + service := webhooks.New(client) + + response, err := service.Update( + "<WEBHOOK_ID>", + "<NAME>", + "https://example.com/webhook", + []string{"example"}, + service.WithUpdateEnabled(false), + service.WithUpdateTls(false), + service.WithUpdateAuthUsername("<AUTH_USERNAME>"), + service.WithUpdateAuthPassword("password"), + ) + fmt.Println(response, err) +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-anonymous-session.md b/examples/2.0.x/server-graphql/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..c040efb8c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-anonymous-session.md @@ -0,0 +1,35 @@ +```graphql +mutation { + accountCreateAnonymousSession { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-email-password-session.md b/examples/2.0.x/server-graphql/examples/account/create-email-password-session.md new file mode 100644 index 000000000..c68a4feb2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-email-password-session.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountCreateEmailPasswordSession( + email: "email@example.com", + password: "password" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-email-token.md b/examples/2.0.x/server-graphql/examples/account/create-email-token.md new file mode 100644 index 000000000..f9db2e2cc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-email-token.md @@ -0,0 +1,16 @@ +```graphql +mutation { + accountCreateEmailToken( + userId: "<USER_ID>", + email: "email@example.com", + phrase: false + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-email-verification.md b/examples/2.0.x/server-graphql/examples/account/create-email-verification.md new file mode 100644 index 000000000..3a4c559b2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-email-verification.md @@ -0,0 +1,14 @@ +```graphql +mutation { + accountCreateEmailVerification( + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-magic-url-token.md b/examples/2.0.x/server-graphql/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..59b2c94f2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-magic-url-token.md @@ -0,0 +1,17 @@ +```graphql +mutation { + accountCreateMagicURLToken( + userId: "<USER_ID>", + email: "email@example.com", + url: "https://example.com", + phrase: false + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-graphql/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..a3920a197 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-mfa-authenticator.md @@ -0,0 +1,10 @@ +```graphql +mutation { + accountCreateMFAAuthenticator( + type: "totp" + ) { + secret + uri + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-graphql/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..3da400f67 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-mfa-challenge.md @@ -0,0 +1,12 @@ +```graphql +mutation { + accountCreateMFAChallenge( + factor: "email" + ) { + _id + _createdAt + userId + expire + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-graphql/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..9f1c3596e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```graphql +mutation { + accountCreateMFARecoveryCodes { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-phone-token.md b/examples/2.0.x/server-graphql/examples/account/create-phone-token.md new file mode 100644 index 000000000..e382df55c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-phone-token.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountCreatePhoneToken( + userId: "<USER_ID>", + phone: "+12065550100" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-phone-verification.md b/examples/2.0.x/server-graphql/examples/account/create-phone-verification.md new file mode 100644 index 000000000..88ce51a14 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-phone-verification.md @@ -0,0 +1,12 @@ +```graphql +mutation { + accountCreatePhoneVerification { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-recovery.md b/examples/2.0.x/server-graphql/examples/account/create-recovery.md new file mode 100644 index 000000000..f72f5a653 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-recovery.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountCreateRecovery( + email: "email@example.com", + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-session.md b/examples/2.0.x/server-graphql/examples/account/create-session.md new file mode 100644 index 000000000..b5dda77e1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-session.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountCreateSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create-verification.md b/examples/2.0.x/server-graphql/examples/account/create-verification.md new file mode 100644 index 000000000..818efe4dd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create-verification.md @@ -0,0 +1,14 @@ +```graphql +mutation { + accountCreateVerification( + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/create.md b/examples/2.0.x/server-graphql/examples/account/create.md new file mode 100644 index 000000000..46d379ac4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/create.md @@ -0,0 +1,49 @@ +```graphql +mutation { + accountCreate( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/delete-identity.md b/examples/2.0.x/server-graphql/examples/account/delete-identity.md new file mode 100644 index 000000000..d984a934b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/delete-identity.md @@ -0,0 +1,9 @@ +```graphql +mutation { + accountDeleteIdentity( + identityId: "<IDENTITY_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-graphql/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..7c78bc317 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,9 @@ +```graphql +mutation { + accountDeleteMFAAuthenticator( + type: "totp" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/delete-session.md b/examples/2.0.x/server-graphql/examples/account/delete-session.md new file mode 100644 index 000000000..36c3de994 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/delete-session.md @@ -0,0 +1,9 @@ +```graphql +mutation { + accountDeleteSession( + sessionId: "<SESSION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/delete-sessions.md b/examples/2.0.x/server-graphql/examples/account/delete-sessions.md new file mode 100644 index 000000000..65f6900e5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/delete-sessions.md @@ -0,0 +1,7 @@ +```graphql +mutation { + accountDeleteSessions { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-graphql/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..430d5f42c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```graphql +query { + accountGetMFARecoveryCodes { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/get-prefs.md b/examples/2.0.x/server-graphql/examples/account/get-prefs.md new file mode 100644 index 000000000..f7920fc2e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/get-prefs.md @@ -0,0 +1,7 @@ +```graphql +query { + accountGetPrefs { + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/get-session.md b/examples/2.0.x/server-graphql/examples/account/get-session.md new file mode 100644 index 000000000..0ff57c396 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/get-session.md @@ -0,0 +1,37 @@ +```graphql +query { + accountGetSession( + sessionId: "<SESSION_ID>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/get.md b/examples/2.0.x/server-graphql/examples/account/get.md new file mode 100644 index 000000000..0a4a636d5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/get.md @@ -0,0 +1,44 @@ +```graphql +query { + accountGet { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/list-identities.md b/examples/2.0.x/server-graphql/examples/account/list-identities.md new file mode 100644 index 000000000..237e67175 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/list-identities.md @@ -0,0 +1,22 @@ +```graphql +query { + accountListIdentities( + queries: [], + total: false + ) { + total + identities { + _id + _createdAt + _updatedAt + userId + provider + providerUid + providerEmail + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/list-mfa-factors.md b/examples/2.0.x/server-graphql/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..cca647fec --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +```graphql +query { + accountListMFAFactors { + totp + phone + email + recoveryCode + custom + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/list-sessions.md b/examples/2.0.x/server-graphql/examples/account/list-sessions.md new file mode 100644 index 000000000..106419a76 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/list-sessions.md @@ -0,0 +1,38 @@ +```graphql +query { + accountListSessions { + total + sessions { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-email-verification.md b/examples/2.0.x/server-graphql/examples/account/update-email-verification.md new file mode 100644 index 000000000..9a045dd80 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-email-verification.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountUpdateEmailVerification( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-email.md b/examples/2.0.x/server-graphql/examples/account/update-email.md new file mode 100644 index 000000000..4bb0aa3a1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-email.md @@ -0,0 +1,47 @@ +```graphql +mutation { + accountUpdateEmail( + email: "email@example.com", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-magic-url-session.md b/examples/2.0.x/server-graphql/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..92ad9693d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-magic-url-session.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountUpdateMagicURLSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-graphql/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..264c5029f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-mfa-authenticator.md @@ -0,0 +1,47 @@ +```graphql +mutation { + accountUpdateMFAAuthenticator( + type: "totp", + otp: "<OTP>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-graphql/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..d3a438cf0 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-mfa-challenge.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountUpdateMFAChallenge( + challengeId: "<CHALLENGE_ID>", + otp: "<OTP>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-graphql/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..5f0c5c2d6 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```graphql +mutation { + accountUpdateMFARecoveryCodes { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-mfa.md b/examples/2.0.x/server-graphql/examples/account/update-mfa.md new file mode 100644 index 000000000..0028106a3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-mfa.md @@ -0,0 +1,46 @@ +```graphql +mutation { + accountUpdateMFA( + mfa: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-name.md b/examples/2.0.x/server-graphql/examples/account/update-name.md new file mode 100644 index 000000000..3fdf28ae1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-name.md @@ -0,0 +1,46 @@ +```graphql +mutation { + accountUpdateName( + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-password.md b/examples/2.0.x/server-graphql/examples/account/update-password.md new file mode 100644 index 000000000..1864a76ac --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-password.md @@ -0,0 +1,47 @@ +```graphql +mutation { + accountUpdatePassword( + password: "password", + oldPassword: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-phone-session.md b/examples/2.0.x/server-graphql/examples/account/update-phone-session.md new file mode 100644 index 000000000..aa054709d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-phone-session.md @@ -0,0 +1,38 @@ +```graphql +mutation { + accountUpdatePhoneSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-phone-verification.md b/examples/2.0.x/server-graphql/examples/account/update-phone-verification.md new file mode 100644 index 000000000..2122d41be --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-phone-verification.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountUpdatePhoneVerification( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-phone.md b/examples/2.0.x/server-graphql/examples/account/update-phone.md new file mode 100644 index 000000000..7a3f7ce93 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-phone.md @@ -0,0 +1,47 @@ +```graphql +mutation { + accountUpdatePhone( + phone: "+12065550100", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-prefs.md b/examples/2.0.x/server-graphql/examples/account/update-prefs.md new file mode 100644 index 000000000..868ef3ef3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-prefs.md @@ -0,0 +1,46 @@ +```graphql +mutation { + accountUpdatePrefs( + prefs: "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-recovery.md b/examples/2.0.x/server-graphql/examples/account/update-recovery.md new file mode 100644 index 000000000..8d4c37a99 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-recovery.md @@ -0,0 +1,16 @@ +```graphql +mutation { + accountUpdateRecovery( + userId: "<USER_ID>", + secret: "<SECRET>", + password: "password" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-session.md b/examples/2.0.x/server-graphql/examples/account/update-session.md new file mode 100644 index 000000000..c045df3c1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-session.md @@ -0,0 +1,37 @@ +```graphql +mutation { + accountUpdateSession( + sessionId: "<SESSION_ID>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-status.md b/examples/2.0.x/server-graphql/examples/account/update-status.md new file mode 100644 index 000000000..4737887be --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-status.md @@ -0,0 +1,44 @@ +```graphql +mutation { + accountUpdateStatus { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/account/update-verification.md b/examples/2.0.x/server-graphql/examples/account/update-verification.md new file mode 100644 index 000000000..927ce4953 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/account/update-verification.md @@ -0,0 +1,15 @@ +```graphql +mutation { + accountUpdateVerification( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/advisor/delete-report.md b/examples/2.0.x/server-graphql/examples/advisor/delete-report.md new file mode 100644 index 000000000..9c3b5d164 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/advisor/delete-report.md @@ -0,0 +1,9 @@ +```graphql +mutation { + advisorDeleteReport( + reportId: "<REPORT_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/advisor/get-insight.md b/examples/2.0.x/server-graphql/examples/advisor/get-insight.md new file mode 100644 index 000000000..17316e591 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/advisor/get-insight.md @@ -0,0 +1,31 @@ +```graphql +query { + advisorGetInsight( + reportId: "<REPORT_ID>", + insightId: "<INSIGHT_ID>" + ) { + _id + _createdAt + _updatedAt + reportId + type + severity + status + resourceType + resourceId + parentResourceType + parentResourceId + title + summary + ctas { + label + service + method + params + } + analyzedAt + dismissedAt + dismissedBy + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/advisor/get-report.md b/examples/2.0.x/server-graphql/examples/advisor/get-report.md new file mode 100644 index 000000000..0078ee661 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/advisor/get-report.md @@ -0,0 +1,43 @@ +```graphql +query { + advisorGetReport( + reportId: "<REPORT_ID>" + ) { + _id + _createdAt + _updatedAt + appId + type + title + summary + targetType + target + categories + insights { + _id + _createdAt + _updatedAt + reportId + type + severity + status + resourceType + resourceId + parentResourceType + parentResourceId + title + summary + ctas { + label + service + method + params + } + analyzedAt + dismissedAt + dismissedBy + } + analyzedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/advisor/list-insights.md b/examples/2.0.x/server-graphql/examples/advisor/list-insights.md new file mode 100644 index 000000000..15d57638d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/advisor/list-insights.md @@ -0,0 +1,35 @@ +```graphql +query { + advisorListInsights( + reportId: "<REPORT_ID>", + queries: [], + total: false + ) { + total + insights { + _id + _createdAt + _updatedAt + reportId + type + severity + status + resourceType + resourceId + parentResourceType + parentResourceId + title + summary + ctas { + label + service + method + params + } + analyzedAt + dismissedAt + dismissedBy + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/advisor/list-reports.md b/examples/2.0.x/server-graphql/examples/advisor/list-reports.md new file mode 100644 index 000000000..a33af1167 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/advisor/list-reports.md @@ -0,0 +1,47 @@ +```graphql +query { + advisorListReports( + queries: [], + total: false + ) { + total + reports { + _id + _createdAt + _updatedAt + appId + type + title + summary + targetType + target + categories + insights { + _id + _createdAt + _updatedAt + reportId + type + severity + status + resourceType + resourceId + parentResourceType + parentResourceId + title + summary + ctas { + label + service + method + params + } + analyzedAt + dismissedAt + dismissedBy + } + analyzedAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-browser.md b/examples/2.0.x/server-graphql/examples/avatars/get-browser.md new file mode 100644 index 000000000..2f432681b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-browser.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetBrowser( + code: "aa", + width: 0, + height: 0, + quality: -1 + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-credit-card.md b/examples/2.0.x/server-graphql/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..952c23021 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-credit-card.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetCreditCard( + code: "amex", + width: 0, + height: 0, + quality: -1 + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-favicon.md b/examples/2.0.x/server-graphql/examples/avatars/get-favicon.md new file mode 100644 index 000000000..22653ab58 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-favicon.md @@ -0,0 +1,9 @@ +```graphql +query { + avatarsGetFavicon( + url: "https://example.com" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-flag.md b/examples/2.0.x/server-graphql/examples/avatars/get-flag.md new file mode 100644 index 000000000..6444e6988 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-flag.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetFlag( + code: "af", + width: 0, + height: 0, + quality: -1 + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-image.md b/examples/2.0.x/server-graphql/examples/avatars/get-image.md new file mode 100644 index 000000000..8acc02134 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-image.md @@ -0,0 +1,11 @@ +```graphql +query { + avatarsGetImage( + url: "https://example.com", + width: 0, + height: 0 + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-initials.md b/examples/2.0.x/server-graphql/examples/avatars/get-initials.md new file mode 100644 index 000000000..c172740be --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-initials.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetInitials( + name: "<NAME>", + width: 0, + height: 0, + background: "FFFFFF" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-photo.md b/examples/2.0.x/server-graphql/examples/avatars/get-photo.md new file mode 100644 index 000000000..101335eac --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-photo.md @@ -0,0 +1,16 @@ +```graphql +query { + avatarsGetPhoto( + width: 0, + height: 0, + quality: 0, + output: "png", + rating: "g", + userId: "current()", + emailHash: "<EMAIL_HASH>", + name: "<NAME>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-qr.md b/examples/2.0.x/server-graphql/examples/avatars/get-qr.md new file mode 100644 index 000000000..9206b404e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-qr.md @@ -0,0 +1,12 @@ +```graphql +query { + avatarsGetQR( + text: "<TEXT>", + size: 1, + margin: 0, + download: false + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/avatars/get-screenshot.md b/examples/2.0.x/server-graphql/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..f5cab660c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/avatars/get-screenshot.md @@ -0,0 +1,28 @@ +```graphql +query { + avatarsGetScreenshot( + url: "https://example.com", + headers: "{\"Authorization\":\"Bearer token123\",\"X-Custom-Header\":\"value\"}", + viewportWidth: 1920, + viewportHeight: 1080, + scale: 2, + theme: "dark", + userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", + fullpage: true, + locale: "en-US", + timezone: "America/New_York", + latitude: 37.7749, + longitude: -122.4194, + accuracy: 100, + touch: true, + permissions: ["geolocation", "notifications"], + sleep: 3, + width: 800, + height: 600, + quality: 85, + output: "jpeg" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..f4eca12e6 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-big-int-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesCreateBigIntAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, + max: 1000000, + default: 0, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..64b6ffa53 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-boolean-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesCreateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: false, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-collection.md b/examples/2.0.x/server-graphql/examples/databases/create-collection.md new file mode 100644 index 000000000..d082f4e8c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-collection.md @@ -0,0 +1,38 @@ +```graphql +mutation { + databasesCreateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"], + documentSecurity: false, + enabled: false, + attributes: [], + indexes: [] + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..8e58c6f12 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-datetime-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesCreateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-document.md b/examples/2.0.x/server-graphql/examples/databases/create-document.md new file mode 100644 index 000000000..5ca3e372a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesCreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-documents.md b/examples/2.0.x/server-graphql/examples/databases/create-documents.md new file mode 100644 index 000000000..67d038e93 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesCreateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-email-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..a463a4ead --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-email-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesCreateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..0d4f254c1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-enum-attribute.md @@ -0,0 +1,25 @@ +```graphql +mutation { + databasesCreateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + elements + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-float-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..d1a466b10 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-float-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesCreateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, + max: 100, + default: 10.5, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-index.md b/examples/2.0.x/server-graphql/examples/databases/create-index.md new file mode 100644 index 000000000..6676113e4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-index.md @@ -0,0 +1,24 @@ +```graphql +mutation { + databasesCreateIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: "key", + attributes: [], + orders: [], + lengths: [] + ) { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..7edf71910 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-integer-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesCreateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, + max: 100, + default: 10, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..dc995d7bc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-ip-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesCreateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-line-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..dca609e98 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-line-attribute.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesCreateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..7748eb04d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-longtext-attribute.md @@ -0,0 +1,24 @@ +```graphql +mutation { + databasesCreateLongtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..8aea0150d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,24 @@ +```graphql +mutation { + databasesCreateMediumtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-operations.md b/examples/2.0.x/server-graphql/examples/databases/create-operations.md new file mode 100644 index 000000000..7fa29cf3f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + databasesCreateOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-point-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..304cfa295 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-point-attribute.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesCreatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [1, 2] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..9ff2f46f0 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-polygon-attribute.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesCreatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..9fe8ff312 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-relationship-attribute.md @@ -0,0 +1,29 @@ +```graphql +mutation { + databasesCreateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + relatedCollectionId: "<RELATED_COLLECTION_ID>", + type: "oneToOne", + twoWay: false, + key: "<KEY>", + twoWayKey: "<TWO_WAY_KEY>", + onDelete: "cascade" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + relatedCollection + relationType + twoWay + twoWayKey + onDelete + side + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-string-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..3398a7b89 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-string-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesCreateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-text-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..651cbb6de --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-text-attribute.md @@ -0,0 +1,24 @@ +```graphql +mutation { + databasesCreateTextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-transaction.md b/examples/2.0.x/server-graphql/examples/databases/create-transaction.md new file mode 100644 index 000000000..d28f2eadc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + databasesCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-url-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..b28c679bc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-url-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesCreateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-graphql/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..081f0c357 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create-varchar-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesCreateVarcharAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/create.md b/examples/2.0.x/server-graphql/examples/databases/create.md new file mode 100644 index 000000000..b427ba35d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/create.md @@ -0,0 +1,17 @@ +```graphql +mutation { + databasesCreate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-graphql/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..0b5428ae6 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesDecrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, + min: 0, + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/delete-attribute.md b/examples/2.0.x/server-graphql/examples/databases/delete-attribute.md new file mode 100644 index 000000000..1c2d0a923 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/delete-attribute.md @@ -0,0 +1,11 @@ +```graphql +mutation { + databasesDeleteAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/delete-collection.md b/examples/2.0.x/server-graphql/examples/databases/delete-collection.md new file mode 100644 index 000000000..6d6db5b1a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/delete-collection.md @@ -0,0 +1,10 @@ +```graphql +mutation { + databasesDeleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/delete-document.md b/examples/2.0.x/server-graphql/examples/databases/delete-document.md new file mode 100644 index 000000000..f6d166b0c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/delete-document.md @@ -0,0 +1,12 @@ +```graphql +mutation { + databasesDeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/delete-documents.md b/examples/2.0.x/server-graphql/examples/databases/delete-documents.md new file mode 100644 index 000000000..6cf4405ca --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/delete-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesDeleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/delete-index.md b/examples/2.0.x/server-graphql/examples/databases/delete-index.md new file mode 100644 index 000000000..8a4930c7a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/delete-index.md @@ -0,0 +1,11 @@ +```graphql +mutation { + databasesDeleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/delete-transaction.md b/examples/2.0.x/server-graphql/examples/databases/delete-transaction.md new file mode 100644 index 000000000..9230d0c85 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + databasesDeleteTransaction( + transactionId: "<TRANSACTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/delete.md b/examples/2.0.x/server-graphql/examples/databases/delete.md new file mode 100644 index 000000000..a5fc46409 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + databasesDelete( + databaseId: "<DATABASE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/get-attribute.md b/examples/2.0.x/server-graphql/examples/databases/get-attribute.md new file mode 100644 index 000000000..9ddb17b8e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/get-attribute.md @@ -0,0 +1,19 @@ +```graphql +query { + databasesGetAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/get-collection.md b/examples/2.0.x/server-graphql/examples/databases/get-collection.md new file mode 100644 index 000000000..2e83ac46d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/get-collection.md @@ -0,0 +1,32 @@ +```graphql +query { + databasesGetCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/get-document.md b/examples/2.0.x/server-graphql/examples/databases/get-document.md new file mode 100644 index 000000000..e188dee38 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/get-document.md @@ -0,0 +1,20 @@ +```graphql +query { + databasesGetDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/get-index.md b/examples/2.0.x/server-graphql/examples/databases/get-index.md new file mode 100644 index 000000000..39256475d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/get-index.md @@ -0,0 +1,20 @@ +```graphql +query { + databasesGetIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" + ) { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/get-transaction.md b/examples/2.0.x/server-graphql/examples/databases/get-transaction.md new file mode 100644 index 000000000..001554140 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + databasesGetTransaction( + transactionId: "<TRANSACTION_ID>" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/get.md b/examples/2.0.x/server-graphql/examples/databases/get.md new file mode 100644 index 000000000..360157511 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/get.md @@ -0,0 +1,15 @@ +```graphql +query { + databasesGet( + databaseId: "<DATABASE_ID>" + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-graphql/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..8c3246a05 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/increment-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesIncrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, + max: 100, + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/list-attributes.md b/examples/2.0.x/server-graphql/examples/databases/list-attributes.md new file mode 100644 index 000000000..c8a93ecb8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/list-attributes.md @@ -0,0 +1,13 @@ +```graphql +query { + databasesListAttributes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + total: false + ) { + total + attributes + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/list-collections.md b/examples/2.0.x/server-graphql/examples/databases/list-collections.md new file mode 100644 index 000000000..804545134 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/list-collections.md @@ -0,0 +1,37 @@ +```graphql +query { + databasesListCollections( + databaseId: "<DATABASE_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + collections { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/list-documents.md b/examples/2.0.x/server-graphql/examples/databases/list-documents.md new file mode 100644 index 000000000..d0e331d0e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/list-documents.md @@ -0,0 +1,24 @@ +```graphql +query { + databasesListDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/list-indexes.md b/examples/2.0.x/server-graphql/examples/databases/list-indexes.md new file mode 100644 index 000000000..a6ab75e12 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/list-indexes.md @@ -0,0 +1,24 @@ +```graphql +query { + databasesListIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + total: false + ) { + total + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/list-transactions.md b/examples/2.0.x/server-graphql/examples/databases/list-transactions.md new file mode 100644 index 000000000..2fc18db35 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + databasesListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/list.md b/examples/2.0.x/server-graphql/examples/databases/list.md new file mode 100644 index 000000000..6f72697ac --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/list.md @@ -0,0 +1,20 @@ +```graphql +query { + databasesList( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + databases { + _id + name + _createdAt + _updatedAt + enabled + type + status + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..d1821878e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-big-int-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesUpdateBigIntAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 0, + min: 0, + max: 1000000, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..f40dcccba --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-boolean-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesUpdateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: false, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-collection.md b/examples/2.0.x/server-graphql/examples/databases/update-collection.md new file mode 100644 index 000000000..d3c159f1a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-collection.md @@ -0,0 +1,37 @@ +```graphql +mutation { + databasesUpdateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"], + documentSecurity: false, + enabled: false, + purge: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..86c659f07 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-datetime-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesUpdateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-document.md b/examples/2.0.x/server-graphql/examples/databases/update-document.md new file mode 100644 index 000000000..5b9eaf050 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesUpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":33,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-documents.md b/examples/2.0.x/server-graphql/examples/databases/update-documents.md new file mode 100644 index 000000000..b9773fce2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-documents.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesUpdateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":33,\"isAdmin\":false}", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-email-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..1eb5807b8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-email-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesUpdateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..903b43e9e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-enum-attribute.md @@ -0,0 +1,25 @@ +```graphql +mutation { + databasesUpdateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + elements + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-float-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..9eff9e705 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-float-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesUpdateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 10.5, + min: 0, + max: 100, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..8d346abc9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-integer-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesUpdateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 10, + min: 0, + max: 100, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..cf91d0f58 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-ip-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesUpdateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-line-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..9a3cc72ca --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-line-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesUpdateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]], + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..53c6fdaa5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-longtext-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesUpdateLongtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..60a101367 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesUpdateMediumtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-point-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..17940f033 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-point-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesUpdatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [1, 2], + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..ede02ed4a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-polygon-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesUpdatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..d642c9b83 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-relationship-attribute.md @@ -0,0 +1,26 @@ +```graphql +mutation { + databasesUpdateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + onDelete: "cascade", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + relatedCollection + relationType + twoWay + twoWayKey + onDelete + side + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-string-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..75f177d20 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-string-attribute.md @@ -0,0 +1,25 @@ +```graphql +mutation { + databasesUpdateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-text-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..22ef57e1a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-text-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesUpdateTextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-transaction.md b/examples/2.0.x/server-graphql/examples/databases/update-transaction.md new file mode 100644 index 000000000..a2d8cb145 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + databasesUpdateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-url-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..214ab674e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-url-attribute.md @@ -0,0 +1,23 @@ +```graphql +mutation { + databasesUpdateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-graphql/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..2f610d9eb --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update-varchar-attribute.md @@ -0,0 +1,25 @@ +```graphql +mutation { + databasesUpdateVarcharAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/update.md b/examples/2.0.x/server-graphql/examples/databases/update.md new file mode 100644 index 000000000..aec285675 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/update.md @@ -0,0 +1,17 @@ +```graphql +mutation { + databasesUpdate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/upsert-document.md b/examples/2.0.x/server-graphql/examples/databases/upsert-document.md new file mode 100644 index 000000000..910971ed5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/upsert-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + databasesUpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/databases/upsert-documents.md b/examples/2.0.x/server-graphql/examples/databases/upsert-documents.md new file mode 100644 index 000000000..eb0573545 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/databases/upsert-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + databasesUpsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/create-collection.md b/examples/2.0.x/server-graphql/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..2352e900a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/create-collection.md @@ -0,0 +1,38 @@ +```graphql +mutation { + documentsDBCreateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"], + documentSecurity: false, + enabled: false, + attributes: [], + indexes: [] + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/create-document.md b/examples/2.0.x/server-graphql/examples/documentsdb/create-document.md new file mode 100644 index 000000000..f8415e6af --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/create-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBCreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/create-documents.md b/examples/2.0.x/server-graphql/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..211576113 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/create-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBCreateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/create-index.md b/examples/2.0.x/server-graphql/examples/documentsdb/create-index.md new file mode 100644 index 000000000..bc51f4562 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/create-index.md @@ -0,0 +1,24 @@ +```graphql +mutation { + documentsDBCreateIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: "key", + attributes: [], + orders: [], + lengths: [] + ) { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/create-operations.md b/examples/2.0.x/server-graphql/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..153d00770 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + documentsDBCreateOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-graphql/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..75a9d53d4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + documentsDBCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/create.md b/examples/2.0.x/server-graphql/examples/documentsdb/create.md new file mode 100644 index 000000000..d9b1437f7 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/create.md @@ -0,0 +1,17 @@ +```graphql +mutation { + documentsDBCreate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-graphql/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..180e2af17 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBDecrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, + min: 0, + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-graphql/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..75bc5fd38 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/delete-collection.md @@ -0,0 +1,10 @@ +```graphql +mutation { + documentsDBDeleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/delete-document.md b/examples/2.0.x/server-graphql/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..64f03c698 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/delete-document.md @@ -0,0 +1,12 @@ +```graphql +mutation { + documentsDBDeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-graphql/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..46deb6f75 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/delete-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBDeleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/delete-index.md b/examples/2.0.x/server-graphql/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..962c9a7bc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/delete-index.md @@ -0,0 +1,11 @@ +```graphql +mutation { + documentsDBDeleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-graphql/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..d6cea68f2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + documentsDBDeleteTransaction( + transactionId: "<TRANSACTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/delete.md b/examples/2.0.x/server-graphql/examples/documentsdb/delete.md new file mode 100644 index 000000000..9e40f04a5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + documentsDBDelete( + databaseId: "<DATABASE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/get-collection.md b/examples/2.0.x/server-graphql/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..aad2761e6 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/get-collection.md @@ -0,0 +1,32 @@ +```graphql +query { + documentsDBGetCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/get-document.md b/examples/2.0.x/server-graphql/examples/documentsdb/get-document.md new file mode 100644 index 000000000..970f56656 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/get-document.md @@ -0,0 +1,20 @@ +```graphql +query { + documentsDBGetDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/get-index.md b/examples/2.0.x/server-graphql/examples/documentsdb/get-index.md new file mode 100644 index 000000000..68bb5c7c1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/get-index.md @@ -0,0 +1,20 @@ +```graphql +query { + documentsDBGetIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" + ) { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-graphql/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..76e3dd728 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + documentsDBGetTransaction( + transactionId: "<TRANSACTION_ID>" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/get.md b/examples/2.0.x/server-graphql/examples/documentsdb/get.md new file mode 100644 index 000000000..34946723a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/get.md @@ -0,0 +1,15 @@ +```graphql +query { + documentsDBGet( + databaseId: "<DATABASE_ID>" + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-graphql/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..cb70414fd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBIncrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, + max: 100, + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/list-collections.md b/examples/2.0.x/server-graphql/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..1ea7ed863 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/list-collections.md @@ -0,0 +1,37 @@ +```graphql +query { + documentsDBListCollections( + databaseId: "<DATABASE_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + collections { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/list-documents.md b/examples/2.0.x/server-graphql/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..89a23cf05 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/list-documents.md @@ -0,0 +1,24 @@ +```graphql +query { + documentsDBListDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-graphql/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..39e333334 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/list-indexes.md @@ -0,0 +1,24 @@ +```graphql +query { + documentsDBListIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + total: false + ) { + total + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-graphql/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..2569dde05 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + documentsDBListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/list.md b/examples/2.0.x/server-graphql/examples/documentsdb/list.md new file mode 100644 index 000000000..8acb6e7ae --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/list.md @@ -0,0 +1,20 @@ +```graphql +query { + documentsDBList( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + databases { + _id + name + _createdAt + _updatedAt + enabled + type + status + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/update-collection.md b/examples/2.0.x/server-graphql/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..73db3382c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/update-collection.md @@ -0,0 +1,37 @@ +```graphql +mutation { + documentsDBUpdateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"], + documentSecurity: false, + enabled: false, + purge: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/update-document.md b/examples/2.0.x/server-graphql/examples/documentsdb/update-document.md new file mode 100644 index 000000000..40a4898c9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/update-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBUpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/update-documents.md b/examples/2.0.x/server-graphql/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..05a4665e7 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/update-documents.md @@ -0,0 +1,23 @@ +```graphql +mutation { + documentsDBUpdateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: "{}", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-graphql/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..a9616ca48 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + documentsDBUpdateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/update.md b/examples/2.0.x/server-graphql/examples/documentsdb/update.md new file mode 100644 index 000000000..1919cb773 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/update.md @@ -0,0 +1,17 @@ +```graphql +mutation { + documentsDBUpdate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-graphql/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..1b75a2830 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/upsert-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + documentsDBUpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-graphql/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..2a6ed4885 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/documentsdb/upsert-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + documentsDBUpsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-graphql/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..0fcc63982 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,16 @@ +```graphql +mutation { + embeddingsCreateTextEmbeddings( + texts: [], + model: "nomic-embed-text" + ) { + total + embeddings { + model + dimension + embedding + error + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/create-deployment.md b/examples/2.0.x/server-graphql/examples/functions/create-deployment.md new file mode 100644 index 000000000..017ddf91f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/create-deployment.md @@ -0,0 +1,26 @@ +```graphql +POST /v1/functions/{functionId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { functionsCreateDeployment(functionId: $functionId, code: $code, activate: $activate, entrypoint: $entrypoint, commands: $commands) { id }" }, "variables": { "functionId": "<FUNCTION_ID>", "code": null, "activate": false, "entrypoint": "<ENTRYPOINT>", "commands": "<COMMANDS>" } } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="map" + +{ "0": ["variables.code"], } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="0"; filename="code.ext" + +File contents + +--cec8e8123c05ba25-- +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-graphql/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..4838d0403 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,37 @@ +```graphql +mutation { + functionsCreateDuplicateDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + buildId: "<BUILD_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/create-execution.md b/examples/2.0.x/server-graphql/examples/functions/create-execution.md new file mode 100644 index 000000000..1009c36d5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/create-execution.md @@ -0,0 +1,39 @@ +```graphql +mutation { + functionsCreateExecution( + functionId: "<FUNCTION_ID>", + body: "<BODY>", + async: false, + path: "<PATH>", + method: "GET", + headers: "{}", + scheduledAt: "<SCHEDULED_AT>" + ) { + _id + _createdAt + _updatedAt + _permissions + resourceId + resourceType + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/create-template-deployment.md b/examples/2.0.x/server-graphql/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..57a0cf475 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/create-template-deployment.md @@ -0,0 +1,41 @@ +```graphql +mutation { + functionsCreateTemplateDeployment( + functionId: "<FUNCTION_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + type: "commit", + reference: "<REFERENCE>", + activate: false + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/create-variable.md b/examples/2.0.x/server-graphql/examples/functions/create-variable.md new file mode 100644 index 000000000..0747cb110 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/create-variable.md @@ -0,0 +1,20 @@ +```graphql +mutation { + functionsCreateVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-graphql/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..3bedd7a85 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/create-vcs-deployment.md @@ -0,0 +1,38 @@ +```graphql +mutation { + functionsCreateVcsDeployment( + functionId: "<FUNCTION_ID>", + type: "branch", + reference: "<REFERENCE>", + activate: false + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/create.md b/examples/2.0.x/server-graphql/examples/functions/create.md new file mode 100644 index 000000000..3f12f57a2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/create.md @@ -0,0 +1,70 @@ +```graphql +mutation { + functionsCreate( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: "node-14.5", + execute: ["any"], + events: [], + schedule: "0 0 * * *", + timeout: 1, + enabled: false, + logging: false, + entrypoint: "<ENTRYPOINT>", + commands: "<COMMANDS>", + scopes: [], + installationId: "<INSTALLATION_ID>", + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", + providerBranch: "<PROVIDER_BRANCH>", + providerSilentMode: false, + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", + providerBranches: [], + providerPaths: [], + buildSpecification: "s-1vcpu-512mb", + runtimeSpecification: "s-1vcpu-512mb", + deploymentRetention: 0 + ) { + _id + _createdAt + _updatedAt + execute + name + enabled + live + logging + runtime + deploymentRetention + deploymentId + deploymentCreatedAt + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + events + schedule + timeout + entrypoint + commands + version + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/delete-deployment.md b/examples/2.0.x/server-graphql/examples/functions/delete-deployment.md new file mode 100644 index 000000000..7ea06f5dd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/delete-deployment.md @@ -0,0 +1,10 @@ +```graphql +mutation { + functionsDeleteDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/delete-execution.md b/examples/2.0.x/server-graphql/examples/functions/delete-execution.md new file mode 100644 index 000000000..f0d516075 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/delete-execution.md @@ -0,0 +1,10 @@ +```graphql +mutation { + functionsDeleteExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/delete-variable.md b/examples/2.0.x/server-graphql/examples/functions/delete-variable.md new file mode 100644 index 000000000..b0c4110ef --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/delete-variable.md @@ -0,0 +1,10 @@ +```graphql +mutation { + functionsDeleteVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/delete.md b/examples/2.0.x/server-graphql/examples/functions/delete.md new file mode 100644 index 000000000..b941489af --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + functionsDelete( + functionId: "<FUNCTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/get-deployment-download.md b/examples/2.0.x/server-graphql/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..65e956f80 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/get-deployment-download.md @@ -0,0 +1,12 @@ +```graphql +query { + functionsGetDeploymentDownload( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: "source", + token: "<TOKEN>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/get-deployment.md b/examples/2.0.x/server-graphql/examples/functions/get-deployment.md new file mode 100644 index 000000000..0c72d44b9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/get-deployment.md @@ -0,0 +1,36 @@ +```graphql +query { + functionsGetDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/get-execution.md b/examples/2.0.x/server-graphql/examples/functions/get-execution.md new file mode 100644 index 000000000..314b7423e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/get-execution.md @@ -0,0 +1,34 @@ +```graphql +query { + functionsGetExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" + ) { + _id + _createdAt + _updatedAt + _permissions + resourceId + resourceType + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/get-variable.md b/examples/2.0.x/server-graphql/examples/functions/get-variable.md new file mode 100644 index 000000000..198acbdde --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/get-variable.md @@ -0,0 +1,17 @@ +```graphql +query { + functionsGetVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/get.md b/examples/2.0.x/server-graphql/examples/functions/get.md new file mode 100644 index 000000000..ac9557147 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/get.md @@ -0,0 +1,49 @@ +```graphql +query { + functionsGet( + functionId: "<FUNCTION_ID>" + ) { + _id + _createdAt + _updatedAt + execute + name + enabled + live + logging + runtime + deploymentRetention + deploymentId + deploymentCreatedAt + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + events + schedule + timeout + entrypoint + commands + version + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/list-deployments.md b/examples/2.0.x/server-graphql/examples/functions/list-deployments.md new file mode 100644 index 000000000..8ba4d3d9d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/list-deployments.md @@ -0,0 +1,41 @@ +```graphql +query { + functionsListDeployments( + functionId: "<FUNCTION_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + deployments { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/list-executions.md b/examples/2.0.x/server-graphql/examples/functions/list-executions.md new file mode 100644 index 000000000..b76e92aca --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/list-executions.md @@ -0,0 +1,38 @@ +```graphql +query { + functionsListExecutions( + functionId: "<FUNCTION_ID>", + queries: [], + total: false + ) { + total + executions { + _id + _createdAt + _updatedAt + _permissions + resourceId + resourceType + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/list-runtimes.md b/examples/2.0.x/server-graphql/examples/functions/list-runtimes.md new file mode 100644 index 000000000..ef88ce307 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/list-runtimes.md @@ -0,0 +1,17 @@ +```graphql +query { + functionsListRuntimes { + total + runtimes { + _id + key + name + version + base + image + logo + supports + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/list-specifications.md b/examples/2.0.x/server-graphql/examples/functions/list-specifications.md new file mode 100644 index 000000000..75402c357 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/list-specifications.md @@ -0,0 +1,15 @@ +```graphql +query { + functionsListSpecifications( + type: "runtimes" + ) { + total + specifications { + memory + cpus + enabled + slug + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/list-variables.md b/examples/2.0.x/server-graphql/examples/functions/list-variables.md new file mode 100644 index 000000000..f58181d9a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/list-variables.md @@ -0,0 +1,21 @@ +```graphql +query { + functionsListVariables( + functionId: "<FUNCTION_ID>", + queries: [], + total: false + ) { + total + variables { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/list.md b/examples/2.0.x/server-graphql/examples/functions/list.md new file mode 100644 index 000000000..188b81043 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/list.md @@ -0,0 +1,54 @@ +```graphql +query { + functionsList( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + functions { + _id + _createdAt + _updatedAt + execute + name + enabled + live + logging + runtime + deploymentRetention + deploymentId + deploymentCreatedAt + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + events + schedule + timeout + entrypoint + commands + version + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/update-deployment-status.md b/examples/2.0.x/server-graphql/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..2097e1201 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/update-deployment-status.md @@ -0,0 +1,36 @@ +```graphql +mutation { + functionsUpdateDeploymentStatus( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/update-function-deployment.md b/examples/2.0.x/server-graphql/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..d97150d4a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/update-function-deployment.md @@ -0,0 +1,50 @@ +```graphql +mutation { + functionsUpdateFunctionDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + execute + name + enabled + live + logging + runtime + deploymentRetention + deploymentId + deploymentCreatedAt + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + events + schedule + timeout + entrypoint + commands + version + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/update-variable.md b/examples/2.0.x/server-graphql/examples/functions/update-variable.md new file mode 100644 index 000000000..a1eededb9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/update-variable.md @@ -0,0 +1,20 @@ +```graphql +mutation { + functionsUpdateVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/functions/update.md b/examples/2.0.x/server-graphql/examples/functions/update.md new file mode 100644 index 000000000..2ba5cc7e5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/functions/update.md @@ -0,0 +1,70 @@ +```graphql +mutation { + functionsUpdate( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: "node-14.5", + execute: ["any"], + events: [], + schedule: "0 0 * * *", + timeout: 1, + enabled: false, + logging: false, + entrypoint: "<ENTRYPOINT>", + commands: "<COMMANDS>", + scopes: [], + installationId: "<INSTALLATION_ID>", + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", + providerBranch: "<PROVIDER_BRANCH>", + providerSilentMode: false, + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", + providerBranches: [], + providerPaths: [], + buildSpecification: "s-1vcpu-512mb", + runtimeSpecification: "s-1vcpu-512mb", + deploymentRetention: 0 + ) { + _id + _createdAt + _updatedAt + execute + name + enabled + live + logging + runtime + deploymentRetention + deploymentId + deploymentCreatedAt + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + events + schedule + timeout + entrypoint + commands + version + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/locale/get.md b/examples/2.0.x/server-graphql/examples/locale/get.md new file mode 100644 index 000000000..c591b694c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/locale/get.md @@ -0,0 +1,13 @@ +```graphql +query { + localeGet { + ip + countryCode + country + continentCode + continent + eu + currency + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/locale/list-codes.md b/examples/2.0.x/server-graphql/examples/locale/list-codes.md new file mode 100644 index 000000000..0e3967246 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +```graphql +query { + localeListCodes { + total + localeCodes { + code + name + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/locale/list-continents.md b/examples/2.0.x/server-graphql/examples/locale/list-continents.md new file mode 100644 index 000000000..16ad0fd94 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +```graphql +query { + localeListContinents { + total + continents { + name + code + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/locale/list-countries-eu.md b/examples/2.0.x/server-graphql/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..293d32c9c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +```graphql +query { + localeListCountriesEU { + total + countries { + name + code + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/locale/list-countries-phones.md b/examples/2.0.x/server-graphql/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..b17b065e3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/locale/list-countries-phones.md @@ -0,0 +1,12 @@ +```graphql +query { + localeListCountriesPhones { + total + phones { + code + countryCode + countryName + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/locale/list-countries.md b/examples/2.0.x/server-graphql/examples/locale/list-countries.md new file mode 100644 index 000000000..15f566af0 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +```graphql +query { + localeListCountries { + total + countries { + name + code + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/locale/list-currencies.md b/examples/2.0.x/server-graphql/examples/locale/list-currencies.md new file mode 100644 index 000000000..374d67126 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/locale/list-currencies.md @@ -0,0 +1,16 @@ +```graphql +query { + localeListCurrencies { + total + currencies { + symbol + name + symbolNative + decimalDigits + rounding + code + namePlural + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/locale/list-languages.md b/examples/2.0.x/server-graphql/examples/locale/list-languages.md new file mode 100644 index 000000000..ed108f5a4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/locale/list-languages.md @@ -0,0 +1,12 @@ +```graphql +query { + localeListLanguages { + total + languages { + name + code + nativeName + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..851a80154 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-apns-provider.md @@ -0,0 +1,24 @@ +```graphql +mutation { + messagingCreateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + authKey: "<AUTH_KEY>", + authKeyId: "<AUTH_KEY_ID>", + teamId: "<TEAM_ID>", + bundleId: "<BUNDLE_ID>", + sandbox: false, + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-email.md b/examples/2.0.x/server-graphql/examples/messaging/create-email.md new file mode 100644 index 000000000..2b0d1fea7 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-email.md @@ -0,0 +1,32 @@ +```graphql +mutation { + messagingCreateEmail( + messageId: "<MESSAGE_ID>", + subject: "<SUBJECT>", + content: "<CONTENT>", + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + attachments: [], + draft: false, + html: false, + scheduledAt: "2020-10-15T06:38:00.000+00:00" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..d531a2d6d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-fcm-provider.md @@ -0,0 +1,20 @@ +```graphql +mutation { + messagingCreateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + serviceAccountJSON: "{}", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..7d465e628 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,26 @@ +```graphql +mutation { + messagingCreateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", + domain: "example.com", + isEuRegion: false, + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "email@example.com", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..130aa6e6f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingCreateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + templateId: "<TEMPLATE_ID>", + senderId: "<SENDER_ID>", + authKey: "<AUTH_KEY>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-push.md b/examples/2.0.x/server-graphql/examples/messaging/create-push.md new file mode 100644 index 000000000..0f5f68545 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-push.md @@ -0,0 +1,39 @@ +```graphql +mutation { + messagingCreatePush( + messageId: "<MESSAGE_ID>", + title: "<TITLE>", + body: "<BODY>", + topics: [], + users: [], + targets: [], + data: "{}", + action: "<ACTION>", + image: "<ID1:ID2>", + icon: "<ICON>", + sound: "<SOUND>", + color: "<COLOR>", + tag: "<TAG>", + badge: 1, + draft: false, + scheduledAt: "2020-10-15T06:38:00.000+00:00", + contentAvailable: false, + critical: false, + priority: "normal" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..afb9a56b9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-resend-provider.md @@ -0,0 +1,24 @@ +```graphql +mutation { + messagingCreateResendProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "email@example.com", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..709e17e69 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,24 @@ +```graphql +mutation { + messagingCreateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "email@example.com", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..112de8673 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-ses-provider.md @@ -0,0 +1,26 @@ +```graphql +mutation { + messagingCreateSesProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + accessKey: "<ACCESS_KEY>", + secretKey: "<SECRET_KEY>", + region: "<REGION>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "email@example.com", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-sms.md b/examples/2.0.x/server-graphql/examples/messaging/create-sms.md new file mode 100644 index 000000000..d193ef9de --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-sms.md @@ -0,0 +1,27 @@ +```graphql +mutation { + messagingCreateSMS( + messageId: "<MESSAGE_ID>", + content: "<CONTENT>", + topics: [], + users: [], + targets: [], + draft: false, + scheduledAt: "2020-10-15T06:38:00.000+00:00" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..99b3b9dac --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-smtp-provider.md @@ -0,0 +1,30 @@ +```graphql +mutation { + messagingCreateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + host: "<HOST>", + port: 587, + username: "<USERNAME>", + password: "password", + encryption: "none", + autoTLS: false, + mailer: "<MAILER>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "email@example.com", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-subscriber.md b/examples/2.0.x/server-graphql/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..50d67e14f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-subscriber.md @@ -0,0 +1,29 @@ +```graphql +mutation { + messagingCreateSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>", + targetId: "<TARGET_ID>" + ) { + _id + _createdAt + _updatedAt + targetId + target { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + userId + userName + topicId + providerType + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..cffc2d92a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-telesign-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingCreateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", + customerId: "<CUSTOMER_ID>", + apiKey: "<API_KEY>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..5456ed54c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingCreateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", + username: "<USERNAME>", + apiKey: "<API_KEY>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-topic.md b/examples/2.0.x/server-graphql/examples/messaging/create-topic.md new file mode 100644 index 000000000..cb4c07fb2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-topic.md @@ -0,0 +1,18 @@ +```graphql +mutation { + messagingCreateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", + subscribe: ["any"] + ) { + _id + _createdAt + _updatedAt + name + emailTotal + smsTotal + pushTotal + subscribe + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..ee0dee81a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-twilio-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingCreateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", + accountSid: "<ACCOUNT_SID>", + authToken: "<AUTH_TOKEN>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-graphql/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..73604b737 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/create-vonage-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingCreateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", + apiKey: "<API_KEY>", + apiSecret: "<API_SECRET>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/delete-provider.md b/examples/2.0.x/server-graphql/examples/messaging/delete-provider.md new file mode 100644 index 000000000..5c8e46cd8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/delete-provider.md @@ -0,0 +1,9 @@ +```graphql +mutation { + messagingDeleteProvider( + providerId: "<PROVIDER_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-graphql/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..81c5558ad --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/delete-subscriber.md @@ -0,0 +1,10 @@ +```graphql +mutation { + messagingDeleteSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/delete-topic.md b/examples/2.0.x/server-graphql/examples/messaging/delete-topic.md new file mode 100644 index 000000000..c25fe8dea --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/delete-topic.md @@ -0,0 +1,9 @@ +```graphql +mutation { + messagingDeleteTopic( + topicId: "<TOPIC_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/delete.md b/examples/2.0.x/server-graphql/examples/messaging/delete.md new file mode 100644 index 000000000..c7a525be9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + messagingDelete( + messageId: "<MESSAGE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/get-message.md b/examples/2.0.x/server-graphql/examples/messaging/get-message.md new file mode 100644 index 000000000..d899f2e2f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/get-message.md @@ -0,0 +1,21 @@ +```graphql +query { + messagingGetMessage( + messageId: "<MESSAGE_ID>" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/get-provider.md b/examples/2.0.x/server-graphql/examples/messaging/get-provider.md new file mode 100644 index 000000000..531f98fbf --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/get-provider.md @@ -0,0 +1,17 @@ +```graphql +query { + messagingGetProvider( + providerId: "<PROVIDER_ID>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/get-subscriber.md b/examples/2.0.x/server-graphql/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..78d9c8693 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/get-subscriber.md @@ -0,0 +1,28 @@ +```graphql +query { + messagingGetSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" + ) { + _id + _createdAt + _updatedAt + targetId + target { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + userId + userName + topicId + providerType + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/get-topic.md b/examples/2.0.x/server-graphql/examples/messaging/get-topic.md new file mode 100644 index 000000000..a275cc8d3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/get-topic.md @@ -0,0 +1,16 @@ +```graphql +query { + messagingGetTopic( + topicId: "<TOPIC_ID>" + ) { + _id + _createdAt + _updatedAt + name + emailTotal + smsTotal + pushTotal + subscribe + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/list-messages.md b/examples/2.0.x/server-graphql/examples/messaging/list-messages.md new file mode 100644 index 000000000..c7cc2806c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/list-messages.md @@ -0,0 +1,26 @@ +```graphql +query { + messagingListMessages( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + messages { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/list-providers.md b/examples/2.0.x/server-graphql/examples/messaging/list-providers.md new file mode 100644 index 000000000..279564060 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/list-providers.md @@ -0,0 +1,22 @@ +```graphql +query { + messagingListProviders( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + providers { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/list-subscribers.md b/examples/2.0.x/server-graphql/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..13e3e6e8f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/list-subscribers.md @@ -0,0 +1,33 @@ +```graphql +query { + messagingListSubscribers( + topicId: "<TOPIC_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + subscribers { + _id + _createdAt + _updatedAt + targetId + target { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + userId + userName + topicId + providerType + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/list-targets.md b/examples/2.0.x/server-graphql/examples/messaging/list-targets.md new file mode 100644 index 000000000..d3f2886a2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/list-targets.md @@ -0,0 +1,22 @@ +```graphql +query { + messagingListTargets( + messageId: "<MESSAGE_ID>", + queries: [], + total: false + ) { + total + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/list-topics.md b/examples/2.0.x/server-graphql/examples/messaging/list-topics.md new file mode 100644 index 000000000..6d4b72b9c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/list-topics.md @@ -0,0 +1,21 @@ +```graphql +query { + messagingListTopics( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + topics { + _id + _createdAt + _updatedAt + name + emailTotal + smsTotal + pushTotal + subscribe + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..7659ce2bc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-apns-provider.md @@ -0,0 +1,24 @@ +```graphql +mutation { + messagingUpdateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + authKey: "<AUTH_KEY>", + authKeyId: "<AUTH_KEY_ID>", + teamId: "<TEAM_ID>", + bundleId: "<BUNDLE_ID>", + sandbox: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-email.md b/examples/2.0.x/server-graphql/examples/messaging/update-email.md new file mode 100644 index 000000000..28f409bf7 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-email.md @@ -0,0 +1,32 @@ +```graphql +mutation { + messagingUpdateEmail( + messageId: "<MESSAGE_ID>", + topics: [], + users: [], + targets: [], + subject: "<SUBJECT>", + content: "<CONTENT>", + draft: false, + html: false, + cc: [], + bcc: [], + scheduledAt: "2020-10-15T06:38:00.000+00:00", + attachments: [] + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..a2f640717 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-fcm-provider.md @@ -0,0 +1,20 @@ +```graphql +mutation { + messagingUpdateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + serviceAccountJSON: "{}" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..865020575 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,26 @@ +```graphql +mutation { + messagingUpdateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", + domain: "example.com", + isEuRegion: false, + enabled: false, + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "<REPLY_TO_EMAIL>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..433051f58 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingUpdateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + templateId: "<TEMPLATE_ID>", + senderId: "<SENDER_ID>", + authKey: "<AUTH_KEY>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-push.md b/examples/2.0.x/server-graphql/examples/messaging/update-push.md new file mode 100644 index 000000000..6431427d1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-push.md @@ -0,0 +1,39 @@ +```graphql +mutation { + messagingUpdatePush( + messageId: "<MESSAGE_ID>", + topics: [], + users: [], + targets: [], + title: "<TITLE>", + body: "<BODY>", + data: "{}", + action: "<ACTION>", + image: "<ID1:ID2>", + icon: "<ICON>", + sound: "<SOUND>", + color: "<COLOR>", + tag: "<TAG>", + badge: 1, + draft: false, + scheduledAt: "2020-10-15T06:38:00.000+00:00", + contentAvailable: false, + critical: false, + priority: "normal" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..153c0239c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-resend-provider.md @@ -0,0 +1,24 @@ +```graphql +mutation { + messagingUpdateResendProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + apiKey: "<API_KEY>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "<REPLY_TO_EMAIL>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..79b4a5c6f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,24 @@ +```graphql +mutation { + messagingUpdateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + apiKey: "<API_KEY>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "<REPLY_TO_EMAIL>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..c5c519647 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-ses-provider.md @@ -0,0 +1,26 @@ +```graphql +mutation { + messagingUpdateSesProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + accessKey: "<ACCESS_KEY>", + secretKey: "<SECRET_KEY>", + region: "<REGION>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "<REPLY_TO_EMAIL>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-sms.md b/examples/2.0.x/server-graphql/examples/messaging/update-sms.md new file mode 100644 index 000000000..4f02a8256 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-sms.md @@ -0,0 +1,27 @@ +```graphql +mutation { + messagingUpdateSMS( + messageId: "<MESSAGE_ID>", + topics: [], + users: [], + targets: [], + content: "<CONTENT>", + draft: false, + scheduledAt: "2020-10-15T06:38:00.000+00:00" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..fc7d11b77 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-smtp-provider.md @@ -0,0 +1,30 @@ +```graphql +mutation { + messagingUpdateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + host: "<HOST>", + port: 1, + username: "<USERNAME>", + password: "password", + encryption: "none", + autoTLS: false, + mailer: "<MAILER>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "<REPLY_TO_EMAIL>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..d442b6280 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-telesign-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingUpdateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + customerId: "<CUSTOMER_ID>", + apiKey: "<API_KEY>", + from: "<FROM>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..7754889bb --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingUpdateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + username: "<USERNAME>", + apiKey: "<API_KEY>", + from: "<FROM>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-topic.md b/examples/2.0.x/server-graphql/examples/messaging/update-topic.md new file mode 100644 index 000000000..8a9121399 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-topic.md @@ -0,0 +1,18 @@ +```graphql +mutation { + messagingUpdateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", + subscribe: ["any"] + ) { + _id + _createdAt + _updatedAt + name + emailTotal + smsTotal + pushTotal + subscribe + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..3069e78bc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-twilio-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingUpdateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + accountSid: "<ACCOUNT_SID>", + authToken: "<AUTH_TOKEN>", + from: "<FROM>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-graphql/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..0dce8721b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/messaging/update-vonage-provider.md @@ -0,0 +1,22 @@ +```graphql +mutation { + messagingUpdateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + apiKey: "<API_KEY>", + apiSecret: "<API_SECRET>", + from: "<FROM>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/organization/create-project.md b/examples/2.0.x/server-graphql/examples/organization/create-project.md new file mode 100644 index 000000000..f4232e859 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/organization/create-project.md @@ -0,0 +1,56 @@ +```graphql +mutation { + organizationCreateProject( + projectId: "<PROJECT_ID>", + name: "<NAME>", + region: "default" + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/organization/delete-project.md b/examples/2.0.x/server-graphql/examples/organization/delete-project.md new file mode 100644 index 000000000..42e3c1c09 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/organization/delete-project.md @@ -0,0 +1,9 @@ +```graphql +mutation { + organizationDeleteProject( + projectId: "<PROJECT_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/organization/get-project.md b/examples/2.0.x/server-graphql/examples/organization/get-project.md new file mode 100644 index 000000000..2aa523bf3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/organization/get-project.md @@ -0,0 +1,54 @@ +```graphql +query { + organizationGetProject( + projectId: "<PROJECT_ID>" + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/organization/list-projects.md b/examples/2.0.x/server-graphql/examples/organization/list-projects.md new file mode 100644 index 000000000..b584f0c58 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/organization/list-projects.md @@ -0,0 +1,59 @@ +```graphql +query { + organizationListProjects( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + projects { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/organization/update-project.md b/examples/2.0.x/server-graphql/examples/organization/update-project.md new file mode 100644 index 000000000..72a09d44d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/organization/update-project.md @@ -0,0 +1,55 @@ +```graphql +mutation { + organizationUpdateProject( + projectId: "<PROJECT_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/presences/delete.md b/examples/2.0.x/server-graphql/examples/presences/delete.md new file mode 100644 index 000000000..cc8294d0c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/presences/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + presencesDelete( + presenceId: "<PRESENCE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/presences/get.md b/examples/2.0.x/server-graphql/examples/presences/get.md new file mode 100644 index 000000000..c7c9da818 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/presences/get.md @@ -0,0 +1,17 @@ +```graphql +query { + presencesGet( + presenceId: "<PRESENCE_ID>" + ) { + _id + _createdAt + _updatedAt + _permissions + userId + status + source + expiresAt + metadata + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/presences/list.md b/examples/2.0.x/server-graphql/examples/presences/list.md new file mode 100644 index 000000000..ff95bbd1c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/presences/list.md @@ -0,0 +1,22 @@ +```graphql +query { + presencesList( + queries: [], + total: false, + ttl: 0 + ) { + total + presences { + _id + _createdAt + _updatedAt + _permissions + userId + status + source + expiresAt + metadata + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/presences/update.md b/examples/2.0.x/server-graphql/examples/presences/update.md new file mode 100644 index 000000000..880c01694 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/presences/update.md @@ -0,0 +1,23 @@ +```graphql +mutation { + presencesUpdate( + presenceId: "<PRESENCE_ID>", + userId: "<USER_ID>", + status: "<STATUS>", + expiresAt: "2020-10-15T06:38:00.000+00:00", + metadata: "{}", + permissions: ["read(\"any\")"], + purge: false + ) { + _id + _createdAt + _updatedAt + _permissions + userId + status + source + expiresAt + metadata + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/presences/upsert.md b/examples/2.0.x/server-graphql/examples/presences/upsert.md new file mode 100644 index 000000000..d103565b3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/presences/upsert.md @@ -0,0 +1,22 @@ +```graphql +mutation { + presencesUpsert( + presenceId: "<PRESENCE_ID>", + userId: "<USER_ID>", + status: "<STATUS>", + permissions: ["read(\"any\")"], + expiresAt: "2020-10-15T06:38:00.000+00:00", + metadata: "{}" + ) { + _id + _createdAt + _updatedAt + _permissions + userId + status + source + expiresAt + metadata + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-android-platform.md b/examples/2.0.x/server-graphql/examples/project/create-android-platform.md new file mode 100644 index 000000000..1f53067c1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-android-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectCreateAndroidPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + applicationId: "<APPLICATION_ID>" + ) { + _id + _createdAt + _updatedAt + name + type + applicationId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-apple-platform.md b/examples/2.0.x/server-graphql/examples/project/create-apple-platform.md new file mode 100644 index 000000000..f1afeae02 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-apple-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectCreateApplePlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + bundleIdentifier: "<BUNDLE_IDENTIFIER>" + ) { + _id + _createdAt + _updatedAt + name + type + bundleIdentifier + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-graphql/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..c4b996d3d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-ephemeral-key.md @@ -0,0 +1,18 @@ +```graphql +mutation { + projectCreateEphemeralKey( + scopes: [], + duration: 600 + ) { + _id + _createdAt + _updatedAt + name + expire + scopes + secret + accessedAt + sdks + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-linux-platform.md b/examples/2.0.x/server-graphql/examples/project/create-linux-platform.md new file mode 100644 index 000000000..045381c30 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-linux-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectCreateLinuxPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageName: "<PACKAGE_NAME>" + ) { + _id + _createdAt + _updatedAt + name + type + packageName + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-mock-phone.md b/examples/2.0.x/server-graphql/examples/project/create-mock-phone.md new file mode 100644 index 000000000..4c46c01bd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-mock-phone.md @@ -0,0 +1,13 @@ +```graphql +mutation { + projectCreateMockPhone( + number: "+12065550100", + otp: "<OTP>" + ) { + number + otp + _createdAt + _updatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-smtp-test.md b/examples/2.0.x/server-graphql/examples/project/create-smtp-test.md new file mode 100644 index 000000000..2640b7658 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-smtp-test.md @@ -0,0 +1,9 @@ +```graphql +mutation { + projectCreateSMTPTest( + emails: [] + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-variable.md b/examples/2.0.x/server-graphql/examples/project/create-variable.md new file mode 100644 index 000000000..feffcdada --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-variable.md @@ -0,0 +1,19 @@ +```graphql +mutation { + projectCreateVariable( + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-web-platform.md b/examples/2.0.x/server-graphql/examples/project/create-web-platform.md new file mode 100644 index 000000000..9e5030ea8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-web-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectCreateWebPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + hostname: "app.example.com" + ) { + _id + _createdAt + _updatedAt + name + type + hostname + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/create-windows-platform.md b/examples/2.0.x/server-graphql/examples/project/create-windows-platform.md new file mode 100644 index 000000000..2f58d6a1f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/create-windows-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectCreateWindowsPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageIdentifierName: "<PACKAGE_IDENTIFIER_NAME>" + ) { + _id + _createdAt + _updatedAt + name + type + packageIdentifierName + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/delete-key.md b/examples/2.0.x/server-graphql/examples/project/delete-key.md new file mode 100644 index 000000000..fe9464f49 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/delete-key.md @@ -0,0 +1,9 @@ +```graphql +mutation { + projectDeleteKey( + keyId: "<KEY_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/delete-mock-phone.md b/examples/2.0.x/server-graphql/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..0626a7d3c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/delete-mock-phone.md @@ -0,0 +1,9 @@ +```graphql +mutation { + projectDeleteMockPhone( + number: "+12065550100" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/delete-platform.md b/examples/2.0.x/server-graphql/examples/project/delete-platform.md new file mode 100644 index 000000000..12c015007 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/delete-platform.md @@ -0,0 +1,9 @@ +```graphql +mutation { + projectDeletePlatform( + platformId: "<PLATFORM_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/delete-variable.md b/examples/2.0.x/server-graphql/examples/project/delete-variable.md new file mode 100644 index 000000000..c210d2309 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/delete-variable.md @@ -0,0 +1,9 @@ +```graphql +mutation { + projectDeleteVariable( + variableId: "<VARIABLE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/delete.md b/examples/2.0.x/server-graphql/examples/project/delete.md new file mode 100644 index 000000000..aae98b628 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/delete.md @@ -0,0 +1,7 @@ +```graphql +mutation { + projectDelete { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/get-email-template.md b/examples/2.0.x/server-graphql/examples/project/get-email-template.md new file mode 100644 index 000000000..2030912c3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/get-email-template.md @@ -0,0 +1,17 @@ +```graphql +query { + projectGetEmailTemplate( + templateId: "verification", + locale: "af" + ) { + templateId + locale + message + senderName + senderEmail + replyToEmail + replyToName + subject + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/get-key.md b/examples/2.0.x/server-graphql/examples/project/get-key.md new file mode 100644 index 000000000..04f990ebc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/get-key.md @@ -0,0 +1,17 @@ +```graphql +query { + projectGetKey( + keyId: "<KEY_ID>" + ) { + _id + _createdAt + _updatedAt + name + expire + scopes + secret + accessedAt + sdks + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/get-mock-phone.md b/examples/2.0.x/server-graphql/examples/project/get-mock-phone.md new file mode 100644 index 000000000..9110f327c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/get-mock-phone.md @@ -0,0 +1,12 @@ +```graphql +query { + projectGetMockPhone( + number: "+12065550100" + ) { + number + otp + _createdAt + _updatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-graphql/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..5e49dccd6 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,12 @@ +```graphql +query { + projectGetOAuth2Provider( + providerId: "amazon" + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/get-platform.md b/examples/2.0.x/server-graphql/examples/project/get-platform.md new file mode 100644 index 000000000..bcb956cbd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/get-platform.md @@ -0,0 +1,14 @@ +```graphql +query { + projectGetPlatform( + platformId: "<PLATFORM_ID>" + ) { + _id + _createdAt + _updatedAt + name + type + hostname + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/get-policy.md b/examples/2.0.x/server-graphql/examples/project/get-policy.md new file mode 100644 index 000000000..ed8e29654 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/get-policy.md @@ -0,0 +1,10 @@ +```graphql +query { + projectGetPolicy( + policyId: "password-dictionary" + ) { + _id + enabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/get-variable.md b/examples/2.0.x/server-graphql/examples/project/get-variable.md new file mode 100644 index 000000000..7455044ef --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/get-variable.md @@ -0,0 +1,16 @@ +```graphql +query { + projectGetVariable( + variableId: "<VARIABLE_ID>" + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/get.md b/examples/2.0.x/server-graphql/examples/project/get.md new file mode 100644 index 000000000..8b1fb6bd4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/get.md @@ -0,0 +1,52 @@ +```graphql +query { + projectGet { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/list-email-templates.md b/examples/2.0.x/server-graphql/examples/project/list-email-templates.md new file mode 100644 index 000000000..637f3206d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/list-email-templates.md @@ -0,0 +1,20 @@ +```graphql +query { + projectListEmailTemplates( + queries: [], + total: false + ) { + total + templates { + templateId + locale + message + senderName + senderEmail + replyToEmail + replyToName + subject + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/list-keys.md b/examples/2.0.x/server-graphql/examples/project/list-keys.md new file mode 100644 index 000000000..d23c0804e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/list-keys.md @@ -0,0 +1,21 @@ +```graphql +query { + projectListKeys( + queries: [], + total: false + ) { + total + keys { + _id + _createdAt + _updatedAt + name + expire + scopes + secret + accessedAt + sdks + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/list-mock-phones.md b/examples/2.0.x/server-graphql/examples/project/list-mock-phones.md new file mode 100644 index 000000000..8ce0c6f36 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/list-mock-phones.md @@ -0,0 +1,16 @@ +```graphql +query { + projectListMockPhones( + queries: [], + total: false + ) { + total + mockNumbers { + number + otp + _createdAt + _updatedAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-graphql/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..666bbd8af --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,11 @@ +```graphql +query { + projectListOAuth2Providers( + queries: [], + total: false + ) { + total + providers + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/list-platforms.md b/examples/2.0.x/server-graphql/examples/project/list-platforms.md new file mode 100644 index 000000000..6e5ba0f23 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/list-platforms.md @@ -0,0 +1,11 @@ +```graphql +query { + projectListPlatforms( + queries: [], + total: false + ) { + total + platforms + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/list-policies.md b/examples/2.0.x/server-graphql/examples/project/list-policies.md new file mode 100644 index 000000000..e0590c3e5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/list-policies.md @@ -0,0 +1,11 @@ +```graphql +query { + projectListPolicies( + queries: [], + total: false + ) { + total + policies + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/list-variables.md b/examples/2.0.x/server-graphql/examples/project/list-variables.md new file mode 100644 index 000000000..a4c950a8f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/list-variables.md @@ -0,0 +1,20 @@ +```graphql +query { + projectListVariables( + queries: [], + total: false + ) { + total + variables { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-android-platform.md b/examples/2.0.x/server-graphql/examples/project/update-android-platform.md new file mode 100644 index 000000000..0b33ee8b1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-android-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateAndroidPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + applicationId: "<APPLICATION_ID>" + ) { + _id + _createdAt + _updatedAt + name + type + applicationId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-apple-platform.md b/examples/2.0.x/server-graphql/examples/project/update-apple-platform.md new file mode 100644 index 000000000..53e2cf536 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-apple-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateApplePlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + bundleIdentifier: "<BUNDLE_IDENTIFIER>" + ) { + _id + _createdAt + _updatedAt + name + type + bundleIdentifier + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-auth-method.md b/examples/2.0.x/server-graphql/examples/project/update-auth-method.md new file mode 100644 index 000000000..10e2d8268 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-auth-method.md @@ -0,0 +1,55 @@ +```graphql +mutation { + projectUpdateAuthMethod( + methodId: "email-password", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-email-template.md b/examples/2.0.x/server-graphql/examples/project/update-email-template.md new file mode 100644 index 000000000..cbb98d86b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-email-template.md @@ -0,0 +1,23 @@ +```graphql +mutation { + projectUpdateEmailTemplate( + templateId: "verification", + locale: "af", + subject: "<SUBJECT>", + message: "<MESSAGE>", + senderName: "<SENDER_NAME>", + senderEmail: "email@example.com", + replyToEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>" + ) { + templateId + locale + message + senderName + senderEmail + replyToEmail + replyToName + subject + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-key.md b/examples/2.0.x/server-graphql/examples/project/update-key.md new file mode 100644 index 000000000..a981941eb --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-key.md @@ -0,0 +1,20 @@ +```graphql +mutation { + projectUpdateKey( + keyId: "<KEY_ID>", + name: "<NAME>", + scopes: [], + expire: "2020-10-15T06:38:00.000+00:00" + ) { + _id + _createdAt + _updatedAt + name + expire + scopes + secret + accessedAt + sdks + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-labels.md b/examples/2.0.x/server-graphql/examples/project/update-labels.md new file mode 100644 index 000000000..a53a484b3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-labels.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdateLabels( + labels: [] + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-linux-platform.md b/examples/2.0.x/server-graphql/examples/project/update-linux-platform.md new file mode 100644 index 000000000..141398304 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-linux-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateLinuxPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageName: "<PACKAGE_NAME>" + ) { + _id + _createdAt + _updatedAt + name + type + packageName + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-graphql/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..fb826b4f5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,59 @@ +```graphql +mutation { + projectUpdateMembershipPrivacyPolicy( + userId: false, + userEmail: false, + userPhone: false, + userName: false, + userMFA: false, + userAccessedAt: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-graphql/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..d2d930f84 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,57 @@ +```graphql +mutation { + projectUpdateMFAFactorsPolicy( + totp: false, + email: false, + phone: false, + custom: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-mock-phone.md b/examples/2.0.x/server-graphql/examples/project/update-mock-phone.md new file mode 100644 index 000000000..4194a6bb2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-mock-phone.md @@ -0,0 +1,13 @@ +```graphql +mutation { + projectUpdateMockPhone( + number: "+12065550100", + otp: "<OTP>" + ) { + number + otp + _createdAt + _updatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..96cfe2796 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Amazon( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..3d9c6f1a9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,18 @@ +```graphql +mutation { + projectUpdateOAuth2Apple( + serviceId: "<SERVICE_ID>", + keyId: "<KEY_ID>", + teamId: "<TEAM_ID>", + p8File: "<P8_FILE>", + enabled: false + ) { + _id + enabled + serviceId + keyId + teamId + p8File + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..672a878b9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Appwrite( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..746d0517f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateOAuth2Auth0( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + endpoint: "<ENDPOINT>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + endpoint + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..bee04673c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateOAuth2Authentik( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + endpoint: "<ENDPOINT>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + endpoint + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..d238ce1a0 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Autodesk( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..41139c2e1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Bitbucket( + key: "<KEY>", + secret: "<SECRET>", + enabled: false + ) { + _id + enabled + key + secret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..72c7707a1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Bitly( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..faa83fc35 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-box.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Box( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..9054192c6 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Cloudflare( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..dad14b649 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Dailymotion( + apiKey: "<API_KEY>", + apiSecret: "<API_SECRET>", + enabled: false + ) { + _id + enabled + apiKey + apiSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..0b3ed71c6 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Discord( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..34890edfa --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Disqus( + publicKey: "<PUBLIC_KEY>", + secretKey: "<SECRET_KEY>", + enabled: false + ) { + _id + enabled + publicKey + secretKey + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..1a78a1ffd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Dropbox( + appKey: "<APP_KEY>", + appSecret: "<APP_SECRET>", + enabled: false + ) { + _id + enabled + appKey + appSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..70ca5c82f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Etsy( + keyString: "<KEY_STRING>", + sharedSecret: "<SHARED_SECRET>", + enabled: false + ) { + _id + enabled + keyString + sharedSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..e282290d1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Facebook( + appId: "<APP_ID>", + appSecret: "<APP_SECRET>", + enabled: false + ) { + _id + enabled + appId + appSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..17d332abc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Figma( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..e7447d1c8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateOAuth2FusionAuth( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + endpoint: "<ENDPOINT>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + endpoint + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..f5a3880bd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2GitHub( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..7ff242b8e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateOAuth2Gitlab( + applicationId: "<APPLICATION_ID>", + secret: "<SECRET>", + endpoint: "https://example.com", + enabled: false + ) { + _id + enabled + applicationId + secret + endpoint + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..35e74ee9f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-google.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateOAuth2Google( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + prompt: [], + enabled: false + ) { + _id + enabled + clientId + clientSecret + prompt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..67f2e02ca --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2HuggingFace( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..881cb1d5c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,18 @@ +```graphql +mutation { + projectUpdateOAuth2Keycloak( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + endpoint: "<ENDPOINT>", + realmName: "<REALM_NAME>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + endpoint + realmName + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..09d6779e1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Kick( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..50f56f116 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Linkedin( + clientId: "<CLIENT_ID>", + primaryClientSecret: "<PRIMARY_CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + primaryClientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..b80848c01 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateOAuth2Microsoft( + applicationId: "<APPLICATION_ID>", + applicationSecret: "<APPLICATION_SECRET>", + tenant: "<TENANT>", + enabled: false + ) { + _id + enabled + applicationId + applicationSecret + tenant + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..be481aecd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Notion( + oauthClientId: "<OAUTH_CLIENT_ID>", + oauthClientSecret: "<OAUTH_CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + oauthClientId + oauthClientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..ddbd12084 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,26 @@ +```graphql +mutation { + projectUpdateOAuth2Oidc( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + wellKnownURL: "https://example.com", + authorizationURL: "https://example.com", + tokenURL: "https://example.com", + userInfoURL: "https://example.com", + prompt: [], + maxAge: 0, + enabled: false + ) { + _id + enabled + clientId + clientSecret + wellKnownURL + authorizationURL + tokenURL + userInfoURL + prompt + maxAge + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..5075b3f27 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,18 @@ +```graphql +mutation { + projectUpdateOAuth2Okta( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + domain: "example.com", + authorizationServerId: "<AUTHORIZATION_SERVER_ID>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + domain + authorizationServerId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..9d22e49be --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2PaypalSandbox( + clientId: "<CLIENT_ID>", + secretKey: "<SECRET_KEY>", + enabled: false + ) { + _id + enabled + clientId + secretKey + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..d106a4ddb --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Paypal( + clientId: "<CLIENT_ID>", + secretKey: "<SECRET_KEY>", + enabled: false + ) { + _id + enabled + clientId + secretKey + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..41847a43f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Podio( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..f81474a91 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Resend( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..ab63ff525 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Salesforce( + customerKey: "<CUSTOMER_KEY>", + customerSecret: "<CUSTOMER_SECRET>", + enabled: false + ) { + _id + enabled + customerKey + customerSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..cdee16942 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Slack( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..cd0b342ae --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Spotify( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..c34176870 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Stripe( + clientId: "<CLIENT_ID>", + apiSecretKey: "<API_SECRET_KEY>", + enabled: false + ) { + _id + enabled + clientId + apiSecretKey + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..6bcf5dc9b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2TradeshiftSandbox( + oauth2ClientId: "<OAUTH2_CLIENT_ID>", + oauth2ClientSecret: "<OAUTH2_CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + oauth2ClientId + oauth2ClientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..dda26edc9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Tradeshift( + oauth2ClientId: "<OAUTH2_CLIENT_ID>", + oauth2ClientSecret: "<OAUTH2_CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + oauth2ClientId + oauth2ClientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..60893d37a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Twitch( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..2c1a90d4b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2WordPress( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..0cebeb3bb --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Yahoo( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..e26e2c344 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Yandex( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..b71bd18d5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Zoho( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..3ef225a46 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2Zoom( + clientId: "<CLIENT_ID>", + clientSecret: "<CLIENT_SECRET>", + enabled: false + ) { + _id + enabled + clientId + clientSecret + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..79bb52c9a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-o-auth-2x.md @@ -0,0 +1,14 @@ +```graphql +mutation { + projectUpdateOAuth2X( + customerKey: "<CUSTOMER_KEY>", + secretKey: "<SECRET_KEY>", + enabled: false + ) { + _id + enabled + customerKey + secretKey + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-graphql/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..68f675d63 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdatePasswordDictionaryPolicy( + enabled: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-password-history-policy.md b/examples/2.0.x/server-graphql/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..6b4c7ad35 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-password-history-policy.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdatePasswordHistoryPolicy( + total: 1 + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-graphql/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..5fbdcb318 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdatePasswordPersonalDataPolicy( + enabled: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-graphql/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..8ae09a725 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-password-strength-policy.md @@ -0,0 +1,18 @@ +```graphql +mutation { + projectUpdatePasswordStrengthPolicy( + min: 8, + uppercase: false, + lowercase: false, + number: false, + symbols: false + ) { + _id + min + uppercase + lowercase + number + symbols + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-protocol.md b/examples/2.0.x/server-graphql/examples/project/update-protocol.md new file mode 100644 index 000000000..a32150e54 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-protocol.md @@ -0,0 +1,55 @@ +```graphql +mutation { + projectUpdateProtocol( + protocolId: "rest", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-service.md b/examples/2.0.x/server-graphql/examples/project/update-service.md new file mode 100644 index 000000000..f9a0b7406 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-service.md @@ -0,0 +1,55 @@ +```graphql +mutation { + projectUpdateService( + serviceId: "account", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-graphql/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..91e501e59 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-session-alert-policy.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdateSessionAlertPolicy( + enabled: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-graphql/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..93fccfefb --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-session-duration-policy.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdateSessionDurationPolicy( + duration: 60 + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-graphql/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..863a2752e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdateSessionInvalidationPolicy( + enabled: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-graphql/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..0c434782d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-session-limit-policy.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdateSessionLimitPolicy( + total: 1 + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-smtp.md b/examples/2.0.x/server-graphql/examples/project/update-smtp.md new file mode 100644 index 000000000..2bc61eb45 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-smtp.md @@ -0,0 +1,63 @@ +```graphql +mutation { + projectUpdateSMTP( + host: "example.com", + port: 587, + username: "<USERNAME>", + password: "password", + senderEmail: "email@example.com", + senderName: "<SENDER_NAME>", + replyToEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + secure: "tls", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-graphql/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..66b1ddc47 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-user-limit-policy.md @@ -0,0 +1,54 @@ +```graphql +mutation { + projectUpdateUserLimitPolicy( + total: 0 + ) { + _id + _createdAt + _updatedAt + name + teamId + region + devKeys { + _id + _createdAt + _updatedAt + name + expire + secret + accessedAt + sdks + } + smtpEnabled + smtpSenderName + smtpSenderEmail + smtpReplyToName + smtpReplyToEmail + smtpHost + smtpPort + smtpUsername + smtpPassword + smtpSecure + pingCount + pingedAt + labels + status + onboarding + authMethods { + _id + enabled + } + services { + _id + enabled + } + protocols { + _id + enabled + } + blocks + consoleAccessedAt + wafEnabled + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-variable.md b/examples/2.0.x/server-graphql/examples/project/update-variable.md new file mode 100644 index 000000000..aed16928b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-variable.md @@ -0,0 +1,19 @@ +```graphql +mutation { + projectUpdateVariable( + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-web-platform.md b/examples/2.0.x/server-graphql/examples/project/update-web-platform.md new file mode 100644 index 000000000..afca13f00 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-web-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateWebPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + hostname: "app.example.com" + ) { + _id + _createdAt + _updatedAt + name + type + hostname + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/project/update-windows-platform.md b/examples/2.0.x/server-graphql/examples/project/update-windows-platform.md new file mode 100644 index 000000000..f0142c5bb --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/project/update-windows-platform.md @@ -0,0 +1,16 @@ +```graphql +mutation { + projectUpdateWindowsPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageIdentifierName: "<PACKAGE_IDENTIFIER_NAME>" + ) { + _id + _createdAt + _updatedAt + name + type + packageIdentifierName + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/proxy/create-api-rule.md b/examples/2.0.x/server-graphql/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..edce1a59d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/proxy/create-api-rule.md @@ -0,0 +1,23 @@ +```graphql +mutation { + proxyCreateAPIRule( + domain: "example.com" + ) { + _id + _createdAt + _updatedAt + domain + type + trigger + redirectUrl + redirectStatusCode + deploymentId + deploymentResourceType + deploymentResourceId + deploymentVcsProviderBranch + status + logs + renewAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/proxy/create-function-rule.md b/examples/2.0.x/server-graphql/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..00a2bdcce --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/proxy/create-function-rule.md @@ -0,0 +1,25 @@ +```graphql +mutation { + proxyCreateFunctionRule( + domain: "example.com", + functionId: "<FUNCTION_ID>", + branch: "<BRANCH>" + ) { + _id + _createdAt + _updatedAt + domain + type + trigger + redirectUrl + redirectStatusCode + deploymentId + deploymentResourceType + deploymentResourceId + deploymentVcsProviderBranch + status + logs + renewAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-graphql/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..1db10bffd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/proxy/create-redirect-rule.md @@ -0,0 +1,27 @@ +```graphql +mutation { + proxyCreateRedirectRule( + domain: "example.com", + url: "https://example.com", + statusCode: "301", + resourceId: "<RESOURCE_ID>", + resourceType: "site" + ) { + _id + _createdAt + _updatedAt + domain + type + trigger + redirectUrl + redirectStatusCode + deploymentId + deploymentResourceType + deploymentResourceId + deploymentVcsProviderBranch + status + logs + renewAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/proxy/create-site-rule.md b/examples/2.0.x/server-graphql/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..029ebb327 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/proxy/create-site-rule.md @@ -0,0 +1,25 @@ +```graphql +mutation { + proxyCreateSiteRule( + domain: "example.com", + siteId: "<SITE_ID>", + branch: "<BRANCH>" + ) { + _id + _createdAt + _updatedAt + domain + type + trigger + redirectUrl + redirectStatusCode + deploymentId + deploymentResourceType + deploymentResourceId + deploymentVcsProviderBranch + status + logs + renewAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/proxy/delete-rule.md b/examples/2.0.x/server-graphql/examples/proxy/delete-rule.md new file mode 100644 index 000000000..08780bf47 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/proxy/delete-rule.md @@ -0,0 +1,9 @@ +```graphql +mutation { + proxyDeleteRule( + ruleId: "<RULE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/proxy/get-rule.md b/examples/2.0.x/server-graphql/examples/proxy/get-rule.md new file mode 100644 index 000000000..2e921ebbd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/proxy/get-rule.md @@ -0,0 +1,23 @@ +```graphql +query { + proxyGetRule( + ruleId: "<RULE_ID>" + ) { + _id + _createdAt + _updatedAt + domain + type + trigger + redirectUrl + redirectStatusCode + deploymentId + deploymentResourceType + deploymentResourceId + deploymentVcsProviderBranch + status + logs + renewAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/proxy/list-rules.md b/examples/2.0.x/server-graphql/examples/proxy/list-rules.md new file mode 100644 index 000000000..984f3e8db --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/proxy/list-rules.md @@ -0,0 +1,27 @@ +```graphql +query { + proxyListRules( + queries: [], + total: false + ) { + total + rules { + _id + _createdAt + _updatedAt + domain + type + trigger + redirectUrl + redirectStatusCode + deploymentId + deploymentResourceType + deploymentResourceId + deploymentVcsProviderBranch + status + logs + renewAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/proxy/update-rule-status.md b/examples/2.0.x/server-graphql/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..dd9fbf67e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/proxy/update-rule-status.md @@ -0,0 +1,23 @@ +```graphql +mutation { + proxyUpdateRuleStatus( + ruleId: "<RULE_ID>" + ) { + _id + _createdAt + _updatedAt + domain + type + trigger + redirectUrl + redirectStatusCode + deploymentId + deploymentResourceType + deploymentResourceId + deploymentVcsProviderBranch + status + logs + renewAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/create-deployment.md b/examples/2.0.x/server-graphql/examples/sites/create-deployment.md new file mode 100644 index 000000000..244f9337a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/create-deployment.md @@ -0,0 +1,26 @@ +```graphql +POST /v1/sites/{siteId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { sitesCreateDeployment(siteId: $siteId, code: $code, installCommand: $installCommand, buildCommand: $buildCommand, outputDirectory: $outputDirectory, activate: $activate) { id }" }, "variables": { "siteId": "<SITE_ID>", "code": null, "installCommand": "<INSTALL_COMMAND>", "buildCommand": "<BUILD_COMMAND>", "outputDirectory": "<OUTPUT_DIRECTORY>", "activate": false } } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="map" + +{ "0": ["variables.code"], } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="0"; filename="code.ext" + +File contents + +--cec8e8123c05ba25-- +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-graphql/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..598ed8c4a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,36 @@ +```graphql +mutation { + sitesCreateDuplicateDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/create-template-deployment.md b/examples/2.0.x/server-graphql/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..8c449e086 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/create-template-deployment.md @@ -0,0 +1,41 @@ +```graphql +mutation { + sitesCreateTemplateDeployment( + siteId: "<SITE_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + type: "branch", + reference: "<REFERENCE>", + activate: false + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/create-variable.md b/examples/2.0.x/server-graphql/examples/sites/create-variable.md new file mode 100644 index 000000000..6c66d109d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/create-variable.md @@ -0,0 +1,20 @@ +```graphql +mutation { + sitesCreateVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-graphql/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..ef9b8aeb2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/create-vcs-deployment.md @@ -0,0 +1,38 @@ +```graphql +mutation { + sitesCreateVcsDeployment( + siteId: "<SITE_ID>", + type: "branch", + reference: "<REFERENCE>", + activate: false + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/create.md b/examples/2.0.x/server-graphql/examples/sites/create.md new file mode 100644 index 000000000..538d4848a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/create.md @@ -0,0 +1,75 @@ +```graphql +mutation { + sitesCreate( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: "analog", + buildRuntime: "node-14.5", + enabled: false, + logging: false, + timeout: 1, + installCommand: "<INSTALL_COMMAND>", + buildCommand: "<BUILD_COMMAND>", + startCommand: "<START_COMMAND>", + outputDirectory: "<OUTPUT_DIRECTORY>", + adapter: "static", + installationId: "<INSTALLATION_ID>", + fallbackFile: "<FALLBACK_FILE>", + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", + providerBranch: "<PROVIDER_BRANCH>", + providerSilentMode: false, + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", + providerBranches: [], + providerPaths: [], + buildSpecification: "s-1vcpu-512mb", + runtimeSpecification: "s-1vcpu-512mb", + deploymentRetention: 0, + scopes: [] + ) { + _id + _createdAt + _updatedAt + name + enabled + live + logging + framework + deploymentRetention + deploymentId + deploymentCreatedAt + deploymentScreenshotLight + deploymentScreenshotDark + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + timeout + installCommand + buildCommand + startCommand + outputDirectory + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + buildRuntime + adapter + fallbackFile + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/delete-deployment.md b/examples/2.0.x/server-graphql/examples/sites/delete-deployment.md new file mode 100644 index 000000000..cc7ed0d0d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/delete-deployment.md @@ -0,0 +1,10 @@ +```graphql +mutation { + sitesDeleteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/delete-log.md b/examples/2.0.x/server-graphql/examples/sites/delete-log.md new file mode 100644 index 000000000..b10099edc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/delete-log.md @@ -0,0 +1,10 @@ +```graphql +mutation { + sitesDeleteLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/delete-variable.md b/examples/2.0.x/server-graphql/examples/sites/delete-variable.md new file mode 100644 index 000000000..39d44d871 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/delete-variable.md @@ -0,0 +1,10 @@ +```graphql +mutation { + sitesDeleteVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/delete.md b/examples/2.0.x/server-graphql/examples/sites/delete.md new file mode 100644 index 000000000..3be9a17ba --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + sitesDelete( + siteId: "<SITE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/get-deployment-download.md b/examples/2.0.x/server-graphql/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..df3ee5dd8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/get-deployment-download.md @@ -0,0 +1,12 @@ +```graphql +query { + sitesGetDeploymentDownload( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: "source", + token: "<TOKEN>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/get-deployment.md b/examples/2.0.x/server-graphql/examples/sites/get-deployment.md new file mode 100644 index 000000000..1a05a08fa --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/get-deployment.md @@ -0,0 +1,36 @@ +```graphql +query { + sitesGetDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/get-log.md b/examples/2.0.x/server-graphql/examples/sites/get-log.md new file mode 100644 index 000000000..0b67f34e3 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/get-log.md @@ -0,0 +1,34 @@ +```graphql +query { + sitesGetLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" + ) { + _id + _createdAt + _updatedAt + _permissions + resourceId + resourceType + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/get-variable.md b/examples/2.0.x/server-graphql/examples/sites/get-variable.md new file mode 100644 index 000000000..bb8500f84 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/get-variable.md @@ -0,0 +1,17 @@ +```graphql +query { + sitesGetVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/get.md b/examples/2.0.x/server-graphql/examples/sites/get.md new file mode 100644 index 000000000..79085fd76 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/get.md @@ -0,0 +1,52 @@ +```graphql +query { + sitesGet( + siteId: "<SITE_ID>" + ) { + _id + _createdAt + _updatedAt + name + enabled + live + logging + framework + deploymentRetention + deploymentId + deploymentCreatedAt + deploymentScreenshotLight + deploymentScreenshotDark + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + timeout + installCommand + buildCommand + startCommand + outputDirectory + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + buildRuntime + adapter + fallbackFile + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/list-deployments.md b/examples/2.0.x/server-graphql/examples/sites/list-deployments.md new file mode 100644 index 000000000..385bff80d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/list-deployments.md @@ -0,0 +1,41 @@ +```graphql +query { + sitesListDeployments( + siteId: "<SITE_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + deployments { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/list-frameworks.md b/examples/2.0.x/server-graphql/examples/sites/list-frameworks.md new file mode 100644 index 000000000..1faf1fd83 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/list-frameworks.md @@ -0,0 +1,20 @@ +```graphql +query { + sitesListFrameworks { + total + frameworks { + key + name + buildRuntime + runtimes + adapters { + key + installCommand + buildCommand + outputDirectory + fallbackFile + } + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/list-logs.md b/examples/2.0.x/server-graphql/examples/sites/list-logs.md new file mode 100644 index 000000000..8fe1de05f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/list-logs.md @@ -0,0 +1,38 @@ +```graphql +query { + sitesListLogs( + siteId: "<SITE_ID>", + queries: [], + total: false + ) { + total + executions { + _id + _createdAt + _updatedAt + _permissions + resourceId + resourceType + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/list-specifications.md b/examples/2.0.x/server-graphql/examples/sites/list-specifications.md new file mode 100644 index 000000000..db5395067 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/list-specifications.md @@ -0,0 +1,15 @@ +```graphql +query { + sitesListSpecifications( + type: "runtimes" + ) { + total + specifications { + memory + cpus + enabled + slug + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/list-variables.md b/examples/2.0.x/server-graphql/examples/sites/list-variables.md new file mode 100644 index 000000000..dddd1ae55 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/list-variables.md @@ -0,0 +1,21 @@ +```graphql +query { + sitesListVariables( + siteId: "<SITE_ID>", + queries: [], + total: false + ) { + total + variables { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/list.md b/examples/2.0.x/server-graphql/examples/sites/list.md new file mode 100644 index 000000000..c4be4dbee --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/list.md @@ -0,0 +1,57 @@ +```graphql +query { + sitesList( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + sites { + _id + _createdAt + _updatedAt + name + enabled + live + logging + framework + deploymentRetention + deploymentId + deploymentCreatedAt + deploymentScreenshotLight + deploymentScreenshotDark + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + timeout + installCommand + buildCommand + startCommand + outputDirectory + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + buildRuntime + adapter + fallbackFile + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/update-deployment-status.md b/examples/2.0.x/server-graphql/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..4bb5c5977 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/update-deployment-status.md @@ -0,0 +1,36 @@ +```graphql +mutation { + sitesUpdateDeploymentStatus( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/update-site-deployment.md b/examples/2.0.x/server-graphql/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..615f71dbc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/update-site-deployment.md @@ -0,0 +1,53 @@ +```graphql +mutation { + sitesUpdateSiteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + name + enabled + live + logging + framework + deploymentRetention + deploymentId + deploymentCreatedAt + deploymentScreenshotLight + deploymentScreenshotDark + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + timeout + installCommand + buildCommand + startCommand + outputDirectory + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + buildRuntime + adapter + fallbackFile + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/update-variable.md b/examples/2.0.x/server-graphql/examples/sites/update-variable.md new file mode 100644 index 000000000..05a8a186c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/update-variable.md @@ -0,0 +1,20 @@ +```graphql +mutation { + sitesUpdateVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/sites/update.md b/examples/2.0.x/server-graphql/examples/sites/update.md new file mode 100644 index 000000000..09b477905 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/sites/update.md @@ -0,0 +1,75 @@ +```graphql +mutation { + sitesUpdate( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: "analog", + enabled: false, + logging: false, + timeout: 1, + installCommand: "<INSTALL_COMMAND>", + buildCommand: "<BUILD_COMMAND>", + startCommand: "<START_COMMAND>", + outputDirectory: "<OUTPUT_DIRECTORY>", + buildRuntime: "node-14.5", + adapter: "static", + fallbackFile: "<FALLBACK_FILE>", + installationId: "<INSTALLATION_ID>", + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", + providerBranch: "<PROVIDER_BRANCH>", + providerSilentMode: false, + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", + providerBranches: [], + providerPaths: [], + buildSpecification: "s-1vcpu-512mb", + runtimeSpecification: "s-1vcpu-512mb", + deploymentRetention: 0, + scopes: [] + ) { + _id + _createdAt + _updatedAt + name + enabled + live + logging + framework + deploymentRetention + deploymentId + deploymentCreatedAt + deploymentScreenshotLight + deploymentScreenshotDark + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + timeout + installCommand + buildCommand + startCommand + outputDirectory + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + providerBranches + providerPaths + buildSpecification + runtimeSpecification + buildRuntime + adapter + fallbackFile + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/create-bucket.md b/examples/2.0.x/server-graphql/examples/storage/create-bucket.md new file mode 100644 index 000000000..3b09f3052 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/create-bucket.md @@ -0,0 +1,32 @@ +```graphql +mutation { + storageCreateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"], + fileSecurity: false, + enabled: false, + maximumFileSize: 1, + allowedFileExtensions: [], + compression: "none", + encryption: false, + antivirus: false, + transformations: false + ) { + _id + _createdAt + _updatedAt + _permissions + fileSecurity + name + enabled + maximumFileSize + allowedFileExtensions + compression + encryption + antivirus + transformations + totalSize + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/create-file.md b/examples/2.0.x/server-graphql/examples/storage/create-file.md new file mode 100644 index 000000000..ed33222ed --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/create-file.md @@ -0,0 +1,26 @@ +```graphql +POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file, permissions: $permissions, folder: $folder) { id }" }, "variables": { "bucketId": "<BUCKET_ID>", "fileId": "<FILE_ID>", "file": null, "permissions": ["read(\"any\")"], "folder": "photos/2026" } } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="map" + +{ "0": ["variables.file"], } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="0"; filename="file.ext" + +File contents + +--cec8e8123c05ba25-- +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/delete-bucket.md b/examples/2.0.x/server-graphql/examples/storage/delete-bucket.md new file mode 100644 index 000000000..ac2022e96 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/delete-bucket.md @@ -0,0 +1,9 @@ +```graphql +mutation { + storageDeleteBucket( + bucketId: "<BUCKET_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/delete-file.md b/examples/2.0.x/server-graphql/examples/storage/delete-file.md new file mode 100644 index 000000000..c36fa0e94 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/delete-file.md @@ -0,0 +1,10 @@ +```graphql +mutation { + storageDeleteFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/get-bucket.md b/examples/2.0.x/server-graphql/examples/storage/get-bucket.md new file mode 100644 index 000000000..fe4b523b8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/get-bucket.md @@ -0,0 +1,22 @@ +```graphql +query { + storageGetBucket( + bucketId: "<BUCKET_ID>" + ) { + _id + _createdAt + _updatedAt + _permissions + fileSecurity + name + enabled + maximumFileSize + allowedFileExtensions + compression + encryption + antivirus + transformations + totalSize + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/get-file-download.md b/examples/2.0.x/server-graphql/examples/storage/get-file-download.md new file mode 100644 index 000000000..f323f21e2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/get-file-download.md @@ -0,0 +1,11 @@ +```graphql +query { + storageGetFileDownload( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/get-file-preview.md b/examples/2.0.x/server-graphql/examples/storage/get-file-preview.md new file mode 100644 index 000000000..d4cc5edf0 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/get-file-preview.md @@ -0,0 +1,22 @@ +```graphql +query { + storageGetFilePreview( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + width: 0, + height: 0, + gravity: "center", + quality: -1, + borderWidth: 0, + borderColor: "FFFFFF", + borderRadius: 0, + opacity: 0, + rotation: -360, + background: "FFFFFF", + output: "jpg", + token: "<TOKEN>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/get-file-view.md b/examples/2.0.x/server-graphql/examples/storage/get-file-view.md new file mode 100644 index 000000000..7871a3111 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/get-file-view.md @@ -0,0 +1,11 @@ +```graphql +query { + storageGetFileView( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/get-file.md b/examples/2.0.x/server-graphql/examples/storage/get-file.md new file mode 100644 index 000000000..3bbbfcb4b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/get-file.md @@ -0,0 +1,25 @@ +```graphql +query { + storageGetFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" + ) { + _id + bucketId + _createdAt + _updatedAt + _permissions + name + folder + key + signature + mimeType + sizeOriginal + sizeActual + chunksTotal + chunksUploaded + encryption + compression + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/list-buckets.md b/examples/2.0.x/server-graphql/examples/storage/list-buckets.md new file mode 100644 index 000000000..96d6ed47d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/list-buckets.md @@ -0,0 +1,27 @@ +```graphql +query { + storageListBuckets( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + buckets { + _id + _createdAt + _updatedAt + _permissions + fileSecurity + name + enabled + maximumFileSize + allowedFileExtensions + compression + encryption + antivirus + transformations + totalSize + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/list-files.md b/examples/2.0.x/server-graphql/examples/storage/list-files.md new file mode 100644 index 000000000..974b01a7f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/list-files.md @@ -0,0 +1,30 @@ +```graphql +query { + storageListFiles( + bucketId: "<BUCKET_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + files { + _id + bucketId + _createdAt + _updatedAt + _permissions + name + folder + key + signature + mimeType + sizeOriginal + sizeActual + chunksTotal + chunksUploaded + encryption + compression + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/update-bucket.md b/examples/2.0.x/server-graphql/examples/storage/update-bucket.md new file mode 100644 index 000000000..f94410399 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/update-bucket.md @@ -0,0 +1,32 @@ +```graphql +mutation { + storageUpdateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"], + fileSecurity: false, + enabled: false, + maximumFileSize: 1, + allowedFileExtensions: [], + compression: "none", + encryption: false, + antivirus: false, + transformations: false + ) { + _id + _createdAt + _updatedAt + _permissions + fileSecurity + name + enabled + maximumFileSize + allowedFileExtensions + compression + encryption + antivirus + transformations + totalSize + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/storage/update-file.md b/examples/2.0.x/server-graphql/examples/storage/update-file.md new file mode 100644 index 000000000..ace17f9b1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/storage/update-file.md @@ -0,0 +1,27 @@ +```graphql +mutation { + storageUpdateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"] + ) { + _id + bucketId + _createdAt + _updatedAt + _permissions + name + folder + key + signature + mimeType + sizeOriginal + sizeActual + chunksTotal + chunksUploaded + encryption + compression + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..4ee68a023 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBCreateBigIntColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, + max: 1000000, + default: 0, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..af90411ad --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBCreateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: false, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..5f3dd3eca --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBCreateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..b21198b4c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-email-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBCreateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..ced32697f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-enum-column.md @@ -0,0 +1,25 @@ +```graphql +mutation { + tablesDBCreateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + elements + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..fa884e0c5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-float-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBCreateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, + max: 100, + default: 10.5, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-index.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-index.md new file mode 100644 index 000000000..4edc9f94e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-index.md @@ -0,0 +1,24 @@ +```graphql +mutation { + tablesDBCreateIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + type: "key", + columns: [], + orders: [], + lengths: [] + ) { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..f493946a1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-integer-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBCreateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, + max: 100, + default: 10, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..1e9c768a9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-ip-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBCreateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..c00a3f8cc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-line-column.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBCreateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..8697c6a4e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,24 @@ +```graphql +mutation { + tablesDBCreateLongtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..1eda32371 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,24 @@ +```graphql +mutation { + tablesDBCreateMediumtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-operations.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..f5721ece9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + tablesDBCreateOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..7979dd3d4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-point-column.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBCreatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [1, 2] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..9bb624f91 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBCreatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..ffeb3e2a9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,29 @@ +```graphql +mutation { + tablesDBCreateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + relatedTableId: "<RELATED_TABLE_ID>", + type: "oneToOne", + twoWay: false, + key: "<KEY>", + twoWayKey: "<TWO_WAY_KEY>", + onDelete: "cascade" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + relatedTable + relationType + twoWay + twoWayKey + onDelete + side + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-row.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-row.md new file mode 100644 index 000000000..556147030 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-row.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBCreateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-rows.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..9a93b02fa --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-rows.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBCreateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..802ee084c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-string-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBCreateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-table.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-table.md new file mode 100644 index 000000000..9dd7b9dfa --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-table.md @@ -0,0 +1,38 @@ +```graphql +mutation { + tablesDBCreateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"], + rowSecurity: false, + enabled: false, + columns: [], + indexes: [] + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + rowSecurity + columns + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..cc51eb7bb --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-text-column.md @@ -0,0 +1,24 @@ +```graphql +mutation { + tablesDBCreateTextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..2ecb30310 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + tablesDBCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..c566c358a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-url-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBCreateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..30c7aeb65 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBCreateVarcharColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/create.md b/examples/2.0.x/server-graphql/examples/tablesdb/create.md new file mode 100644 index 000000000..ede718911 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/create.md @@ -0,0 +1,17 @@ +```graphql +mutation { + tablesDBCreate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..203ed56e9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBDecrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "<COLUMN>", + value: 1, + min: 0, + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/delete-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..fc63a8d5b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/delete-column.md @@ -0,0 +1,11 @@ +```graphql +mutation { + tablesDBDeleteColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/delete-index.md b/examples/2.0.x/server-graphql/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..0a7d1c84f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/delete-index.md @@ -0,0 +1,11 @@ +```graphql +mutation { + tablesDBDeleteIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/delete-row.md b/examples/2.0.x/server-graphql/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..0acff213e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/delete-row.md @@ -0,0 +1,12 @@ +```graphql +mutation { + tablesDBDeleteRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + transactionId: "<TRANSACTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-graphql/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..6fa0a40fd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/delete-rows.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBDeleteRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/delete-table.md b/examples/2.0.x/server-graphql/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..a377f661e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/delete-table.md @@ -0,0 +1,10 @@ +```graphql +mutation { + tablesDBDeleteTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-graphql/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..e12bd209a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + tablesDBDeleteTransaction( + transactionId: "<TRANSACTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/delete.md b/examples/2.0.x/server-graphql/examples/tablesdb/delete.md new file mode 100644 index 000000000..066f034a5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + tablesDBDelete( + databaseId: "<DATABASE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/get-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/get-column.md new file mode 100644 index 000000000..510f5b5b5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/get-column.md @@ -0,0 +1,19 @@ +```graphql +query { + tablesDBGetColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/get-index.md b/examples/2.0.x/server-graphql/examples/tablesdb/get-index.md new file mode 100644 index 000000000..b35cc261e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/get-index.md @@ -0,0 +1,20 @@ +```graphql +query { + tablesDBGetIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" + ) { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/get-row.md b/examples/2.0.x/server-graphql/examples/tablesdb/get-row.md new file mode 100644 index 000000000..354f847dc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/get-row.md @@ -0,0 +1,20 @@ +```graphql +query { + tablesDBGetRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/get-table.md b/examples/2.0.x/server-graphql/examples/tablesdb/get-table.md new file mode 100644 index 000000000..284e864d7 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/get-table.md @@ -0,0 +1,32 @@ +```graphql +query { + tablesDBGetTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + rowSecurity + columns + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-graphql/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..0c520f611 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + tablesDBGetTransaction( + transactionId: "<TRANSACTION_ID>" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/get.md b/examples/2.0.x/server-graphql/examples/tablesdb/get.md new file mode 100644 index 000000000..0b14147fe --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/get.md @@ -0,0 +1,15 @@ +```graphql +query { + tablesDBGet( + databaseId: "<DATABASE_ID>" + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..1137e3e4d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/increment-row-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBIncrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "<COLUMN>", + value: 1, + max: 100, + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/list-columns.md b/examples/2.0.x/server-graphql/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..de893f696 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/list-columns.md @@ -0,0 +1,13 @@ +```graphql +query { + tablesDBListColumns( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [], + total: false + ) { + total + columns + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-graphql/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..907ea571d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/list-indexes.md @@ -0,0 +1,24 @@ +```graphql +query { + tablesDBListIndexes( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [], + total: false + ) { + total + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/list-rows.md b/examples/2.0.x/server-graphql/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..6927344f1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/list-rows.md @@ -0,0 +1,24 @@ +```graphql +query { + tablesDBListRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>", + total: false, + ttl: 0 + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/list-tables.md b/examples/2.0.x/server-graphql/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..7c10afcfd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/list-tables.md @@ -0,0 +1,37 @@ +```graphql +query { + tablesDBListTables( + databaseId: "<DATABASE_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + tables { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + rowSecurity + columns + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } + bytesMax + bytesUsed + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-graphql/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..bc3663bec --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + tablesDBListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/list.md b/examples/2.0.x/server-graphql/examples/tablesdb/list.md new file mode 100644 index 000000000..9c381aa0f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/list.md @@ -0,0 +1,20 @@ +```graphql +query { + tablesDBList( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + databases { + _id + name + _createdAt + _updatedAt + enabled + type + status + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..ead90236a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBUpdateBigIntColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 0, + min: 0, + max: 1000000, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..f571ec568 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBUpdateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: false, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..fd68f2c1c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBUpdateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..adf2d5a59 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-email-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBUpdateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..31f85012f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-enum-column.md @@ -0,0 +1,25 @@ +```graphql +mutation { + tablesDBUpdateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + elements + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..ba07a7a9b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-float-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBUpdateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 10.5, + min: 0, + max: 100, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..7b18fe7ce --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-integer-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBUpdateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 10, + min: 0, + max: 100, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..88a59d337 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-ip-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBUpdateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..8ad1c2975 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-line-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBUpdateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]], + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..87c733ed2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBUpdateLongtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..1390d7b4e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBUpdateMediumtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..843298936 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-point-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBUpdatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [1, 2], + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..83605a856 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBUpdatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..e75a78d3c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,26 @@ +```graphql +mutation { + tablesDBUpdateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + onDelete: "cascade", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + relatedTable + relationType + twoWay + twoWayKey + onDelete + side + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-row.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-row.md new file mode 100644 index 000000000..2f3abc144 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-row.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBUpdateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":33,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-rows.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..7fcae0620 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-rows.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBUpdateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":33,\"isAdmin\":false}", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..9b496deb2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-string-column.md @@ -0,0 +1,25 @@ +```graphql +mutation { + tablesDBUpdateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-table.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-table.md new file mode 100644 index 000000000..749889797 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-table.md @@ -0,0 +1,37 @@ +```graphql +mutation { + tablesDBUpdateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: ["read(\"any\")"], + rowSecurity: false, + enabled: false, + purge: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + rowSecurity + columns + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } + bytesMax + bytesUsed + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..4b22fc55d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-text-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBUpdateTextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..0d0986b85 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + tablesDBUpdateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..685a97ff0 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-url-column.md @@ -0,0 +1,23 @@ +```graphql +mutation { + tablesDBUpdateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-graphql/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..bd5afff79 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,25 @@ +```graphql +mutation { + tablesDBUpdateVarcharColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, + newKey: "<NEW_KEY>" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/update.md b/examples/2.0.x/server-graphql/examples/tablesdb/update.md new file mode 100644 index 000000000..cbdc9c667 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/update.md @@ -0,0 +1,17 @@ +```graphql +mutation { + tablesDBUpdate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-graphql/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..027687876 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/upsert-row.md @@ -0,0 +1,21 @@ +```graphql +mutation { + tablesDBUpsertRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":33,\"isAdmin\":false}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-graphql/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..fe106a6d5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tablesdb/upsert-rows.md @@ -0,0 +1,22 @@ +```graphql +mutation { + tablesDBUpsertRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/create-membership.md b/examples/2.0.x/server-graphql/examples/teams/create-membership.md new file mode 100644 index 000000000..67b153ea1 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/create-membership.md @@ -0,0 +1,29 @@ +```graphql +mutation { + teamsCreateMembership( + teamId: "<TEAM_ID>", + roles: [], + email: "email@example.com", + userId: "<USER_ID>", + phone: "+12065550100", + url: "https://example.com", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/create.md b/examples/2.0.x/server-graphql/examples/teams/create.md new file mode 100644 index 000000000..c31af8335 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/create.md @@ -0,0 +1,18 @@ +```graphql +mutation { + teamsCreate( + teamId: "<TEAM_ID>", + name: "<NAME>", + roles: [] + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/delete-membership.md b/examples/2.0.x/server-graphql/examples/teams/delete-membership.md new file mode 100644 index 000000000..297d48689 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/delete-membership.md @@ -0,0 +1,10 @@ +```graphql +mutation { + teamsDeleteMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/delete.md b/examples/2.0.x/server-graphql/examples/teams/delete.md new file mode 100644 index 000000000..924ab91c9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + teamsDelete( + teamId: "<TEAM_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/get-membership.md b/examples/2.0.x/server-graphql/examples/teams/get-membership.md new file mode 100644 index 000000000..cccc945b4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/get-membership.md @@ -0,0 +1,24 @@ +```graphql +query { + teamsGetMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/get-prefs.md b/examples/2.0.x/server-graphql/examples/teams/get-prefs.md new file mode 100644 index 000000000..182735730 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/get-prefs.md @@ -0,0 +1,9 @@ +```graphql +query { + teamsGetPrefs( + teamId: "<TEAM_ID>" + ) { + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/get.md b/examples/2.0.x/server-graphql/examples/teams/get.md new file mode 100644 index 000000000..17f4a5ee9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/get.md @@ -0,0 +1,16 @@ +```graphql +query { + teamsGet( + teamId: "<TEAM_ID>" + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/list-memberships.md b/examples/2.0.x/server-graphql/examples/teams/list-memberships.md new file mode 100644 index 000000000..9f76ab1d5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/list-memberships.md @@ -0,0 +1,29 @@ +```graphql +query { + teamsListMemberships( + teamId: "<TEAM_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + memberships { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/list.md b/examples/2.0.x/server-graphql/examples/teams/list.md new file mode 100644 index 000000000..a714bd0bc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/list.md @@ -0,0 +1,21 @@ +```graphql +query { + teamsList( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + teams { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/update-membership-status.md b/examples/2.0.x/server-graphql/examples/teams/update-membership-status.md new file mode 100644 index 000000000..2b86ad398 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/update-membership-status.md @@ -0,0 +1,26 @@ +```graphql +mutation { + teamsUpdateMembershipStatus( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/update-membership.md b/examples/2.0.x/server-graphql/examples/teams/update-membership.md new file mode 100644 index 000000000..c08593729 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/update-membership.md @@ -0,0 +1,25 @@ +```graphql +mutation { + teamsUpdateMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + roles: [] + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/update-name.md b/examples/2.0.x/server-graphql/examples/teams/update-name.md new file mode 100644 index 000000000..a3ce2bd1f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/update-name.md @@ -0,0 +1,17 @@ +```graphql +mutation { + teamsUpdateName( + teamId: "<TEAM_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/teams/update-prefs.md b/examples/2.0.x/server-graphql/examples/teams/update-prefs.md new file mode 100644 index 000000000..411431a12 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/teams/update-prefs.md @@ -0,0 +1,10 @@ +```graphql +mutation { + teamsUpdatePrefs( + teamId: "<TEAM_ID>", + prefs: "{}" + ) { + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tokens/create-file-token.md b/examples/2.0.x/server-graphql/examples/tokens/create-file-token.md new file mode 100644 index 000000000..2d9501d7c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tokens/create-file-token.md @@ -0,0 +1,17 @@ +```graphql +mutation { + tokensCreateFileToken( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + expire: "2020-10-15T06:38:00.000+00:00" + ) { + _id + _createdAt + resourceId + resourceType + expire + secret + accessedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tokens/delete.md b/examples/2.0.x/server-graphql/examples/tokens/delete.md new file mode 100644 index 000000000..d29249a40 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tokens/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + tokensDelete( + tokenId: "<TOKEN_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tokens/get.md b/examples/2.0.x/server-graphql/examples/tokens/get.md new file mode 100644 index 000000000..35e1206dd --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tokens/get.md @@ -0,0 +1,15 @@ +```graphql +query { + tokensGet( + tokenId: "<TOKEN_ID>" + ) { + _id + _createdAt + resourceId + resourceType + expire + secret + accessedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tokens/list.md b/examples/2.0.x/server-graphql/examples/tokens/list.md new file mode 100644 index 000000000..ab80ac7b5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tokens/list.md @@ -0,0 +1,21 @@ +```graphql +query { + tokensList( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + queries: [], + total: false + ) { + total + tokens { + _id + _createdAt + resourceId + resourceType + expire + secret + accessedAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/tokens/update.md b/examples/2.0.x/server-graphql/examples/tokens/update.md new file mode 100644 index 000000000..01d04bb30 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/tokens/update.md @@ -0,0 +1,16 @@ +```graphql +mutation { + tokensUpdate( + tokenId: "<TOKEN_ID>", + expire: "2020-10-15T06:38:00.000+00:00" + ) { + _id + _createdAt + resourceId + resourceType + expire + secret + accessedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-argon-2-user.md b/examples/2.0.x/server-graphql/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..e60049b07 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-argon-2-user.md @@ -0,0 +1,49 @@ +```graphql +mutation { + usersCreateArgon2User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-graphql/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..9a47ea393 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-bcrypt-user.md @@ -0,0 +1,49 @@ +```graphql +mutation { + usersCreateBcryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-jwt.md b/examples/2.0.x/server-graphql/examples/users/create-jwt.md new file mode 100644 index 000000000..0004b6fd2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-jwt.md @@ -0,0 +1,11 @@ +```graphql +mutation { + usersCreateJWT( + userId: "<USER_ID>", + sessionId: "recent()", + duration: 0 + ) { + jwt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-md-5-user.md b/examples/2.0.x/server-graphql/examples/users/create-md-5-user.md new file mode 100644 index 000000000..f6d02777f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-md-5-user.md @@ -0,0 +1,49 @@ +```graphql +mutation { + usersCreateMD5User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-graphql/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..787528eb0 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```graphql +mutation { + usersCreateMFARecoveryCodes( + userId: "<USER_ID>" + ) { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-graphql/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..aeee7264d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-ph-pass-user.md @@ -0,0 +1,49 @@ +```graphql +mutation { + usersCreatePHPassUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-graphql/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..fcd7ff691 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,52 @@ +```graphql +mutation { + usersCreateScryptModifiedUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordSaltSeparator: "<PASSWORD_SALT_SEPARATOR>", + passwordSignerKey: "<PASSWORD_SIGNER_KEY>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-scrypt-user.md b/examples/2.0.x/server-graphql/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..70b9e8873 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-scrypt-user.md @@ -0,0 +1,54 @@ +```graphql +mutation { + usersCreateScryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-session.md b/examples/2.0.x/server-graphql/examples/users/create-session.md new file mode 100644 index 000000000..5e806de2c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-session.md @@ -0,0 +1,37 @@ +```graphql +mutation { + usersCreateSession( + userId: "<USER_ID>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-sha-user.md b/examples/2.0.x/server-graphql/examples/users/create-sha-user.md new file mode 100644 index 000000000..5595ad517 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-sha-user.md @@ -0,0 +1,50 @@ +```graphql +mutation { + usersCreateSHAUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordVersion: "sha1", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-target.md b/examples/2.0.x/server-graphql/examples/users/create-target.md new file mode 100644 index 000000000..b25a469dc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-target.md @@ -0,0 +1,22 @@ +```graphql +mutation { + usersCreateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + providerType: "email", + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create-token.md b/examples/2.0.x/server-graphql/examples/users/create-token.md new file mode 100644 index 000000000..6d4ea54fe --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create-token.md @@ -0,0 +1,16 @@ +```graphql +mutation { + usersCreateToken( + userId: "<USER_ID>", + length: 4, + expire: 60 + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/create.md b/examples/2.0.x/server-graphql/examples/users/create.md new file mode 100644 index 000000000..acf49207b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/create.md @@ -0,0 +1,50 @@ +```graphql +mutation { + usersCreate( + userId: "<USER_ID>", + email: "email@example.com", + phone: "+12065550100", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/delete-identity.md b/examples/2.0.x/server-graphql/examples/users/delete-identity.md new file mode 100644 index 000000000..9965b492f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/delete-identity.md @@ -0,0 +1,9 @@ +```graphql +mutation { + usersDeleteIdentity( + identityId: "<IDENTITY_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-graphql/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..095d5f13c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,10 @@ +```graphql +mutation { + usersDeleteMFAAuthenticator( + userId: "<USER_ID>", + type: "totp" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/delete-session.md b/examples/2.0.x/server-graphql/examples/users/delete-session.md new file mode 100644 index 000000000..fd8363b66 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/delete-session.md @@ -0,0 +1,10 @@ +```graphql +mutation { + usersDeleteSession( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/delete-sessions.md b/examples/2.0.x/server-graphql/examples/users/delete-sessions.md new file mode 100644 index 000000000..8d445f8e4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/delete-sessions.md @@ -0,0 +1,9 @@ +```graphql +mutation { + usersDeleteSessions( + userId: "<USER_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/delete-target.md b/examples/2.0.x/server-graphql/examples/users/delete-target.md new file mode 100644 index 000000000..0e630003d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/delete-target.md @@ -0,0 +1,10 @@ +```graphql +mutation { + usersDeleteTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/delete.md b/examples/2.0.x/server-graphql/examples/users/delete.md new file mode 100644 index 000000000..8bdf41f88 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + usersDelete( + userId: "<USER_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-graphql/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..74dd2c9f2 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/get-mfa-challenge.md @@ -0,0 +1,14 @@ +```graphql +query { + usersGetMFAChallenge( + userId: "<USER_ID>", + challengeId: "<CHALLENGE_ID>" + ) { + _id + _createdAt + userId + expire + code + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-graphql/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..2c86f0b31 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```graphql +query { + usersGetMFARecoveryCodes( + userId: "<USER_ID>" + ) { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/get-prefs.md b/examples/2.0.x/server-graphql/examples/users/get-prefs.md new file mode 100644 index 000000000..e6c5d5284 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/get-prefs.md @@ -0,0 +1,9 @@ +```graphql +query { + usersGetPrefs( + userId: "<USER_ID>" + ) { + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/get-target.md b/examples/2.0.x/server-graphql/examples/users/get-target.md new file mode 100644 index 000000000..c93658e35 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/get-target.md @@ -0,0 +1,18 @@ +```graphql +query { + usersGetTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/get.md b/examples/2.0.x/server-graphql/examples/users/get.md new file mode 100644 index 000000000..2fa8cd9d8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/get.md @@ -0,0 +1,46 @@ +```graphql +query { + usersGet( + userId: "<USER_ID>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/list-identities.md b/examples/2.0.x/server-graphql/examples/users/list-identities.md new file mode 100644 index 000000000..9b6424101 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/list-identities.md @@ -0,0 +1,23 @@ +```graphql +query { + usersListIdentities( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + identities { + _id + _createdAt + _updatedAt + userId + provider + providerUid + providerEmail + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/list-memberships.md b/examples/2.0.x/server-graphql/examples/users/list-memberships.md new file mode 100644 index 000000000..bf2b9e010 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/list-memberships.md @@ -0,0 +1,29 @@ +```graphql +query { + usersListMemberships( + userId: "<USER_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + memberships { + _id + _createdAt + _updatedAt + userId + userName + userEmail + userPhone + teamId + teamName + invited + joined + confirm + mfa + userAccessedAt + roles + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/list-mfa-factors.md b/examples/2.0.x/server-graphql/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..b50907114 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/list-mfa-factors.md @@ -0,0 +1,13 @@ +```graphql +query { + usersListMFAFactors( + userId: "<USER_ID>" + ) { + totp + phone + email + recoveryCode + custom + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/list-sessions.md b/examples/2.0.x/server-graphql/examples/users/list-sessions.md new file mode 100644 index 000000000..1f9086d5d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/list-sessions.md @@ -0,0 +1,41 @@ +```graphql +query { + usersListSessions( + userId: "<USER_ID>", + total: false + ) { + total + sessions { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/list-targets.md b/examples/2.0.x/server-graphql/examples/users/list-targets.md new file mode 100644 index 000000000..f22b1c70d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/list-targets.md @@ -0,0 +1,22 @@ +```graphql +query { + usersListTargets( + userId: "<USER_ID>", + queries: [], + total: false + ) { + total + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/list.md b/examples/2.0.x/server-graphql/examples/users/list.md new file mode 100644 index 000000000..fbcf19dc9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/list.md @@ -0,0 +1,51 @@ +```graphql +query { + usersList( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + users { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-email-verification.md b/examples/2.0.x/server-graphql/examples/users/update-email-verification.md new file mode 100644 index 000000000..3fc642473 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-email-verification.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdateEmailVerification( + userId: "<USER_ID>", + emailVerification: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-email.md b/examples/2.0.x/server-graphql/examples/users/update-email.md new file mode 100644 index 000000000..5dd4831e5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-email.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdateEmail( + userId: "<USER_ID>", + email: "email@example.com" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-impersonator.md b/examples/2.0.x/server-graphql/examples/users/update-impersonator.md new file mode 100644 index 000000000..23cbec7ab --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-impersonator.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdateImpersonator( + userId: "<USER_ID>", + impersonator: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-labels.md b/examples/2.0.x/server-graphql/examples/users/update-labels.md new file mode 100644 index 000000000..a5bf818b9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-labels.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdateLabels( + userId: "<USER_ID>", + labels: [] + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-graphql/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..f49db0ed5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```graphql +mutation { + usersUpdateMFARecoveryCodes( + userId: "<USER_ID>" + ) { + recoveryCodes + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-mfa.md b/examples/2.0.x/server-graphql/examples/users/update-mfa.md new file mode 100644 index 000000000..4fdff4226 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-mfa.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdateMFA( + userId: "<USER_ID>", + mfa: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-name.md b/examples/2.0.x/server-graphql/examples/users/update-name.md new file mode 100644 index 000000000..d75138e0e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-name.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdateName( + userId: "<USER_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-password.md b/examples/2.0.x/server-graphql/examples/users/update-password.md new file mode 100644 index 000000000..2ba30e7fc --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-password.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdatePassword( + userId: "<USER_ID>", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-phone-verification.md b/examples/2.0.x/server-graphql/examples/users/update-phone-verification.md new file mode 100644 index 000000000..d0f284939 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-phone-verification.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdatePhoneVerification( + userId: "<USER_ID>", + phoneVerification: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-phone.md b/examples/2.0.x/server-graphql/examples/users/update-phone.md new file mode 100644 index 000000000..e96820ef6 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-phone.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdatePhone( + userId: "<USER_ID>", + number: "+12065550100" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-prefs.md b/examples/2.0.x/server-graphql/examples/users/update-prefs.md new file mode 100644 index 000000000..f636b511e --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-prefs.md @@ -0,0 +1,10 @@ +```graphql +mutation { + usersUpdatePrefs( + userId: "<USER_ID>", + prefs: "{}" + ) { + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-status.md b/examples/2.0.x/server-graphql/examples/users/update-status.md new file mode 100644 index 000000000..705916ec0 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-status.md @@ -0,0 +1,47 @@ +```graphql +mutation { + usersUpdateStatus( + userId: "<USER_ID>", + status: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + emailCanonical + emailIsFree + emailIsDisposable + emailIsCorporate + emailIsCanonical + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + impersonator + impersonatorUserId + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/users/update-target.md b/examples/2.0.x/server-graphql/examples/users/update-target.md new file mode 100644 index 000000000..df1556e26 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/users/update-target.md @@ -0,0 +1,21 @@ +```graphql +mutation { + usersUpdateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-graphql/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..be4bcde18 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/create-collection.md @@ -0,0 +1,38 @@ +```graphql +mutation { + vectorsDBCreateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + dimension: 1, + permissions: ["read(\"any\")"], + documentSecurity: false, + enabled: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + dimension + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/create-document.md b/examples/2.0.x/server-graphql/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..e81b723e9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/create-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBCreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{\"embeddings\":[0.12,-0.55,0.88,1.02],\"metadata\":{\"key\":\"value\"}}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-graphql/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..6b7a5298d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/create-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + vectorsDBCreateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/create-index.md b/examples/2.0.x/server-graphql/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..c24dab95f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/create-index.md @@ -0,0 +1,24 @@ +```graphql +mutation { + vectorsDBCreateIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: "hnsw_euclidean", + attributes: [], + orders: [], + lengths: [] + ) { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-graphql/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..b1d86d55b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```graphql +mutation { + vectorsDBCreateOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/create-query.md b/examples/2.0.x/server-graphql/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..fac71fdf8 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/create-query.md @@ -0,0 +1,24 @@ +```graphql +mutation { + vectorsDBCreateQuery( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-graphql/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..d3057810c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/create-transaction.md @@ -0,0 +1,14 @@ +```graphql +mutation { + vectorsDBCreateTransaction( + ttl: 60 + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/create.md b/examples/2.0.x/server-graphql/examples/vectorsdb/create.md new file mode 100644 index 000000000..c9c6be25f --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/create.md @@ -0,0 +1,17 @@ +```graphql +mutation { + vectorsDBCreate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..3f00fc664 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-collection.md @@ -0,0 +1,10 @@ +```graphql +mutation { + vectorsDBDeleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..2da5f257d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-document.md @@ -0,0 +1,12 @@ +```graphql +mutation { + vectorsDBDeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..e84bededa --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + vectorsDBDeleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..59332bcca --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-index.md @@ -0,0 +1,11 @@ +```graphql +mutation { + vectorsDBDeleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..ba12d0e13 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,9 @@ +```graphql +mutation { + vectorsDBDeleteTransaction( + transactionId: "<TRANSACTION_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/delete.md b/examples/2.0.x/server-graphql/examples/vectorsdb/delete.md new file mode 100644 index 000000000..c55cc5a50 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + vectorsDBDelete( + databaseId: "<DATABASE_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-graphql/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..05a489740 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/get-collection.md @@ -0,0 +1,33 @@ +```graphql +query { + vectorsDBGetCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + dimension + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/get-document.md b/examples/2.0.x/server-graphql/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..4a2ca99c9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/get-document.md @@ -0,0 +1,20 @@ +```graphql +query { + vectorsDBGetDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/get-index.md b/examples/2.0.x/server-graphql/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..03af68306 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/get-index.md @@ -0,0 +1,20 @@ +```graphql +query { + vectorsDBGetIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" + ) { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-graphql/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..df2dbc325 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/get-transaction.md @@ -0,0 +1,14 @@ +```graphql +query { + vectorsDBGetTransaction( + transactionId: "<TRANSACTION_ID>" + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/get.md b/examples/2.0.x/server-graphql/examples/vectorsdb/get.md new file mode 100644 index 000000000..47d75f91a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/get.md @@ -0,0 +1,15 @@ +```graphql +query { + vectorsDBGet( + databaseId: "<DATABASE_ID>" + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-graphql/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..afdcd73c5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/list-collections.md @@ -0,0 +1,38 @@ +```graphql +query { + vectorsDBListCollections( + databaseId: "<DATABASE_ID>", + queries: [], + search: "<SEARCH>", + total: false + ) { + total + collections { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + dimension + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-graphql/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..68f1ff5c7 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/list-documents.md @@ -0,0 +1,24 @@ +```graphql +query { + vectorsDBListDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + transactionId: "<TRANSACTION_ID>", + total: false, + ttl: 0 + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-graphql/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..3d7b06c0a --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/list-indexes.md @@ -0,0 +1,24 @@ +```graphql +query { + vectorsDBListIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], + total: false + ) { + total + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-graphql/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..1f2ea4aa4 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/list-transactions.md @@ -0,0 +1,17 @@ +```graphql +query { + vectorsDBListTransactions( + queries: [] + ) { + total + transactions { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/list.md b/examples/2.0.x/server-graphql/examples/vectorsdb/list.md new file mode 100644 index 000000000..c3a29569c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/list.md @@ -0,0 +1,20 @@ +```graphql +query { + vectorsDBList( + queries: [], + search: "<SEARCH>", + total: false + ) { + total + databases { + _id + name + _createdAt + _updatedAt + enabled + type + status + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-graphql/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..4728d0970 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/update-collection.md @@ -0,0 +1,38 @@ +```graphql +mutation { + vectorsDBUpdateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + dimension: 1, + permissions: ["read(\"any\")"], + documentSecurity: false, + enabled: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + bytesMax + bytesUsed + dimension + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/update-document.md b/examples/2.0.x/server-graphql/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..328c52df5 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/update-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBUpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-graphql/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..990a62d18 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/update-documents.md @@ -0,0 +1,23 @@ +```graphql +mutation { + vectorsDBUpdateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: "{}", + queries: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-graphql/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..106a7b51d --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/update-transaction.md @@ -0,0 +1,16 @@ +```graphql +mutation { + vectorsDBUpdateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, + rollback: false + ) { + _id + _createdAt + _updatedAt + status + operations + expiresAt + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/update.md b/examples/2.0.x/server-graphql/examples/vectorsdb/update.md new file mode 100644 index 000000000..66f769870 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/update.md @@ -0,0 +1,17 @@ +```graphql +mutation { + vectorsDBUpdate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-graphql/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..21e56bc8b --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/upsert-document.md @@ -0,0 +1,21 @@ +```graphql +mutation { + vectorsDBUpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read(\"any\")"], + transactionId: "<TRANSACTION_ID>" + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-graphql/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..852f90d7c --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,22 @@ +```graphql +mutation { + vectorsDBUpsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/webhooks/create.md b/examples/2.0.x/server-graphql/examples/webhooks/create.md new file mode 100644 index 000000000..20182a3b9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/webhooks/create.md @@ -0,0 +1,29 @@ +```graphql +mutation { + webhooksCreate( + webhookId: "<WEBHOOK_ID>", + url: "https://example.com/webhook", + name: "<NAME>", + events: [], + enabled: false, + tls: false, + authUsername: "<AUTH_USERNAME>", + authPassword: "password", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + name + url + events + tls + authUsername + authPassword + secret + enabled + logs + attempts + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/webhooks/delete.md b/examples/2.0.x/server-graphql/examples/webhooks/delete.md new file mode 100644 index 000000000..2a6724843 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/webhooks/delete.md @@ -0,0 +1,9 @@ +```graphql +mutation { + webhooksDelete( + webhookId: "<WEBHOOK_ID>" + ) { + status + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/webhooks/get.md b/examples/2.0.x/server-graphql/examples/webhooks/get.md new file mode 100644 index 000000000..727d554d9 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/webhooks/get.md @@ -0,0 +1,21 @@ +```graphql +query { + webhooksGet( + webhookId: "<WEBHOOK_ID>" + ) { + _id + _createdAt + _updatedAt + name + url + events + tls + authUsername + authPassword + secret + enabled + logs + attempts + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/webhooks/list.md b/examples/2.0.x/server-graphql/examples/webhooks/list.md new file mode 100644 index 000000000..a500b2ee7 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/webhooks/list.md @@ -0,0 +1,25 @@ +```graphql +query { + webhooksList( + queries: [], + total: false + ) { + total + webhooks { + _id + _createdAt + _updatedAt + name + url + events + tls + authUsername + authPassword + secret + enabled + logs + attempts + } + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/webhooks/update-secret.md b/examples/2.0.x/server-graphql/examples/webhooks/update-secret.md new file mode 100644 index 000000000..278f8f8ed --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/webhooks/update-secret.md @@ -0,0 +1,22 @@ +```graphql +mutation { + webhooksUpdateSecret( + webhookId: "<WEBHOOK_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + name + url + events + tls + authUsername + authPassword + secret + enabled + logs + attempts + } +} +``` diff --git a/examples/2.0.x/server-graphql/examples/webhooks/update.md b/examples/2.0.x/server-graphql/examples/webhooks/update.md new file mode 100644 index 000000000..6917853a7 --- /dev/null +++ b/examples/2.0.x/server-graphql/examples/webhooks/update.md @@ -0,0 +1,28 @@ +```graphql +mutation { + webhooksUpdate( + webhookId: "<WEBHOOK_ID>", + name: "<NAME>", + url: "https://example.com/webhook", + events: [], + enabled: false, + tls: false, + authUsername: "<AUTH_USERNAME>", + authPassword: "password" + ) { + _id + _createdAt + _updatedAt + name + url + events + tls + authUsername + authPassword + secret + enabled + logs + attempts + } +} +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-anonymous-session.md b/examples/2.0.x/server-kotlin/java/account/create-anonymous-session.md new file mode 100644 index 000000000..e6e2e4398 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-anonymous-session.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createAnonymousSession(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-email-password-session.md b/examples/2.0.x/server-kotlin/java/account/create-email-password-session.md new file mode 100644 index 000000000..c6c08c959 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-email-password-session.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createEmailPasswordSession( + "email@example.com", // email + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-email-token.md b/examples/2.0.x/server-kotlin/java/account/create-email-token.md new file mode 100644 index 000000000..a718e2d5e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-email-token.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +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; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-email-verification.md b/examples/2.0.x/server-kotlin/java/account/create-email-verification.md new file mode 100644 index 000000000..109ae076c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-email-verification.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createEmailVerification( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-magic-url-token.md b/examples/2.0.x/server-kotlin/java/account/create-magic-url-token.md new file mode 100644 index 000000000..2f6e83ec8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-magic-url-token.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +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; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-mfa-authenticator.md b/examples/2.0.x/server-kotlin/java/account/create-mfa-authenticator.md new file mode 100644 index 000000000..123866a91 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-mfa-authenticator.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createMFAAuthenticator( + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-mfa-challenge.md b/examples/2.0.x/server-kotlin/java/account/create-mfa-challenge.md new file mode 100644 index 000000000..458936398 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-mfa-challenge.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticationFactor; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createMFAChallenge( + AuthenticationFactor.EMAIL, // factor + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/java/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..090c61d1e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-mfa-recovery-codes.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-o-auth-2-token.md b/examples/2.0.x/server-kotlin/java/account/create-o-auth-2-token.md new file mode 100644 index 000000000..3f7472704 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-o-auth-2-token.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.OAuthProvider; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createOAuth2Token( + 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; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-phone-token.md b/examples/2.0.x/server-kotlin/java/account/create-phone-token.md new file mode 100644 index 000000000..45bc0ccb6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-phone-token.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createPhoneToken( + "<USER_ID>", // userId + "+12065550100", // phone + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-phone-verification.md b/examples/2.0.x/server-kotlin/java/account/create-phone-verification.md new file mode 100644 index 000000000..6ed21235c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-phone-verification.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-recovery.md b/examples/2.0.x/server-kotlin/java/account/create-recovery.md new file mode 100644 index 000000000..64951b257 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-recovery.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createRecovery( + "email@example.com", // email + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-session.md b/examples/2.0.x/server-kotlin/java/account/create-session.md new file mode 100644 index 000000000..3376cb85d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-session.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create-verification.md b/examples/2.0.x/server-kotlin/java/account/create-verification.md new file mode 100644 index 000000000..f0f221b45 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create-verification.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createVerification( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/create.md b/examples/2.0.x/server-kotlin/java/account/create.md new file mode 100644 index 000000000..f7815f788 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/create.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.create( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/delete-identity.md b/examples/2.0.x/server-kotlin/java/account/delete-identity.md new file mode 100644 index 000000000..5bb897f5d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/delete-identity.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.deleteIdentity( + "<IDENTITY_ID>", // identityId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/delete-mfa-authenticator.md b/examples/2.0.x/server-kotlin/java/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..4ce42b4e4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/delete-mfa-authenticator.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.deleteMFAAuthenticator( + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/delete-session.md b/examples/2.0.x/server-kotlin/java/account/delete-session.md new file mode 100644 index 000000000..781161c74 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/delete-session.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.deleteSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/delete-sessions.md b/examples/2.0.x/server-kotlin/java/account/delete-sessions.md new file mode 100644 index 000000000..ef087fd4a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/delete-sessions.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.deleteSessions(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/java/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..6d59890b3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/get-mfa-recovery-codes.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.getMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/get-prefs.md b/examples/2.0.x/server-kotlin/java/account/get-prefs.md new file mode 100644 index 000000000..eb6c6e56b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/get-prefs.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.getPrefs(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/get-session.md b/examples/2.0.x/server-kotlin/java/account/get-session.md new file mode 100644 index 000000000..e5d96a82a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/get-session.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.getSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/get.md b/examples/2.0.x/server-kotlin/java/account/get.md new file mode 100644 index 000000000..83caeaffa --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/get.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/list-identities.md b/examples/2.0.x/server-kotlin/java/account/list-identities.md new file mode 100644 index 000000000..4c439111c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/list-identities.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.listIdentities( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/list-mfa-factors.md b/examples/2.0.x/server-kotlin/java/account/list-mfa-factors.md new file mode 100644 index 000000000..d69f23e13 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/list-mfa-factors.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.listMFAFactors(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/list-sessions.md b/examples/2.0.x/server-kotlin/java/account/list-sessions.md new file mode 100644 index 000000000..bb25cff16 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/list-sessions.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.listSessions(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-email-verification.md b/examples/2.0.x/server-kotlin/java/account/update-email-verification.md new file mode 100644 index 000000000..dd13e6fe6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-email-verification.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateEmailVerification( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-email.md b/examples/2.0.x/server-kotlin/java/account/update-email.md new file mode 100644 index 000000000..06baceaef --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-email.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateEmail( + "email@example.com", // email + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-magic-url-session.md b/examples/2.0.x/server-kotlin/java/account/update-magic-url-session.md new file mode 100644 index 000000000..8ed558d11 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-magic-url-session.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMagicURLSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-mfa-authenticator.md b/examples/2.0.x/server-kotlin/java/account/update-mfa-authenticator.md new file mode 100644 index 000000000..aaceb2971 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-mfa-authenticator.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMFAAuthenticator( + AuthenticatorType.TOTP, // type + "<OTP>", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-mfa-challenge.md b/examples/2.0.x/server-kotlin/java/account/update-mfa-challenge.md new file mode 100644 index 000000000..a80179951 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-mfa-challenge.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMFAChallenge( + "<CHALLENGE_ID>", // challengeId + "<OTP>", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/java/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..7062704b6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-mfa-recovery-codes.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-mfa.md b/examples/2.0.x/server-kotlin/java/account/update-mfa.md new file mode 100644 index 000000000..f63ee870c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-mfa.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMFA( + false, // mfa + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-name.md b/examples/2.0.x/server-kotlin/java/account/update-name.md new file mode 100644 index 000000000..fe63d7e4a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-name.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateName( + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-password.md b/examples/2.0.x/server-kotlin/java/account/update-password.md new file mode 100644 index 000000000..764aeb067 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-password.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePassword( + "password", // password + "password", // oldPassword (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-phone-session.md b/examples/2.0.x/server-kotlin/java/account/update-phone-session.md new file mode 100644 index 000000000..33e701c8d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-phone-session.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePhoneSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-phone-verification.md b/examples/2.0.x/server-kotlin/java/account/update-phone-verification.md new file mode 100644 index 000000000..7b692cb47 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-phone-verification.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePhoneVerification( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-phone.md b/examples/2.0.x/server-kotlin/java/account/update-phone.md new file mode 100644 index 000000000..2ffdc2349 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-phone.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePhone( + "+12065550100", // phone + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-prefs.md b/examples/2.0.x/server-kotlin/java/account/update-prefs.md new file mode 100644 index 000000000..a3f58f5f6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-prefs.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePrefs( + Map.of( + "language", "en", + "timezone", "UTC", + "darkTheme", true + ), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-recovery.md b/examples/2.0.x/server-kotlin/java/account/update-recovery.md new file mode 100644 index 000000000..542d13461 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-recovery.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateRecovery( + "<USER_ID>", // userId + "<SECRET>", // secret + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-session.md b/examples/2.0.x/server-kotlin/java/account/update-session.md new file mode 100644 index 000000000..a33ee5cf8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-session.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-status.md b/examples/2.0.x/server-kotlin/java/account/update-status.md new file mode 100644 index 000000000..777ff6b55 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-status.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateStatus(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/account/update-verification.md b/examples/2.0.x/server-kotlin/java/account/update-verification.md new file mode 100644 index 000000000..3c19f4f1c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/account/update-verification.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateVerification( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/advisor/delete-report.md b/examples/2.0.x/server-kotlin/java/advisor/delete-report.md new file mode 100644 index 000000000..1ecfdda81 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/advisor/delete-report.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Advisor; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +advisor.deleteReport( + "<REPORT_ID>", // reportId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/advisor/get-insight.md b/examples/2.0.x/server-kotlin/java/advisor/get-insight.md new file mode 100644 index 000000000..324de8563 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/advisor/get-insight.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Advisor; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +advisor.getInsight( + "<REPORT_ID>", // reportId + "<INSIGHT_ID>", // insightId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/advisor/get-report.md b/examples/2.0.x/server-kotlin/java/advisor/get-report.md new file mode 100644 index 000000000..3cc1a07d0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/advisor/get-report.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Advisor; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +advisor.getReport( + "<REPORT_ID>", // reportId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/advisor/list-insights.md b/examples/2.0.x/server-kotlin/java/advisor/list-insights.md new file mode 100644 index 000000000..5aecf631b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/advisor/list-insights.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Advisor; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +advisor.listInsights( + "<REPORT_ID>", // reportId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/advisor/list-reports.md b/examples/2.0.x/server-kotlin/java/advisor/list-reports.md new file mode 100644 index 000000000..a8a5a46a6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/advisor/list-reports.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Advisor; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Advisor advisor = new Advisor(client); + +advisor.listReports( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-browser.md b/examples/2.0.x/server-kotlin/java/avatars/get-browser.md new file mode 100644 index 000000000..72748afcb --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-browser.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.Browser; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getBrowser( + Browser.AVANT_BROWSER, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-credit-card.md b/examples/2.0.x/server-kotlin/java/avatars/get-credit-card.md new file mode 100644 index 000000000..8f93da91a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-credit-card.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.CreditCard; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getCreditCard( + CreditCard.AMERICAN_EXPRESS, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-favicon.md b/examples/2.0.x/server-kotlin/java/avatars/get-favicon.md new file mode 100644 index 000000000..6df13f5e8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-favicon.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getFavicon( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-flag.md b/examples/2.0.x/server-kotlin/java/avatars/get-flag.md new file mode 100644 index 000000000..f66a872d3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-flag.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.Flag; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getFlag( + Flag.AFGHANISTAN, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-image.md b/examples/2.0.x/server-kotlin/java/avatars/get-image.md new file mode 100644 index 000000000..7f93b9f9f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-image.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getImage( + "https://example.com", // url + 0, // width (optional) + 0, // height (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-initials.md b/examples/2.0.x/server-kotlin/java/avatars/get-initials.md new file mode 100644 index 000000000..79e9c7b14 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-initials.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getInitials( + "<NAME>", // name (optional) + 0, // width (optional) + 0, // height (optional) + "FFFFFF", // background (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-photo.md b/examples/2.0.x/server-kotlin/java/avatars/get-photo.md new file mode 100644 index 000000000..831e9cc3d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-photo.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getPhoto( + 0, // width (optional) + 0, // height (optional) + 0, // quality (optional) + "png", // output (optional) + "g", // rating (optional) + "current()", // userId (optional) + "<EMAIL_HASH>", // emailHash (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-qr.md b/examples/2.0.x/server-kotlin/java/avatars/get-qr.md new file mode 100644 index 000000000..0e22f63f1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-qr.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getQR( + "<TEXT>", // text + 1, // size (optional) + 0, // margin (optional) + false, // download (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/avatars/get-screenshot.md b/examples/2.0.x/server-kotlin/java/avatars/get-screenshot.md new file mode 100644 index 000000000..c8b5966fe --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/avatars/get-screenshot.md @@ -0,0 +1,51 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.BrowserTheme; +import io.appwrite.enums.Timezone; +import io.appwrite.enums.BrowserPermission; +import io.appwrite.enums.ImageFormat; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getScreenshot( + "https://example.com", // url + Map.of( + "Authorization", "Bearer token123", + "X-Custom-Header", "value" + ), // headers (optional) + 1920, // viewportWidth (optional) + 1080, // viewportHeight (optional) + 2, // scale (optional) + BrowserTheme.DARK, // theme (optional) + "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // userAgent (optional) + true, // fullpage (optional) + "en-US", // locale (optional) + Timezone.AFRICA_ABIDJAN, // timezone (optional) + 37.7749, // latitude (optional) + -122.4194, // longitude (optional) + 100, // accuracy (optional) + true, // touch (optional) + List.of(BrowserPermission.GEOLOCATION, BrowserPermission.NOTIFICATIONS), // permissions (optional) + 3, // sleep (optional) + 800, // width (optional) + 600, // height (optional) + 85, // quality (optional) + ImageFormat.JPEG, // output (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-big-int-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-big-int-attribute.md new file mode 100644 index 000000000..ab0a21c6a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-big-int-attribute.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createBigIntAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + 0, // min (optional) + 1000000, // max (optional) + 0, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-boolean-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-boolean-attribute.md new file mode 100644 index 000000000..f34934c1e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-boolean-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createBooleanAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + false, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-collection.md b/examples/2.0.x/server-kotlin/java/databases/create-collection.md new file mode 100644 index 000000000..32d9cd54e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-collection.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<NAME>", // name + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + List.of(), // attributes (optional) + List.of(), // indexes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-datetime-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-datetime-attribute.md new file mode 100644 index 000000000..d84637da6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-datetime-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createDatetimeAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "2020-10-15T06:38:00.000+00:00", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-document.md b/examples/2.0.x/server-kotlin/java/databases/create-document.md new file mode 100644 index 000000000..34206c2d4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-document.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.createDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-documents.md b/examples/2.0.x/server-kotlin/java/databases/create-documents.md new file mode 100644 index 000000000..5a158bf59 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // documents + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-email-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-email-attribute.md new file mode 100644 index 000000000..1bc93f1ca --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-email-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createEmailAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "email@example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-enum-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-enum-attribute.md new file mode 100644 index 000000000..197dc01a2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-enum-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createEnumAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + List.of("active", "inactive"), // elements + false, // required + "active", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-float-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-float-attribute.md new file mode 100644 index 000000000..6af5f366b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-float-attribute.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createFloatAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + 0, // min (optional) + 100, // max (optional) + 10.5, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-index.md b/examples/2.0.x/server-kotlin/java/databases/create-index.md new file mode 100644 index 000000000..357440dc8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-index.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; +import io.appwrite.enums.DatabasesIndexType; +import io.appwrite.enums.OrderBy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + DatabasesIndexType.KEY, // type + List.of(), // attributes + List.of(OrderBy.ASC), // orders (optional) + List.of(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-integer-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-integer-attribute.md new file mode 100644 index 000000000..72cccd75d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-integer-attribute.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createIntegerAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + 0, // min (optional) + 100, // max (optional) + 10, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-ip-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-ip-attribute.md new file mode 100644 index 000000000..d185ef76f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-ip-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createIpAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "192.0.2.0", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-line-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-line-attribute.md new file mode 100644 index 000000000..e38258615 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-line-attribute.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createLineAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6)), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-longtext-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-longtext-attribute.md new file mode 100644 index 000000000..37f46dde8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-longtext-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createLongtextAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..57c8d610d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-mediumtext-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createMediumtextAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-operations.md b/examples/2.0.x/server-kotlin/java/databases/create-operations.md new file mode 100644 index 000000000..29f1efbde --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-operations.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createOperations( + "<TRANSACTION_ID>", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "<DATABASE_ID>", + "collectionId", "<COLLECTION_ID>", + "documentId", "<DOCUMENT_ID>", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-point-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-point-attribute.md new file mode 100644 index 000000000..d48c69c56 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-point-attribute.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createPointAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + List.of(1, 2), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-polygon-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-polygon-attribute.md new file mode 100644 index 000000000..84f2ab929 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-polygon-attribute.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createPolygonAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + List.of(List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6), List.of(1, 2))), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-relationship-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-relationship-attribute.md new file mode 100644 index 000000000..7b100a10a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-relationship-attribute.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; +import io.appwrite.enums.RelationshipType; +import io.appwrite.enums.RelationMutate; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createRelationshipAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<RELATED_COLLECTION_ID>", // relatedCollectionId + RelationshipType.ONETOONE, // type + false, // twoWay (optional) + "<KEY>", // key (optional) + "<TWO_WAY_KEY>", // twoWayKey (optional) + RelationMutate.CASCADE, // onDelete (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-string-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-string-attribute.md new file mode 100644 index 000000000..2a06f8c12 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-string-attribute.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createStringAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + 1, // size + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-text-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-text-attribute.md new file mode 100644 index 000000000..31f6af205 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-text-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createTextAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-transaction.md b/examples/2.0.x/server-kotlin/java/databases/create-transaction.md new file mode 100644 index 000000000..4cbee4edb --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-url-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-url-attribute.md new file mode 100644 index 000000000..90ab19c0d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-url-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createUrlAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "https://example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create-varchar-attribute.md b/examples/2.0.x/server-kotlin/java/databases/create-varchar-attribute.md new file mode 100644 index 000000000..0b16ca203 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create-varchar-attribute.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createVarcharAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + 1, // size + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/create.md b/examples/2.0.x/server-kotlin/java/databases/create.md new file mode 100644 index 000000000..8806db37d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/create.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.create( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/decrement-document-attribute.md b/examples/2.0.x/server-kotlin/java/databases/decrement-document-attribute.md new file mode 100644 index 000000000..9c271f5b7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/decrement-document-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.decrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "<ATTRIBUTE>", // attribute + 1, // value (optional) + 0, // min (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/delete-attribute.md b/examples/2.0.x/server-kotlin/java/databases/delete-attribute.md new file mode 100644 index 000000000..1b04159ad --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/delete-attribute.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/delete-collection.md b/examples/2.0.x/server-kotlin/java/databases/delete-collection.md new file mode 100644 index 000000000..c2849bb78 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/delete-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/delete-document.md b/examples/2.0.x/server-kotlin/java/databases/delete-document.md new file mode 100644 index 000000000..cd67c320c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/delete-document.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.deleteDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/delete-documents.md b/examples/2.0.x/server-kotlin/java/databases/delete-documents.md new file mode 100644 index 000000000..5c4392309 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/delete-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/delete-index.md b/examples/2.0.x/server-kotlin/java/databases/delete-index.md new file mode 100644 index 000000000..31b706523 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/delete-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/delete-transaction.md b/examples/2.0.x/server-kotlin/java/databases/delete-transaction.md new file mode 100644 index 000000000..1175643fa --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/delete-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteTransaction( + "<TRANSACTION_ID>", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/delete.md b/examples/2.0.x/server-kotlin/java/databases/delete.md new file mode 100644 index 000000000..2993d7980 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.delete( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/get-attribute.md b/examples/2.0.x/server-kotlin/java/databases/get-attribute.md new file mode 100644 index 000000000..550aa300f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/get-attribute.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.getAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/get-collection.md b/examples/2.0.x/server-kotlin/java/databases/get-collection.md new file mode 100644 index 000000000..0584c0edf --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/get-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.getCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/get-document.md b/examples/2.0.x/server-kotlin/java/databases/get-document.md new file mode 100644 index 000000000..80d63bb26 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/get-document.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.getDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/get-index.md b/examples/2.0.x/server-kotlin/java/databases/get-index.md new file mode 100644 index 000000000..e8edcc978 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/get-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.getIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/get-transaction.md b/examples/2.0.x/server-kotlin/java/databases/get-transaction.md new file mode 100644 index 000000000..48f44db7a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/get-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.getTransaction( + "<TRANSACTION_ID>", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/get.md b/examples/2.0.x/server-kotlin/java/databases/get.md new file mode 100644 index 000000000..aafe37981 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.get( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/increment-document-attribute.md b/examples/2.0.x/server-kotlin/java/databases/increment-document-attribute.md new file mode 100644 index 000000000..b78f9af02 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/increment-document-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.incrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "<ATTRIBUTE>", // attribute + 1, // value (optional) + 100, // max (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/list-attributes.md b/examples/2.0.x/server-kotlin/java/databases/list-attributes.md new file mode 100644 index 000000000..43019a15d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/list-attributes.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.listAttributes( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/list-collections.md b/examples/2.0.x/server-kotlin/java/databases/list-collections.md new file mode 100644 index 000000000..53684f090 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/list-collections.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.listCollections( + "<DATABASE_ID>", // databaseId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/list-documents.md b/examples/2.0.x/server-kotlin/java/databases/list-documents.md new file mode 100644 index 000000000..f961c7a18 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/list-documents.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.listDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/list-indexes.md b/examples/2.0.x/server-kotlin/java/databases/list-indexes.md new file mode 100644 index 000000000..e483c5e7e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/list-indexes.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.listIndexes( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/list-transactions.md b/examples/2.0.x/server-kotlin/java/databases/list-transactions.md new file mode 100644 index 000000000..27fe4e936 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/list-transactions.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/list.md b/examples/2.0.x/server-kotlin/java/databases/list.md new file mode 100644 index 000000000..aa4d2d7b0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.list( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-big-int-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-big-int-attribute.md new file mode 100644 index 000000000..def245d7b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-big-int-attribute.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateBigIntAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + 0, // default + 0, // min (optional) + 1000000, // max (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-boolean-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-boolean-attribute.md new file mode 100644 index 000000000..c960e192e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-boolean-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateBooleanAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + false, // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-collection.md b/examples/2.0.x/server-kotlin/java/databases/update-collection.md new file mode 100644 index 000000000..4308488ed --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-collection.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<NAME>", // name (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + false, // purge (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-datetime-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-datetime-attribute.md new file mode 100644 index 000000000..a75d79b11 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-datetime-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateDatetimeAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "2020-10-15T06:38:00.000+00:00", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-document.md b/examples/2.0.x/server-kotlin/java/databases/update-document.md new file mode 100644 index 000000000..cb47ac15a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-document.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.updateDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 33, + "isAdmin", false + ), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-documents.md b/examples/2.0.x/server-kotlin/java/databases/update-documents.md new file mode 100644 index 000000000..641a69c8c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-documents.md @@ -0,0 +1,35 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 33, + "isAdmin", false + ), // data (optional) + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-email-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-email-attribute.md new file mode 100644 index 000000000..1bce2e7aa --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-email-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateEmailAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "email@example.com", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-enum-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-enum-attribute.md new file mode 100644 index 000000000..7df8304d3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-enum-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateEnumAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + List.of("active", "inactive"), // elements + false, // required + "active", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-float-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-float-attribute.md new file mode 100644 index 000000000..b8277c551 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-float-attribute.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateFloatAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + 10.5, // default + 0, // min (optional) + 100, // max (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-integer-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-integer-attribute.md new file mode 100644 index 000000000..ae0d0ccdc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-integer-attribute.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateIntegerAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + 10, // default + 0, // min (optional) + 100, // max (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-ip-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-ip-attribute.md new file mode 100644 index 000000000..c4340014c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-ip-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateIpAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "192.0.2.0", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-line-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-line-attribute.md new file mode 100644 index 000000000..38791c1d0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-line-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateLineAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6)), // default (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-longtext-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-longtext-attribute.md new file mode 100644 index 000000000..953cf4567 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-longtext-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateLongtextAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "Hello World", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..7210f8dd5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-mediumtext-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateMediumtextAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "Hello World", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-point-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-point-attribute.md new file mode 100644 index 000000000..af7601aca --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-point-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updatePointAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + List.of(1, 2), // default (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-polygon-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-polygon-attribute.md new file mode 100644 index 000000000..9a30d18eb --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-polygon-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updatePolygonAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + List.of(List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6), List.of(1, 2))), // default (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-relationship-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-relationship-attribute.md new file mode 100644 index 000000000..9bda786f0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-relationship-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; +import io.appwrite.enums.RelationMutate; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateRelationshipAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + RelationMutate.CASCADE, // onDelete (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-string-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-string-attribute.md new file mode 100644 index 000000000..49c4f9558 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-string-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateStringAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "Hello World", // default + 1, // size (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-text-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-text-attribute.md new file mode 100644 index 000000000..51c06bc4c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-text-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateTextAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "Hello World", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-transaction.md b/examples/2.0.x/server-kotlin/java/databases/update-transaction.md new file mode 100644 index 000000000..7f1918268 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-transaction.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateTransaction( + "<TRANSACTION_ID>", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-url-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-url-attribute.md new file mode 100644 index 000000000..83dfc575c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-url-attribute.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateUrlAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "https://example.com", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update-varchar-attribute.md b/examples/2.0.x/server-kotlin/java/databases/update-varchar-attribute.md new file mode 100644 index 000000000..a00d323a8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update-varchar-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateVarcharAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + false, // required + "Hello World", // default + 1, // size (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/update.md b/examples/2.0.x/server-kotlin/java/databases/update.md new file mode 100644 index 000000000..f8ad19f03 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/update.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.update( + "<DATABASE_ID>", // databaseId + "<NAME>", // name (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/upsert-document.md b/examples/2.0.x/server-kotlin/java/databases/upsert-document.md new file mode 100644 index 000000000..3f8105210 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/upsert-document.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.upsertDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/databases/upsert-documents.md b/examples/2.0.x/server-kotlin/java/databases/upsert-documents.md new file mode 100644 index 000000000..80e3862e1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/databases/upsert-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.upsertDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // documents + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/create-collection.md b/examples/2.0.x/server-kotlin/java/documentsdb/create-collection.md new file mode 100644 index 000000000..306abf693 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/create-collection.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<NAME>", // name + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + List.of(), // attributes (optional) + List.of(), // indexes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/create-document.md b/examples/2.0.x/server-kotlin/java/documentsdb/create-document.md new file mode 100644 index 000000000..9c50b9220 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/create-document.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/create-documents.md b/examples/2.0.x/server-kotlin/java/documentsdb/create-documents.md new file mode 100644 index 000000000..10058e931 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/create-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // documents + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/create-index.md b/examples/2.0.x/server-kotlin/java/documentsdb/create-index.md new file mode 100644 index 000000000..b72b576bf --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/create-index.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; +import io.appwrite.enums.DocumentsDBIndexType; +import io.appwrite.enums.OrderBy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + DocumentsDBIndexType.KEY, // type + List.of(), // attributes + List.of(OrderBy.ASC), // orders (optional) + List.of(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/create-operations.md b/examples/2.0.x/server-kotlin/java/documentsdb/create-operations.md new file mode 100644 index 000000000..b7dc4880f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/create-operations.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createOperations( + "<TRANSACTION_ID>", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "<DATABASE_ID>", + "collectionId", "<COLLECTION_ID>", + "documentId", "<DOCUMENT_ID>", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/create-transaction.md b/examples/2.0.x/server-kotlin/java/documentsdb/create-transaction.md new file mode 100644 index 000000000..1cd52e528 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/create-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/create.md b/examples/2.0.x/server-kotlin/java/documentsdb/create.md new file mode 100644 index 000000000..8c433fe83 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/create.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.create( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-kotlin/java/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..6f5803d23 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/decrement-document-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.decrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "<ATTRIBUTE>", // attribute + 1, // value (optional) + 0, // min (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/delete-collection.md b/examples/2.0.x/server-kotlin/java/documentsdb/delete-collection.md new file mode 100644 index 000000000..6953b7ef1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/delete-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/delete-document.md b/examples/2.0.x/server-kotlin/java/documentsdb/delete-document.md new file mode 100644 index 000000000..4cda79cde --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/delete-document.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/delete-documents.md b/examples/2.0.x/server-kotlin/java/documentsdb/delete-documents.md new file mode 100644 index 000000000..38acb98c3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/delete-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/delete-index.md b/examples/2.0.x/server-kotlin/java/documentsdb/delete-index.md new file mode 100644 index 000000000..be51fb948 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/delete-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/delete-transaction.md b/examples/2.0.x/server-kotlin/java/documentsdb/delete-transaction.md new file mode 100644 index 000000000..e7f4252de --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/delete-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.deleteTransaction( + "<TRANSACTION_ID>", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/delete.md b/examples/2.0.x/server-kotlin/java/documentsdb/delete.md new file mode 100644 index 000000000..31c3dd8a1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.delete( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/get-collection.md b/examples/2.0.x/server-kotlin/java/documentsdb/get-collection.md new file mode 100644 index 000000000..8622d6c86 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/get-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/get-document.md b/examples/2.0.x/server-kotlin/java/documentsdb/get-document.md new file mode 100644 index 000000000..0e75f98a5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/get-document.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/get-index.md b/examples/2.0.x/server-kotlin/java/documentsdb/get-index.md new file mode 100644 index 000000000..8484c92fb --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/get-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/get-transaction.md b/examples/2.0.x/server-kotlin/java/documentsdb/get-transaction.md new file mode 100644 index 000000000..e377bf081 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/get-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.getTransaction( + "<TRANSACTION_ID>", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/get.md b/examples/2.0.x/server-kotlin/java/documentsdb/get.md new file mode 100644 index 000000000..6aba5489b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.get( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-kotlin/java/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..9b3082fc7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/increment-document-attribute.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.incrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "<ATTRIBUTE>", // attribute + 1, // value (optional) + 100, // max (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/list-collections.md b/examples/2.0.x/server-kotlin/java/documentsdb/list-collections.md new file mode 100644 index 000000000..bca8249ea --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/list-collections.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listCollections( + "<DATABASE_ID>", // databaseId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/list-documents.md b/examples/2.0.x/server-kotlin/java/documentsdb/list-documents.md new file mode 100644 index 000000000..8cbcd8aaf --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/list-documents.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/list-indexes.md b/examples/2.0.x/server-kotlin/java/documentsdb/list-indexes.md new file mode 100644 index 000000000..9544488ae --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/list-indexes.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listIndexes( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/list-transactions.md b/examples/2.0.x/server-kotlin/java/documentsdb/list-transactions.md new file mode 100644 index 000000000..cc56f53e8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/list-transactions.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/list.md b/examples/2.0.x/server-kotlin/java/documentsdb/list.md new file mode 100644 index 000000000..0e7b2b48e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.list( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/update-collection.md b/examples/2.0.x/server-kotlin/java/documentsdb/update-collection.md new file mode 100644 index 000000000..2e29fd3d5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/update-collection.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<NAME>", // name + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + false, // purge (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/update-document.md b/examples/2.0.x/server-kotlin/java/documentsdb/update-document.md new file mode 100644 index 000000000..c1332928d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/update-document.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/update-documents.md b/examples/2.0.x/server-kotlin/java/documentsdb/update-documents.md new file mode 100644 index 000000000..8b96274cb --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/update-documents.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + Map.of("a", "b"), // data (optional) + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/update-transaction.md b/examples/2.0.x/server-kotlin/java/documentsdb/update-transaction.md new file mode 100644 index 000000000..17cd8f27b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/update-transaction.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.updateTransaction( + "<TRANSACTION_ID>", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/update.md b/examples/2.0.x/server-kotlin/java/documentsdb/update.md new file mode 100644 index 000000000..09ba4ae6e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/update.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.update( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/upsert-document.md b/examples/2.0.x/server-kotlin/java/documentsdb/upsert-document.md new file mode 100644 index 000000000..2c20c630a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/upsert-document.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.upsertDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/documentsdb/upsert-documents.md b/examples/2.0.x/server-kotlin/java/documentsdb/upsert-documents.md new file mode 100644 index 000000000..97582524b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/documentsdb/upsert-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.DocumentsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +DocumentsDB documentsDB = new DocumentsDB(client); + +documentsDB.upsertDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // documents + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/embeddings/create-text-embeddings.md b/examples/2.0.x/server-kotlin/java/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..92d9ee998 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/embeddings/create-text-embeddings.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Embeddings; +import io.appwrite.enums.EmbeddingModel; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Embeddings embeddings = new Embeddings(client); + +embeddings.createTextEmbeddings( + List.of(), // texts + EmbeddingModel.NOMIC_EMBED_TEXT, // model (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/create-deployment.md b/examples/2.0.x/server-kotlin/java/functions/create-deployment.md new file mode 100644 index 000000000..9a56935a8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/create-deployment.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createDeployment( + "<FUNCTION_ID>", // functionId + InputFile.fromPath("file.png"), // code + false, // activate + "<ENTRYPOINT>", // entrypoint (optional) + "<COMMANDS>", // commands (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/create-duplicate-deployment.md b/examples/2.0.x/server-kotlin/java/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..afb33a908 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/create-duplicate-deployment.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createDuplicateDeployment( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + "<BUILD_ID>", // buildId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/create-execution.md b/examples/2.0.x/server-kotlin/java/functions/create-execution.md new file mode 100644 index 000000000..222761eb6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/create-execution.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.ExecutionMethod; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +functions.createExecution( + "<FUNCTION_ID>", // functionId + "<BODY>", // body (optional) + false, // async (optional) + "<PATH>", // path (optional) + ExecutionMethod.GET, // method (optional) + Map.of("a", "b"), // headers (optional) + "<SCHEDULED_AT>", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/create-template-deployment.md b/examples/2.0.x/server-kotlin/java/functions/create-template-deployment.md new file mode 100644 index 000000000..1059cd5e3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/create-template-deployment.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.TemplateReferenceType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createTemplateDeployment( + "<FUNCTION_ID>", // functionId + "<REPOSITORY>", // repository + "<OWNER>", // owner + "<ROOT_DIRECTORY>", // rootDirectory + TemplateReferenceType.COMMIT, // type + "<REFERENCE>", // reference + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/create-variable.md b/examples/2.0.x/server-kotlin/java/functions/create-variable.md new file mode 100644 index 000000000..d3e41c10a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/create-variable.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createVariable( + "<FUNCTION_ID>", // functionId + "<VARIABLE_ID>", // variableId + "<KEY>", // key + "<VALUE>", // value + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/create-vcs-deployment.md b/examples/2.0.x/server-kotlin/java/functions/create-vcs-deployment.md new file mode 100644 index 000000000..94bf9dfd0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/create-vcs-deployment.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.VCSReferenceType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createVcsDeployment( + "<FUNCTION_ID>", // functionId + VCSReferenceType.BRANCH, // type + "<REFERENCE>", // reference + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/create.md b/examples/2.0.x/server-kotlin/java/functions/create.md new file mode 100644 index 000000000..a02365dc6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/create.md @@ -0,0 +1,48 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.Runtime; +import io.appwrite.enums.ProjectKeyScopes; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.create( + "<FUNCTION_ID>", // functionId + "<NAME>", // name + Runtime.NODE_14_5, // runtime + List.of("any"), // execute (optional) + List.of(), // events (optional) + "0 0 * * *", // schedule (optional) + 1, // timeout (optional) + false, // enabled (optional) + false, // logging (optional) + "<ENTRYPOINT>", // entrypoint (optional) + "<COMMANDS>", // commands (optional) + List.of(ProjectKeyScopes.PROJECT_READ), // scopes (optional) + "<INSTALLATION_ID>", // installationId (optional) + "<PROVIDER_REPOSITORY_ID>", // providerRepositoryId (optional) + "<PROVIDER_BRANCH>", // providerBranch (optional) + false, // providerSilentMode (optional) + "<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional) + List.of(), // providerBranches (optional) + List.of(), // providerPaths (optional) + "s-1vcpu-512mb", // buildSpecification (optional) + "s-1vcpu-512mb", // runtimeSpecification (optional) + 0, // deploymentRetention (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/delete-deployment.md b/examples/2.0.x/server-kotlin/java/functions/delete-deployment.md new file mode 100644 index 000000000..a7244cdbc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/delete-deployment.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.deleteDeployment( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/delete-execution.md b/examples/2.0.x/server-kotlin/java/functions/delete-execution.md new file mode 100644 index 000000000..43b556a93 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/delete-execution.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.deleteExecution( + "<FUNCTION_ID>", // functionId + "<EXECUTION_ID>", // executionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/delete-variable.md b/examples/2.0.x/server-kotlin/java/functions/delete-variable.md new file mode 100644 index 000000000..7298bb1a3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/delete-variable.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.deleteVariable( + "<FUNCTION_ID>", // functionId + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/delete.md b/examples/2.0.x/server-kotlin/java/functions/delete.md new file mode 100644 index 000000000..fabcb1a7e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.delete( + "<FUNCTION_ID>", // functionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/get-deployment-download.md b/examples/2.0.x/server-kotlin/java/functions/get-deployment-download.md new file mode 100644 index 000000000..ea9e5d886 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/get-deployment-download.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.DeploymentDownloadType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.getDeploymentDownload( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + DeploymentDownloadType.SOURCE, // type (optional) + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/get-deployment.md b/examples/2.0.x/server-kotlin/java/functions/get-deployment.md new file mode 100644 index 000000000..a6a96d142 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/get-deployment.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.getDeployment( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/get-execution.md b/examples/2.0.x/server-kotlin/java/functions/get-execution.md new file mode 100644 index 000000000..bfaabe7aa --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/get-execution.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +functions.getExecution( + "<FUNCTION_ID>", // functionId + "<EXECUTION_ID>", // executionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/get-variable.md b/examples/2.0.x/server-kotlin/java/functions/get-variable.md new file mode 100644 index 000000000..e2ff42ee5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/get-variable.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.getVariable( + "<FUNCTION_ID>", // functionId + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/get.md b/examples/2.0.x/server-kotlin/java/functions/get.md new file mode 100644 index 000000000..fb3dc8d2d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.get( + "<FUNCTION_ID>", // functionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/list-deployments.md b/examples/2.0.x/server-kotlin/java/functions/list-deployments.md new file mode 100644 index 000000000..4e0de978b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/list-deployments.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.listDeployments( + "<FUNCTION_ID>", // functionId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/list-executions.md b/examples/2.0.x/server-kotlin/java/functions/list-executions.md new file mode 100644 index 000000000..b7ab9efb0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/list-executions.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +functions.listExecutions( + "<FUNCTION_ID>", // functionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/list-runtimes.md b/examples/2.0.x/server-kotlin/java/functions/list-runtimes.md new file mode 100644 index 000000000..0a4a240c8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/list-runtimes.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.listRuntimes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/list-specifications.md b/examples/2.0.x/server-kotlin/java/functions/list-specifications.md new file mode 100644 index 000000000..7a6c7f51c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/list-specifications.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.listSpecifications( + "runtimes", // type (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/list-variables.md b/examples/2.0.x/server-kotlin/java/functions/list-variables.md new file mode 100644 index 000000000..4766fca54 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/list-variables.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.listVariables( + "<FUNCTION_ID>", // functionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/list.md b/examples/2.0.x/server-kotlin/java/functions/list.md new file mode 100644 index 000000000..b7eab3e2f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.list( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/update-deployment-status.md b/examples/2.0.x/server-kotlin/java/functions/update-deployment-status.md new file mode 100644 index 000000000..920ce4a0f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/update-deployment-status.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.updateDeploymentStatus( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/update-function-deployment.md b/examples/2.0.x/server-kotlin/java/functions/update-function-deployment.md new file mode 100644 index 000000000..363c23ab8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/update-function-deployment.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.updateFunctionDeployment( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/update-variable.md b/examples/2.0.x/server-kotlin/java/functions/update-variable.md new file mode 100644 index 000000000..fa4518f65 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/update-variable.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.updateVariable( + "<FUNCTION_ID>", // functionId + "<VARIABLE_ID>", // variableId + "<KEY>", // key (optional) + "<VALUE>", // value (optional) + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/functions/update.md b/examples/2.0.x/server-kotlin/java/functions/update.md new file mode 100644 index 000000000..30bb95586 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/functions/update.md @@ -0,0 +1,48 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.Runtime; +import io.appwrite.enums.ProjectKeyScopes; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.update( + "<FUNCTION_ID>", // functionId + "<NAME>", // name + Runtime.NODE_14_5, // runtime (optional) + List.of("any"), // execute (optional) + List.of(), // events (optional) + "0 0 * * *", // schedule (optional) + 1, // timeout (optional) + false, // enabled (optional) + false, // logging (optional) + "<ENTRYPOINT>", // entrypoint (optional) + "<COMMANDS>", // commands (optional) + List.of(ProjectKeyScopes.PROJECT_READ), // scopes (optional) + "<INSTALLATION_ID>", // installationId (optional) + "<PROVIDER_REPOSITORY_ID>", // providerRepositoryId (optional) + "<PROVIDER_BRANCH>", // providerBranch (optional) + false, // providerSilentMode (optional) + "<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional) + List.of(), // providerBranches (optional) + List.of(), // providerPaths (optional) + "s-1vcpu-512mb", // buildSpecification (optional) + "s-1vcpu-512mb", // runtimeSpecification (optional) + 0, // deploymentRetention (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/graphql/mutation.md b/examples/2.0.x/server-kotlin/java/graphql/mutation.md new file mode 100644 index 000000000..1f327de50 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/graphql/mutation.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Graphql; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Graphql graphql = new Graphql(client); + +graphql.mutation( + Map.of("a", "b"), // query + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/graphql/query.md b/examples/2.0.x/server-kotlin/java/graphql/query.md new file mode 100644 index 000000000..29ea821d6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/graphql/query.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Graphql; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Graphql graphql = new Graphql(client); + +graphql.query( + Map.of("a", "b"), // query + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/locale/get.md b/examples/2.0.x/server-kotlin/java/locale/get.md new file mode 100644 index 000000000..ce0599ebf --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/locale/get.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/locale/list-codes.md b/examples/2.0.x/server-kotlin/java/locale/list-codes.md new file mode 100644 index 000000000..25555499b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/locale/list-codes.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/locale/list-continents.md b/examples/2.0.x/server-kotlin/java/locale/list-continents.md new file mode 100644 index 000000000..f7098f332 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/locale/list-continents.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listContinents(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/locale/list-countries-eu.md b/examples/2.0.x/server-kotlin/java/locale/list-countries-eu.md new file mode 100644 index 000000000..b312639fc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/locale/list-countries-eu.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/locale/list-countries-phones.md b/examples/2.0.x/server-kotlin/java/locale/list-countries-phones.md new file mode 100644 index 000000000..aed72e0ff --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/locale/list-countries-phones.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/locale/list-countries.md b/examples/2.0.x/server-kotlin/java/locale/list-countries.md new file mode 100644 index 000000000..8eef04d63 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/locale/list-countries.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCountries(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/locale/list-currencies.md b/examples/2.0.x/server-kotlin/java/locale/list-currencies.md new file mode 100644 index 000000000..fc4ee4d9d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/locale/list-currencies.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCurrencies(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/locale/list-languages.md b/examples/2.0.x/server-kotlin/java/locale/list-languages.md new file mode 100644 index 000000000..44d101564 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/locale/list-languages.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listLanguages(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-apns-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-apns-provider.md new file mode 100644 index 000000000..134c5c96d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-apns-provider.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createAPNSProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<AUTH_KEY>", // authKey (optional) + "<AUTH_KEY_ID>", // authKeyId (optional) + "<TEAM_ID>", // teamId (optional) + "<BUNDLE_ID>", // bundleId (optional) + false, // sandbox (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-email.md b/examples/2.0.x/server-kotlin/java/messaging/create-email.md new file mode 100644 index 000000000..f347ca09f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-email.md @@ -0,0 +1,36 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createEmail( + "<MESSAGE_ID>", // messageId + "<SUBJECT>", // subject + "<CONTENT>", // content + List.of(), // topics (optional) + List.of(), // users (optional) + List.of(), // targets (optional) + List.of(), // cc (optional) + List.of(), // bcc (optional) + List.of(), // attachments (optional) + false, // draft (optional) + false, // html (optional) + "2020-10-15T06:38:00.000+00:00", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-fcm-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-fcm-provider.md new file mode 100644 index 000000000..6cd9e9ffc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-fcm-provider.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createFCMProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + Map.of("a", "b"), // serviceAccountJSON (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-mailgun-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..4ab015302 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-mailgun-provider.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createMailgunProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<API_KEY>", // apiKey (optional) + "example.com", // domain (optional) + false, // isEuRegion (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-msg-91-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..2af08cf05 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-msg-91-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createMsg91Provider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<TEMPLATE_ID>", // templateId (optional) + "<SENDER_ID>", // senderId (optional) + "<AUTH_KEY>", // authKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-push.md b/examples/2.0.x/server-kotlin/java/messaging/create-push.md new file mode 100644 index 000000000..9caac2d47 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-push.md @@ -0,0 +1,44 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; +import io.appwrite.enums.MessagePriority; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createPush( + "<MESSAGE_ID>", // messageId + "<TITLE>", // title (optional) + "<BODY>", // body (optional) + List.of(), // topics (optional) + List.of(), // users (optional) + List.of(), // targets (optional) + Map.of("a", "b"), // data (optional) + "<ACTION>", // action (optional) + "<ID1:ID2>", // image (optional) + "<ICON>", // icon (optional) + "<SOUND>", // sound (optional) + "<COLOR>", // color (optional) + "<TAG>", // tag (optional) + 1, // badge (optional) + false, // draft (optional) + "2020-10-15T06:38:00.000+00:00", // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.NORMAL, // priority (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-resend-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-resend-provider.md new file mode 100644 index 000000000..516ba4e2e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-resend-provider.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createResendProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<API_KEY>", // apiKey (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..ecb1e1bde --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-sendgrid-provider.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createSendgridProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<API_KEY>", // apiKey (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-ses-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-ses-provider.md new file mode 100644 index 000000000..c8864661b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-ses-provider.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createSesProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<ACCESS_KEY>", // accessKey (optional) + "<SECRET_KEY>", // secretKey (optional) + "<REGION>", // region (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-sms.md b/examples/2.0.x/server-kotlin/java/messaging/create-sms.md new file mode 100644 index 000000000..530bb29ca --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-sms.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createSMS( + "<MESSAGE_ID>", // messageId + "<CONTENT>", // content + List.of(), // topics (optional) + List.of(), // users (optional) + List.of(), // targets (optional) + false, // draft (optional) + "2020-10-15T06:38:00.000+00:00", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-smtp-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-smtp-provider.md new file mode 100644 index 000000000..2b0046bc4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-smtp-provider.md @@ -0,0 +1,39 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; +import io.appwrite.enums.SmtpEncryption; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createSMTPProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<HOST>", // host + 587, // port (optional) + "<USERNAME>", // username (optional) + "password", // password (optional) + SmtpEncryption.NONE, // encryption (optional) + false, // autoTLS (optional) + "<MAILER>", // mailer (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-subscriber.md b/examples/2.0.x/server-kotlin/java/messaging/create-subscriber.md new file mode 100644 index 000000000..39480c0c0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-subscriber.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>"); // Your secret JSON Web Token + +Messaging messaging = new Messaging(client); + +messaging.createSubscriber( + "<TOPIC_ID>", // topicId + "<SUBSCRIBER_ID>", // subscriberId + "<TARGET_ID>", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-telesign-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-telesign-provider.md new file mode 100644 index 000000000..87b9e1fcd --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-telesign-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createTelesignProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "+12065550100", // from (optional) + "<CUSTOMER_ID>", // customerId (optional) + "<API_KEY>", // apiKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-textmagic-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..2599ed5d3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-textmagic-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createTextmagicProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "+12065550100", // from (optional) + "<USERNAME>", // username (optional) + "<API_KEY>", // apiKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-topic.md b/examples/2.0.x/server-kotlin/java/messaging/create-topic.md new file mode 100644 index 000000000..1c9c56371 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-topic.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createTopic( + "<TOPIC_ID>", // topicId + "<NAME>", // name + List.of("any"), // subscribe (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-twilio-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-twilio-provider.md new file mode 100644 index 000000000..5078b3dbe --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-twilio-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createTwilioProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "+12065550100", // from (optional) + "<ACCOUNT_SID>", // accountSid (optional) + "<AUTH_TOKEN>", // authToken (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/create-vonage-provider.md b/examples/2.0.x/server-kotlin/java/messaging/create-vonage-provider.md new file mode 100644 index 000000000..ac269038c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/create-vonage-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createVonageProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "+12065550100", // from (optional) + "<API_KEY>", // apiKey (optional) + "<API_SECRET>", // apiSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/delete-provider.md b/examples/2.0.x/server-kotlin/java/messaging/delete-provider.md new file mode 100644 index 000000000..0136e9dc1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/delete-provider.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.deleteProvider( + "<PROVIDER_ID>", // providerId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/delete-subscriber.md b/examples/2.0.x/server-kotlin/java/messaging/delete-subscriber.md new file mode 100644 index 000000000..265a70ba7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/delete-subscriber.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>"); // Your secret JSON Web Token + +Messaging messaging = new Messaging(client); + +messaging.deleteSubscriber( + "<TOPIC_ID>", // topicId + "<SUBSCRIBER_ID>", // subscriberId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/delete-topic.md b/examples/2.0.x/server-kotlin/java/messaging/delete-topic.md new file mode 100644 index 000000000..aee64733c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/delete-topic.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.deleteTopic( + "<TOPIC_ID>", // topicId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/delete.md b/examples/2.0.x/server-kotlin/java/messaging/delete.md new file mode 100644 index 000000000..7585a4867 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.delete( + "<MESSAGE_ID>", // messageId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/get-message.md b/examples/2.0.x/server-kotlin/java/messaging/get-message.md new file mode 100644 index 000000000..846e881e4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/get-message.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.getMessage( + "<MESSAGE_ID>", // messageId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/get-provider.md b/examples/2.0.x/server-kotlin/java/messaging/get-provider.md new file mode 100644 index 000000000..4d68108b3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/get-provider.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.getProvider( + "<PROVIDER_ID>", // providerId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/get-subscriber.md b/examples/2.0.x/server-kotlin/java/messaging/get-subscriber.md new file mode 100644 index 000000000..01137147b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/get-subscriber.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.getSubscriber( + "<TOPIC_ID>", // topicId + "<SUBSCRIBER_ID>", // subscriberId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/get-topic.md b/examples/2.0.x/server-kotlin/java/messaging/get-topic.md new file mode 100644 index 000000000..d1e9693a6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/get-topic.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.getTopic( + "<TOPIC_ID>", // topicId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/list-messages.md b/examples/2.0.x/server-kotlin/java/messaging/list-messages.md new file mode 100644 index 000000000..060d166ad --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/list-messages.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listMessages( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/list-providers.md b/examples/2.0.x/server-kotlin/java/messaging/list-providers.md new file mode 100644 index 000000000..40abdc4e4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/list-providers.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listProviders( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/list-subscribers.md b/examples/2.0.x/server-kotlin/java/messaging/list-subscribers.md new file mode 100644 index 000000000..e7eb27c8c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/list-subscribers.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listSubscribers( + "<TOPIC_ID>", // topicId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/list-targets.md b/examples/2.0.x/server-kotlin/java/messaging/list-targets.md new file mode 100644 index 000000000..f40902d32 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/list-targets.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listTargets( + "<MESSAGE_ID>", // messageId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/list-topics.md b/examples/2.0.x/server-kotlin/java/messaging/list-topics.md new file mode 100644 index 000000000..de91ffdba --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/list-topics.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listTopics( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-apns-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-apns-provider.md new file mode 100644 index 000000000..daebea076 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-apns-provider.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateAPNSProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<AUTH_KEY>", // authKey (optional) + "<AUTH_KEY_ID>", // authKeyId (optional) + "<TEAM_ID>", // teamId (optional) + "<BUNDLE_ID>", // bundleId (optional) + false, // sandbox (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-email.md b/examples/2.0.x/server-kotlin/java/messaging/update-email.md new file mode 100644 index 000000000..0ca5c23c6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-email.md @@ -0,0 +1,36 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateEmail( + "<MESSAGE_ID>", // messageId + List.of(), // topics (optional) + List.of(), // users (optional) + List.of(), // targets (optional) + "<SUBJECT>", // subject (optional) + "<CONTENT>", // content (optional) + false, // draft (optional) + false, // html (optional) + List.of(), // cc (optional) + List.of(), // bcc (optional) + "2020-10-15T06:38:00.000+00:00", // scheduledAt (optional) + List.of(), // attachments (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-fcm-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-fcm-provider.md new file mode 100644 index 000000000..1b9f694c9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-fcm-provider.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateFCMProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + Map.of("a", "b"), // serviceAccountJSON (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-mailgun-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..329a8587a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-mailgun-provider.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateMailgunProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + "<API_KEY>", // apiKey (optional) + "example.com", // domain (optional) + false, // isEuRegion (optional) + false, // enabled (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "<REPLY_TO_EMAIL>", // replyToEmail (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-msg-91-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..c25e7e3ce --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-msg-91-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateMsg91Provider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<TEMPLATE_ID>", // templateId (optional) + "<SENDER_ID>", // senderId (optional) + "<AUTH_KEY>", // authKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-push.md b/examples/2.0.x/server-kotlin/java/messaging/update-push.md new file mode 100644 index 000000000..263dfaab1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-push.md @@ -0,0 +1,44 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; +import io.appwrite.enums.MessagePriority; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updatePush( + "<MESSAGE_ID>", // messageId + List.of(), // topics (optional) + List.of(), // users (optional) + List.of(), // targets (optional) + "<TITLE>", // title (optional) + "<BODY>", // body (optional) + Map.of("a", "b"), // data (optional) + "<ACTION>", // action (optional) + "<ID1:ID2>", // image (optional) + "<ICON>", // icon (optional) + "<SOUND>", // sound (optional) + "<COLOR>", // color (optional) + "<TAG>", // tag (optional) + 1, // badge (optional) + false, // draft (optional) + "2020-10-15T06:38:00.000+00:00", // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.NORMAL, // priority (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-resend-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-resend-provider.md new file mode 100644 index 000000000..16b61b7bc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-resend-provider.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateResendProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<API_KEY>", // apiKey (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "<REPLY_TO_EMAIL>", // replyToEmail (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..bb90a433c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-sendgrid-provider.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateSendgridProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<API_KEY>", // apiKey (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "<REPLY_TO_EMAIL>", // replyToEmail (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-ses-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-ses-provider.md new file mode 100644 index 000000000..0d0fc5c01 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-ses-provider.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateSesProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<ACCESS_KEY>", // accessKey (optional) + "<SECRET_KEY>", // secretKey (optional) + "<REGION>", // region (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "<REPLY_TO_EMAIL>", // replyToEmail (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-sms.md b/examples/2.0.x/server-kotlin/java/messaging/update-sms.md new file mode 100644 index 000000000..808be650a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-sms.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateSMS( + "<MESSAGE_ID>", // messageId + List.of(), // topics (optional) + List.of(), // users (optional) + List.of(), // targets (optional) + "<CONTENT>", // content (optional) + false, // draft (optional) + "2020-10-15T06:38:00.000+00:00", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-smtp-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-smtp-provider.md new file mode 100644 index 000000000..70a017c9b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-smtp-provider.md @@ -0,0 +1,39 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; +import io.appwrite.enums.SmtpEncryption; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateSMTPProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + "<HOST>", // host (optional) + 1, // port (optional) + "<USERNAME>", // username (optional) + "password", // password (optional) + SmtpEncryption.NONE, // encryption (optional) + false, // autoTLS (optional) + "<MAILER>", // mailer (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "<REPLY_TO_EMAIL>", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-telesign-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-telesign-provider.md new file mode 100644 index 000000000..fef04fe0b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-telesign-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateTelesignProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<CUSTOMER_ID>", // customerId (optional) + "<API_KEY>", // apiKey (optional) + "<FROM>", // from (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-textmagic-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..0068564cf --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-textmagic-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateTextmagicProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<USERNAME>", // username (optional) + "<API_KEY>", // apiKey (optional) + "<FROM>", // from (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-topic.md b/examples/2.0.x/server-kotlin/java/messaging/update-topic.md new file mode 100644 index 000000000..b1617441b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-topic.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateTopic( + "<TOPIC_ID>", // topicId + "<NAME>", // name (optional) + List.of("any"), // subscribe (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-twilio-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-twilio-provider.md new file mode 100644 index 000000000..36e44fa22 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-twilio-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateTwilioProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<ACCOUNT_SID>", // accountSid (optional) + "<AUTH_TOKEN>", // authToken (optional) + "<FROM>", // from (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/messaging/update-vonage-provider.md b/examples/2.0.x/server-kotlin/java/messaging/update-vonage-provider.md new file mode 100644 index 000000000..549bcce2e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/messaging/update-vonage-provider.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateVonageProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<API_KEY>", // apiKey (optional) + "<API_SECRET>", // apiSecret (optional) + "<FROM>", // from (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/organization/create-project.md b/examples/2.0.x/server-kotlin/java/organization/create-project.md new file mode 100644 index 000000000..a9745aac9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/organization/create-project.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organization; +import io.appwrite.enums.Region; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +organization.createProject( + "<PROJECT_ID>", // projectId + "<NAME>", // name + Region.DEFAULT, // region (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/organization/delete-project.md b/examples/2.0.x/server-kotlin/java/organization/delete-project.md new file mode 100644 index 000000000..fd4595ad9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/organization/delete-project.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organization; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +organization.deleteProject( + "<PROJECT_ID>", // projectId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/organization/get-project.md b/examples/2.0.x/server-kotlin/java/organization/get-project.md new file mode 100644 index 000000000..f291153a5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/organization/get-project.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organization; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +organization.getProject( + "<PROJECT_ID>", // projectId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/organization/list-projects.md b/examples/2.0.x/server-kotlin/java/organization/list-projects.md new file mode 100644 index 000000000..ee6e14afc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/organization/list-projects.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organization; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +organization.listProjects( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/organization/update-project.md b/examples/2.0.x/server-kotlin/java/organization/update-project.md new file mode 100644 index 000000000..b39fe3917 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/organization/update-project.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Organization; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Organization organization = new Organization(client); + +organization.updateProject( + "<PROJECT_ID>", // projectId + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/presences/delete.md b/examples/2.0.x/server-kotlin/java/presences/delete.md new file mode 100644 index 000000000..5c797c21a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/presences/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Presences; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +presences.delete( + "<PRESENCE_ID>", // presenceId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/presences/get.md b/examples/2.0.x/server-kotlin/java/presences/get.md new file mode 100644 index 000000000..17868cec8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/presences/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Presences; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +presences.get( + "<PRESENCE_ID>", // presenceId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/presences/list.md b/examples/2.0.x/server-kotlin/java/presences/list.md new file mode 100644 index 000000000..b43741d29 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/presences/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Presences; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +presences.list( + List.of(), // queries (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/presences/update.md b/examples/2.0.x/server-kotlin/java/presences/update.md new file mode 100644 index 000000000..57cce92e2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/presences/update.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Presences; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +presences.update( + "<PRESENCE_ID>", // presenceId + "<USER_ID>", // userId + "<STATUS>", // status (optional) + "2020-10-15T06:38:00.000+00:00", // expiresAt (optional) + Map.of("a", "b"), // metadata (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + false, // purge (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/presences/upsert.md b/examples/2.0.x/server-kotlin/java/presences/upsert.md new file mode 100644 index 000000000..df15d7080 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/presences/upsert.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Presences; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Presences presences = new Presences(client); + +presences.upsert( + "<PRESENCE_ID>", // presenceId + "<USER_ID>", // userId + "<STATUS>", // status + List.of(Permission.read(Role.any())), // permissions (optional) + "2020-10-15T06:38:00.000+00:00", // expiresAt (optional) + Map.of("a", "b"), // metadata (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-android-platform.md b/examples/2.0.x/server-kotlin/java/project/create-android-platform.md new file mode 100644 index 000000000..61281f1c5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-android-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createAndroidPlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "<APPLICATION_ID>", // applicationId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-apple-platform.md b/examples/2.0.x/server-kotlin/java/project/create-apple-platform.md new file mode 100644 index 000000000..1e60e28ca --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-apple-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createApplePlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "<BUNDLE_IDENTIFIER>", // bundleIdentifier + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-ephemeral-key.md b/examples/2.0.x/server-kotlin/java/project/create-ephemeral-key.md new file mode 100644 index 000000000..545e16d25 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-ephemeral-key.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectKeyScopes; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createEphemeralKey( + List.of(ProjectKeyScopes.PROJECT_READ), // scopes + 600, // duration + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-linux-platform.md b/examples/2.0.x/server-kotlin/java/project/create-linux-platform.md new file mode 100644 index 000000000..0b3355b31 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-linux-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createLinuxPlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "<PACKAGE_NAME>", // packageName + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-mock-phone.md b/examples/2.0.x/server-kotlin/java/project/create-mock-phone.md new file mode 100644 index 000000000..44acac492 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-mock-phone.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createMockPhone( + "+12065550100", // number + "<OTP>", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-smtp-test.md b/examples/2.0.x/server-kotlin/java/project/create-smtp-test.md new file mode 100644 index 000000000..e6a700663 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-smtp-test.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createSMTPTest( + List.of(), // emails + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-variable.md b/examples/2.0.x/server-kotlin/java/project/create-variable.md new file mode 100644 index 000000000..62d7a4741 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-variable.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createVariable( + "<VARIABLE_ID>", // variableId + "<KEY>", // key + "<VALUE>", // value + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-web-platform.md b/examples/2.0.x/server-kotlin/java/project/create-web-platform.md new file mode 100644 index 000000000..efd4399cc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-web-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createWebPlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "app.example.com", // hostname + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/create-windows-platform.md b/examples/2.0.x/server-kotlin/java/project/create-windows-platform.md new file mode 100644 index 000000000..a38b79e43 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/create-windows-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.createWindowsPlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "<PACKAGE_IDENTIFIER_NAME>", // packageIdentifierName + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/delete-key.md b/examples/2.0.x/server-kotlin/java/project/delete-key.md new file mode 100644 index 000000000..e0104face --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/delete-key.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.deleteKey( + "<KEY_ID>", // keyId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/delete-mock-phone.md b/examples/2.0.x/server-kotlin/java/project/delete-mock-phone.md new file mode 100644 index 000000000..45bab07db --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/delete-mock-phone.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.deleteMockPhone( + "+12065550100", // number + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/delete-platform.md b/examples/2.0.x/server-kotlin/java/project/delete-platform.md new file mode 100644 index 000000000..93b15c9a3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/delete-platform.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.deletePlatform( + "<PLATFORM_ID>", // platformId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/delete-variable.md b/examples/2.0.x/server-kotlin/java/project/delete-variable.md new file mode 100644 index 000000000..98ff61de2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/delete-variable.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.deleteVariable( + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/delete.md b/examples/2.0.x/server-kotlin/java/project/delete.md new file mode 100644 index 000000000..14b750998 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/delete.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.delete(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/project/get-email-template.md b/examples/2.0.x/server-kotlin/java/project/get-email-template.md new file mode 100644 index 000000000..ee1e3811f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/get-email-template.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectEmailTemplateId; +import io.appwrite.enums.ProjectEmailTemplateLocale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.getEmailTemplate( + ProjectEmailTemplateId.VERIFICATION, // templateId + ProjectEmailTemplateLocale.AF, // locale (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/get-key.md b/examples/2.0.x/server-kotlin/java/project/get-key.md new file mode 100644 index 000000000..23021b3f1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/get-key.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.getKey( + "<KEY_ID>", // keyId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/get-mock-phone.md b/examples/2.0.x/server-kotlin/java/project/get-mock-phone.md new file mode 100644 index 000000000..3c7c98478 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/get-mock-phone.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.getMockPhone( + "+12065550100", // number + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/get-o-auth-2-provider.md b/examples/2.0.x/server-kotlin/java/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..cf3f9636d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/get-o-auth-2-provider.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectOAuthProviderId; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.getOAuth2Provider( + ProjectOAuthProviderId.AMAZON, // providerId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/get-platform.md b/examples/2.0.x/server-kotlin/java/project/get-platform.md new file mode 100644 index 000000000..5eef86970 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/get-platform.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.getPlatform( + "<PLATFORM_ID>", // platformId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/get-policy.md b/examples/2.0.x/server-kotlin/java/project/get-policy.md new file mode 100644 index 000000000..9252383f0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/get-policy.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectPolicyId; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.getPolicy( + ProjectPolicyId.PASSWORD_DICTIONARY, // policyId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/get-variable.md b/examples/2.0.x/server-kotlin/java/project/get-variable.md new file mode 100644 index 000000000..f922e278b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/get-variable.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.getVariable( + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/get.md b/examples/2.0.x/server-kotlin/java/project/get.md new file mode 100644 index 000000000..125c5bf5e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/get.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/project/list-email-templates.md b/examples/2.0.x/server-kotlin/java/project/list-email-templates.md new file mode 100644 index 000000000..98fb6835f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/list-email-templates.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.listEmailTemplates( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/list-keys.md b/examples/2.0.x/server-kotlin/java/project/list-keys.md new file mode 100644 index 000000000..30dfcccd3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/list-keys.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.listKeys( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/list-mock-phones.md b/examples/2.0.x/server-kotlin/java/project/list-mock-phones.md new file mode 100644 index 000000000..9bcdde7aa --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/list-mock-phones.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.listMockPhones( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/list-o-auth-2-providers.md b/examples/2.0.x/server-kotlin/java/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..f68278a4b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/list-o-auth-2-providers.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.listOAuth2Providers( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/list-platforms.md b/examples/2.0.x/server-kotlin/java/project/list-platforms.md new file mode 100644 index 000000000..6287ee5b2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/list-platforms.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.listPlatforms( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/list-policies.md b/examples/2.0.x/server-kotlin/java/project/list-policies.md new file mode 100644 index 000000000..91757f4e3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/list-policies.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.listPolicies( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/list-variables.md b/examples/2.0.x/server-kotlin/java/project/list-variables.md new file mode 100644 index 000000000..bfcfbd696 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/list-variables.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.listVariables( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-android-platform.md b/examples/2.0.x/server-kotlin/java/project/update-android-platform.md new file mode 100644 index 000000000..96a6dc211 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-android-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateAndroidPlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "<APPLICATION_ID>", // applicationId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-apple-platform.md b/examples/2.0.x/server-kotlin/java/project/update-apple-platform.md new file mode 100644 index 000000000..85c140326 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-apple-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateApplePlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "<BUNDLE_IDENTIFIER>", // bundleIdentifier + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-auth-method.md b/examples/2.0.x/server-kotlin/java/project/update-auth-method.md new file mode 100644 index 000000000..cc05ab051 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-auth-method.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectAuthMethodId; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateAuthMethod( + ProjectAuthMethodId.EMAIL_PASSWORD, // methodId + false, // enabled + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-email-template.md b/examples/2.0.x/server-kotlin/java/project/update-email-template.md new file mode 100644 index 000000000..b0b2302f5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-email-template.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectEmailTemplateId; +import io.appwrite.enums.ProjectEmailTemplateLocale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateEmailTemplate( + ProjectEmailTemplateId.VERIFICATION, // templateId + ProjectEmailTemplateLocale.AF, // locale (optional) + "<SUBJECT>", // subject (optional) + "<MESSAGE>", // message (optional) + "<SENDER_NAME>", // senderName (optional) + "email@example.com", // senderEmail (optional) + "email@example.com", // replyToEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-key.md b/examples/2.0.x/server-kotlin/java/project/update-key.md new file mode 100644 index 000000000..4fa79bbbb --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-key.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectKeyScopes; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateKey( + "<KEY_ID>", // keyId + "<NAME>", // name + List.of(ProjectKeyScopes.PROJECT_READ), // scopes + "2020-10-15T06:38:00.000+00:00", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-labels.md b/examples/2.0.x/server-kotlin/java/project/update-labels.md new file mode 100644 index 000000000..c8c9e1bce --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-labels.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateLabels( + List.of(), // labels + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-linux-platform.md b/examples/2.0.x/server-kotlin/java/project/update-linux-platform.md new file mode 100644 index 000000000..589ed969f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-linux-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateLinuxPlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "<PACKAGE_NAME>", // packageName + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-membership-privacy-policy.md b/examples/2.0.x/server-kotlin/java/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..04f9daab6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-membership-privacy-policy.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateMembershipPrivacyPolicy( + false, // userId (optional) + false, // userEmail (optional) + false, // userPhone (optional) + false, // userName (optional) + false, // userMFA (optional) + false, // userAccessedAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-mfa-factors-policy.md b/examples/2.0.x/server-kotlin/java/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..24b35d06c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-mfa-factors-policy.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateMFAFactorsPolicy( + false, // totp (optional) + false, // email (optional) + false, // phone (optional) + false, // custom (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-mock-phone.md b/examples/2.0.x/server-kotlin/java/project/update-mock-phone.md new file mode 100644 index 000000000..adc75fb9c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-mock-phone.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateMockPhone( + "+12065550100", // number + "<OTP>", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..b58b0114b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-amazon.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Amazon( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-apple.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..9eeb9dd8a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-apple.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Apple( + "<SERVICE_ID>", // serviceId (optional) + "<KEY_ID>", // keyId (optional) + "<TEAM_ID>", // teamId (optional) + "<P8_FILE>", // p8File (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..d54371801 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-appwrite.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Appwrite( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..c14a8ef5f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-auth-0.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Auth0( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + "<ENDPOINT>", // endpoint (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..cfbe273a5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-authentik.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Authentik( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + "<ENDPOINT>", // endpoint (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..605750d31 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-autodesk.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Autodesk( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..6fe51fd80 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Bitbucket( + "<KEY>", // key (optional) + "<SECRET>", // secret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..a3c14ddc9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-bitly.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Bitly( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-box.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-box.md new file mode 100644 index 000000000..03418f17e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-box.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Box( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..49893a007 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Cloudflare( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..0db1d9a05 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Dailymotion( + "<API_KEY>", // apiKey (optional) + "<API_SECRET>", // apiSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-discord.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..82139314b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-discord.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Discord( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..d29dc872a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-disqus.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Disqus( + "<PUBLIC_KEY>", // publicKey (optional) + "<SECRET_KEY>", // secretKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..0545a5817 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-dropbox.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Dropbox( + "<APP_KEY>", // appKey (optional) + "<APP_SECRET>", // appSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..9e64828ae --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-etsy.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Etsy( + "<KEY_STRING>", // keyString (optional) + "<SHARED_SECRET>", // sharedSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..abfc06375 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-facebook.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Facebook( + "<APP_ID>", // appId (optional) + "<APP_SECRET>", // appSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-figma.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..df58f04bc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-figma.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Figma( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..ae251db37 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2FusionAuth( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + "<ENDPOINT>", // endpoint (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..e795770a5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-git-hub.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2GitHub( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..f61e79736 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-gitlab.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Gitlab( + "<APPLICATION_ID>", // applicationId (optional) + "<SECRET>", // secret (optional) + "https://example.com", // endpoint (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-google.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-google.md new file mode 100644 index 000000000..19b22f9d7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-google.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectOAuth2GooglePrompt; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Google( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + List.of(ProjectOAuth2GooglePrompt.NONE), // prompt (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..6716eb50f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2HuggingFace( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..bf5e16f70 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-keycloak.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Keycloak( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + "<ENDPOINT>", // endpoint (optional) + "<REALM_NAME>", // realmName (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-kick.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..9c771b89f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-kick.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Kick( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..4f7db46a2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-linkedin.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Linkedin( + "<CLIENT_ID>", // clientId (optional) + "<PRIMARY_CLIENT_SECRET>", // primaryClientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..801cc7c8a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-microsoft.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Microsoft( + "<APPLICATION_ID>", // applicationId (optional) + "<APPLICATION_SECRET>", // applicationSecret (optional) + "<TENANT>", // tenant (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-notion.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..6f898dbe9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-notion.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Notion( + "<OAUTH_CLIENT_ID>", // oauthClientId (optional) + "<OAUTH_CLIENT_SECRET>", // oauthClientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..033173877 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-oidc.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectOAuth2OidcPrompt; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Oidc( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + "https://example.com", // wellKnownURL (optional) + "https://example.com", // authorizationURL (optional) + "https://example.com", // tokenURL (optional) + "https://example.com", // userInfoURL (optional) + List.of(ProjectOAuth2OidcPrompt.NONE), // prompt (optional) + 0, // maxAge (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-okta.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..588894314 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-okta.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Okta( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + "example.com", // domain (optional) + "<AUTHORIZATION_SERVER_ID>", // authorizationServerId (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..2e1b8a5d2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2PaypalSandbox( + "<CLIENT_ID>", // clientId (optional) + "<SECRET_KEY>", // secretKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..6169ad05a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-paypal.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Paypal( + "<CLIENT_ID>", // clientId (optional) + "<SECRET_KEY>", // secretKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-podio.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..40da7cabd --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-podio.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Podio( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-resend.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..dca02bcd5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-resend.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Resend( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..e6aa570af --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-salesforce.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Salesforce( + "<CUSTOMER_KEY>", // customerKey (optional) + "<CUSTOMER_SECRET>", // customerSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-slack.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..c62f48bca --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-slack.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Slack( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..85eef6a3a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-spotify.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Spotify( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..c6c8a7357 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-stripe.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Stripe( + "<CLIENT_ID>", // clientId (optional) + "<API_SECRET_KEY>", // apiSecretKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..ca9f55c03 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2TradeshiftSandbox( + "<OAUTH2_CLIENT_ID>", // oauth2ClientId (optional) + "<OAUTH2_CLIENT_SECRET>", // oauth2ClientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..9ab62a476 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Tradeshift( + "<OAUTH2_CLIENT_ID>", // oauth2ClientId (optional) + "<OAUTH2_CLIENT_SECRET>", // oauth2ClientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..4bc43d006 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-twitch.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Twitch( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..06a9745a7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-word-press.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2WordPress( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..db93ec6e7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-yahoo.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Yahoo( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..cf4c4500e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-yandex.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Yandex( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..c8c5e1362 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-zoho.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Zoho( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..b809dc018 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2-zoom.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2Zoom( + "<CLIENT_ID>", // clientId (optional) + "<CLIENT_SECRET>", // clientSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-o-auth-2x.md b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2x.md new file mode 100644 index 000000000..d59ea9806 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-o-auth-2x.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateOAuth2X( + "<CUSTOMER_KEY>", // customerKey (optional) + "<SECRET_KEY>", // secretKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-password-dictionary-policy.md b/examples/2.0.x/server-kotlin/java/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..27879b99e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-password-dictionary-policy.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updatePasswordDictionaryPolicy( + false, // enabled + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-password-history-policy.md b/examples/2.0.x/server-kotlin/java/project/update-password-history-policy.md new file mode 100644 index 000000000..e873c7f8f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-password-history-policy.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updatePasswordHistoryPolicy( + 1, // total + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-password-personal-data-policy.md b/examples/2.0.x/server-kotlin/java/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..15c277ebd --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-password-personal-data-policy.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updatePasswordPersonalDataPolicy( + false, // enabled + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-password-strength-policy.md b/examples/2.0.x/server-kotlin/java/project/update-password-strength-policy.md new file mode 100644 index 000000000..a147d52d8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-password-strength-policy.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updatePasswordStrengthPolicy( + 8, // min (optional) + false, // uppercase (optional) + false, // lowercase (optional) + false, // number (optional) + false, // symbols (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-protocol.md b/examples/2.0.x/server-kotlin/java/project/update-protocol.md new file mode 100644 index 000000000..0ef3ace0a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-protocol.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectProtocolId; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateProtocol( + ProjectProtocolId.REST, // protocolId + false, // enabled + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-service.md b/examples/2.0.x/server-kotlin/java/project/update-service.md new file mode 100644 index 000000000..663fdd04b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-service.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectServiceId; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateService( + ProjectServiceId.ACCOUNT, // serviceId + false, // enabled + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-session-alert-policy.md b/examples/2.0.x/server-kotlin/java/project/update-session-alert-policy.md new file mode 100644 index 000000000..6e7418e18 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-session-alert-policy.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateSessionAlertPolicy( + false, // enabled + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-session-duration-policy.md b/examples/2.0.x/server-kotlin/java/project/update-session-duration-policy.md new file mode 100644 index 000000000..47c3f3be3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-session-duration-policy.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateSessionDurationPolicy( + 60, // duration + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-session-invalidation-policy.md b/examples/2.0.x/server-kotlin/java/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..4a8efa7c7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-session-invalidation-policy.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateSessionInvalidationPolicy( + false, // enabled + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-session-limit-policy.md b/examples/2.0.x/server-kotlin/java/project/update-session-limit-policy.md new file mode 100644 index 000000000..13204c06c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-session-limit-policy.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateSessionLimitPolicy( + 1, // total + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-smtp.md b/examples/2.0.x/server-kotlin/java/project/update-smtp.md new file mode 100644 index 000000000..04a01b711 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-smtp.md @@ -0,0 +1,35 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; +import io.appwrite.enums.ProjectSMTPSecure; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateSMTP( + "example.com", // host (optional) + 587, // port (optional) + "<USERNAME>", // username (optional) + "password", // password (optional) + "email@example.com", // senderEmail (optional) + "<SENDER_NAME>", // senderName (optional) + "email@example.com", // replyToEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + ProjectSMTPSecure.TLS, // secure (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-user-limit-policy.md b/examples/2.0.x/server-kotlin/java/project/update-user-limit-policy.md new file mode 100644 index 000000000..4e0a99343 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-user-limit-policy.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateUserLimitPolicy( + 0, // total + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-variable.md b/examples/2.0.x/server-kotlin/java/project/update-variable.md new file mode 100644 index 000000000..19e7d88c1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-variable.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateVariable( + "<VARIABLE_ID>", // variableId + "<KEY>", // key (optional) + "<VALUE>", // value (optional) + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-web-platform.md b/examples/2.0.x/server-kotlin/java/project/update-web-platform.md new file mode 100644 index 000000000..8de452f59 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-web-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateWebPlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "app.example.com", // hostname + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/project/update-windows-platform.md b/examples/2.0.x/server-kotlin/java/project/update-windows-platform.md new file mode 100644 index 000000000..c7fa06e39 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/project/update-windows-platform.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Project; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Project project = new Project(client); + +project.updateWindowsPlatform( + "<PLATFORM_ID>", // platformId + "<NAME>", // name + "<PACKAGE_IDENTIFIER_NAME>", // packageIdentifierName + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/proxy/create-api-rule.md b/examples/2.0.x/server-kotlin/java/proxy/create-api-rule.md new file mode 100644 index 000000000..6b9413c3c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/proxy/create-api-rule.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Proxy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +proxy.createAPIRule( + "example.com", // domain + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/proxy/create-function-rule.md b/examples/2.0.x/server-kotlin/java/proxy/create-function-rule.md new file mode 100644 index 000000000..9c2e8d755 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/proxy/create-function-rule.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Proxy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +proxy.createFunctionRule( + "example.com", // domain + "<FUNCTION_ID>", // functionId + "<BRANCH>", // branch (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/proxy/create-redirect-rule.md b/examples/2.0.x/server-kotlin/java/proxy/create-redirect-rule.md new file mode 100644 index 000000000..1841e3752 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/proxy/create-redirect-rule.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Proxy; +import io.appwrite.enums.StatusCode; +import io.appwrite.enums.ProxyResourceType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +proxy.createRedirectRule( + "example.com", // domain + "https://example.com", // url + StatusCode.MOVEDPERMANENTLY, // statusCode + "<RESOURCE_ID>", // resourceId + ProxyResourceType.SITE, // resourceType + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/proxy/create-site-rule.md b/examples/2.0.x/server-kotlin/java/proxy/create-site-rule.md new file mode 100644 index 000000000..c4add803c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/proxy/create-site-rule.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Proxy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +proxy.createSiteRule( + "example.com", // domain + "<SITE_ID>", // siteId + "<BRANCH>", // branch (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/proxy/delete-rule.md b/examples/2.0.x/server-kotlin/java/proxy/delete-rule.md new file mode 100644 index 000000000..26d79f09d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/proxy/delete-rule.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Proxy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +proxy.deleteRule( + "<RULE_ID>", // ruleId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/proxy/get-rule.md b/examples/2.0.x/server-kotlin/java/proxy/get-rule.md new file mode 100644 index 000000000..ecb354fac --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/proxy/get-rule.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Proxy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +proxy.getRule( + "<RULE_ID>", // ruleId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/proxy/list-rules.md b/examples/2.0.x/server-kotlin/java/proxy/list-rules.md new file mode 100644 index 000000000..3936ed5f7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/proxy/list-rules.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Proxy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +proxy.listRules( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/proxy/update-rule-status.md b/examples/2.0.x/server-kotlin/java/proxy/update-rule-status.md new file mode 100644 index 000000000..c4c530893 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/proxy/update-rule-status.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Proxy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Proxy proxy = new Proxy(client); + +proxy.updateRuleStatus( + "<RULE_ID>", // ruleId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/create-deployment.md b/examples/2.0.x/server-kotlin/java/sites/create-deployment.md new file mode 100644 index 000000000..1301c3415 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/create-deployment.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createDeployment( + "<SITE_ID>", // siteId + InputFile.fromPath("file.png"), // code + "<INSTALL_COMMAND>", // installCommand (optional) + "<BUILD_COMMAND>", // buildCommand (optional) + "<OUTPUT_DIRECTORY>", // outputDirectory (optional) + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/create-duplicate-deployment.md b/examples/2.0.x/server-kotlin/java/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..06d41d2dc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/create-duplicate-deployment.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createDuplicateDeployment( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/create-template-deployment.md b/examples/2.0.x/server-kotlin/java/sites/create-template-deployment.md new file mode 100644 index 000000000..13077648d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/create-template-deployment.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.TemplateReferenceType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createTemplateDeployment( + "<SITE_ID>", // siteId + "<REPOSITORY>", // repository + "<OWNER>", // owner + "<ROOT_DIRECTORY>", // rootDirectory + TemplateReferenceType.BRANCH, // type + "<REFERENCE>", // reference + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/create-variable.md b/examples/2.0.x/server-kotlin/java/sites/create-variable.md new file mode 100644 index 000000000..e7748b8c5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/create-variable.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createVariable( + "<SITE_ID>", // siteId + "<VARIABLE_ID>", // variableId + "<KEY>", // key + "<VALUE>", // value + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/create-vcs-deployment.md b/examples/2.0.x/server-kotlin/java/sites/create-vcs-deployment.md new file mode 100644 index 000000000..529fab34d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/create-vcs-deployment.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.VCSReferenceType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createVcsDeployment( + "<SITE_ID>", // siteId + VCSReferenceType.BRANCH, // type + "<REFERENCE>", // reference + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/create.md b/examples/2.0.x/server-kotlin/java/sites/create.md new file mode 100644 index 000000000..fb154d30a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/create.md @@ -0,0 +1,52 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.Framework; +import io.appwrite.enums.BuildRuntime; +import io.appwrite.enums.Adapter; +import io.appwrite.enums.ProjectKeyScopes; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.create( + "<SITE_ID>", // siteId + "<NAME>", // name + Framework.ANALOG, // framework + BuildRuntime.NODE_14_5, // buildRuntime + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + "<INSTALL_COMMAND>", // installCommand (optional) + "<BUILD_COMMAND>", // buildCommand (optional) + "<START_COMMAND>", // startCommand (optional) + "<OUTPUT_DIRECTORY>", // outputDirectory (optional) + Adapter.STATIC, // adapter (optional) + "<INSTALLATION_ID>", // installationId (optional) + "<FALLBACK_FILE>", // fallbackFile (optional) + "<PROVIDER_REPOSITORY_ID>", // providerRepositoryId (optional) + "<PROVIDER_BRANCH>", // providerBranch (optional) + false, // providerSilentMode (optional) + "<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional) + List.of(), // providerBranches (optional) + List.of(), // providerPaths (optional) + "s-1vcpu-512mb", // buildSpecification (optional) + "s-1vcpu-512mb", // runtimeSpecification (optional) + 0, // deploymentRetention (optional) + List.of(ProjectKeyScopes.PROJECT_READ), // scopes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/delete-deployment.md b/examples/2.0.x/server-kotlin/java/sites/delete-deployment.md new file mode 100644 index 000000000..90d36bf3e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/delete-deployment.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteDeployment( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/delete-log.md b/examples/2.0.x/server-kotlin/java/sites/delete-log.md new file mode 100644 index 000000000..af696c141 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/delete-log.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteLog( + "<SITE_ID>", // siteId + "<LOG_ID>", // logId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/delete-variable.md b/examples/2.0.x/server-kotlin/java/sites/delete-variable.md new file mode 100644 index 000000000..b63a81c01 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/delete-variable.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteVariable( + "<SITE_ID>", // siteId + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/delete.md b/examples/2.0.x/server-kotlin/java/sites/delete.md new file mode 100644 index 000000000..48bfbe267 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.delete( + "<SITE_ID>", // siteId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/get-deployment-download.md b/examples/2.0.x/server-kotlin/java/sites/get-deployment-download.md new file mode 100644 index 000000000..fa756dee2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/get-deployment-download.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.DeploymentDownloadType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.getDeploymentDownload( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + DeploymentDownloadType.SOURCE, // type (optional) + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/get-deployment.md b/examples/2.0.x/server-kotlin/java/sites/get-deployment.md new file mode 100644 index 000000000..26565abce --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/get-deployment.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.getDeployment( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/get-log.md b/examples/2.0.x/server-kotlin/java/sites/get-log.md new file mode 100644 index 000000000..290e82251 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/get-log.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.getLog( + "<SITE_ID>", // siteId + "<LOG_ID>", // logId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/get-variable.md b/examples/2.0.x/server-kotlin/java/sites/get-variable.md new file mode 100644 index 000000000..c5ac3890e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/get-variable.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.getVariable( + "<SITE_ID>", // siteId + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/get.md b/examples/2.0.x/server-kotlin/java/sites/get.md new file mode 100644 index 000000000..55d6ed33e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.get( + "<SITE_ID>", // siteId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/list-deployments.md b/examples/2.0.x/server-kotlin/java/sites/list-deployments.md new file mode 100644 index 000000000..650bd7bb1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/list-deployments.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listDeployments( + "<SITE_ID>", // siteId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/list-frameworks.md b/examples/2.0.x/server-kotlin/java/sites/list-frameworks.md new file mode 100644 index 000000000..6192bf29f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/list-frameworks.md @@ -0,0 +1,21 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listFrameworks(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/list-logs.md b/examples/2.0.x/server-kotlin/java/sites/list-logs.md new file mode 100644 index 000000000..437ebf5e8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/list-logs.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listLogs( + "<SITE_ID>", // siteId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/list-specifications.md b/examples/2.0.x/server-kotlin/java/sites/list-specifications.md new file mode 100644 index 000000000..f9a8fe994 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/list-specifications.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listSpecifications( + "runtimes", // type (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/list-variables.md b/examples/2.0.x/server-kotlin/java/sites/list-variables.md new file mode 100644 index 000000000..16c3e36f7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/list-variables.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listVariables( + "<SITE_ID>", // siteId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/list.md b/examples/2.0.x/server-kotlin/java/sites/list.md new file mode 100644 index 000000000..5d53afd41 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.list( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/update-deployment-status.md b/examples/2.0.x/server-kotlin/java/sites/update-deployment-status.md new file mode 100644 index 000000000..627cfcc20 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/update-deployment-status.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateDeploymentStatus( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/update-site-deployment.md b/examples/2.0.x/server-kotlin/java/sites/update-site-deployment.md new file mode 100644 index 000000000..8c60b7778 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/update-site-deployment.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateSiteDeployment( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/update-variable.md b/examples/2.0.x/server-kotlin/java/sites/update-variable.md new file mode 100644 index 000000000..ec016d77f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/update-variable.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateVariable( + "<SITE_ID>", // siteId + "<VARIABLE_ID>", // variableId + "<KEY>", // key (optional) + "<VALUE>", // value (optional) + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/sites/update.md b/examples/2.0.x/server-kotlin/java/sites/update.md new file mode 100644 index 000000000..d87f47a1a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/sites/update.md @@ -0,0 +1,52 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.Framework; +import io.appwrite.enums.BuildRuntime; +import io.appwrite.enums.Adapter; +import io.appwrite.enums.ProjectKeyScopes; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.update( + "<SITE_ID>", // siteId + "<NAME>", // name + Framework.ANALOG, // framework + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + "<INSTALL_COMMAND>", // installCommand (optional) + "<BUILD_COMMAND>", // buildCommand (optional) + "<START_COMMAND>", // startCommand (optional) + "<OUTPUT_DIRECTORY>", // outputDirectory (optional) + BuildRuntime.NODE_14_5, // buildRuntime (optional) + Adapter.STATIC, // adapter (optional) + "<FALLBACK_FILE>", // fallbackFile (optional) + "<INSTALLATION_ID>", // installationId (optional) + "<PROVIDER_REPOSITORY_ID>", // providerRepositoryId (optional) + "<PROVIDER_BRANCH>", // providerBranch (optional) + false, // providerSilentMode (optional) + "<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional) + List.of(), // providerBranches (optional) + List.of(), // providerPaths (optional) + "s-1vcpu-512mb", // buildSpecification (optional) + "s-1vcpu-512mb", // runtimeSpecification (optional) + 0, // deploymentRetention (optional) + List.of(ProjectKeyScopes.PROJECT_READ), // scopes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/create-bucket.md b/examples/2.0.x/server-kotlin/java/storage/create-bucket.md new file mode 100644 index 000000000..7a15d3264 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/create-bucket.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Storage; +import io.appwrite.enums.Compression; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.createBucket( + "<BUCKET_ID>", // bucketId + "<NAME>", // name + List.of(Permission.read(Role.any())), // permissions (optional) + false, // fileSecurity (optional) + false, // enabled (optional) + 1, // maximumFileSize (optional) + List.of(), // allowedFileExtensions (optional) + Compression.NONE, // compression (optional) + false, // encryption (optional) + false, // antivirus (optional) + false, // transformations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/create-file.md b/examples/2.0.x/server-kotlin/java/storage/create-file.md new file mode 100644 index 000000000..40fc823ef --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/create-file.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.createFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + InputFile.fromPath("file.png"), // file + List.of(Permission.read(Role.any())), // permissions (optional) + "photos/2026", // folder (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/delete-bucket.md b/examples/2.0.x/server-kotlin/java/storage/delete-bucket.md new file mode 100644 index 000000000..175c65ef6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/delete-bucket.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.deleteBucket( + "<BUCKET_ID>", // bucketId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/delete-file.md b/examples/2.0.x/server-kotlin/java/storage/delete-file.md new file mode 100644 index 000000000..dc3e279e2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/delete-file.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.deleteFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/get-bucket.md b/examples/2.0.x/server-kotlin/java/storage/get-bucket.md new file mode 100644 index 000000000..fb6c59519 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/get-bucket.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.getBucket( + "<BUCKET_ID>", // bucketId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/get-file-download.md b/examples/2.0.x/server-kotlin/java/storage/get-file-download.md new file mode 100644 index 000000000..9fa4df864 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/get-file-download.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.getFileDownload( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/get-file-preview.md b/examples/2.0.x/server-kotlin/java/storage/get-file-preview.md new file mode 100644 index 000000000..eb69564dc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/get-file-preview.md @@ -0,0 +1,40 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; +import io.appwrite.enums.ImageGravity; +import io.appwrite.enums.ImageFormat; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.getFilePreview( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + 0, // width (optional) + 0, // height (optional) + ImageGravity.CENTER, // gravity (optional) + -1, // quality (optional) + 0, // borderWidth (optional) + "FFFFFF", // borderColor (optional) + 0, // borderRadius (optional) + 0, // opacity (optional) + -360, // rotation (optional) + "FFFFFF", // background (optional) + ImageFormat.JPG, // output (optional) + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/get-file-view.md b/examples/2.0.x/server-kotlin/java/storage/get-file-view.md new file mode 100644 index 000000000..106884f0d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/get-file-view.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.getFileView( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/get-file.md b/examples/2.0.x/server-kotlin/java/storage/get-file.md new file mode 100644 index 000000000..85c95162f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/get-file.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.getFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/list-buckets.md b/examples/2.0.x/server-kotlin/java/storage/list-buckets.md new file mode 100644 index 000000000..85ca001a8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/list-buckets.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.listBuckets( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/list-files.md b/examples/2.0.x/server-kotlin/java/storage/list-files.md new file mode 100644 index 000000000..35334b5c1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/list-files.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.listFiles( + "<BUCKET_ID>", // bucketId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/update-bucket.md b/examples/2.0.x/server-kotlin/java/storage/update-bucket.md new file mode 100644 index 000000000..7f94346da --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/update-bucket.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Storage; +import io.appwrite.enums.Compression; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.updateBucket( + "<BUCKET_ID>", // bucketId + "<NAME>", // name + List.of(Permission.read(Role.any())), // permissions (optional) + false, // fileSecurity (optional) + false, // enabled (optional) + 1, // maximumFileSize (optional) + List.of(), // allowedFileExtensions (optional) + Compression.NONE, // compression (optional) + false, // encryption (optional) + false, // antivirus (optional) + false, // transformations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/storage/update-file.md b/examples/2.0.x/server-kotlin/java/storage/update-file.md new file mode 100644 index 000000000..7692b1ed6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/storage/update-file.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.updateFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<NAME>", // name (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-big-int-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..3be25e2bd --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-big-int-column.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createBigIntColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + 0, // min (optional) + 1000000, // max (optional) + 0, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-boolean-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..9ba8769d3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-boolean-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createBooleanColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + false, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-datetime-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..a32beda3b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-datetime-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createDatetimeColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "2020-10-15T06:38:00.000+00:00", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-email-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-email-column.md new file mode 100644 index 000000000..4aa73caef --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-email-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createEmailColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "email@example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-enum-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-enum-column.md new file mode 100644 index 000000000..e63b8ab54 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-enum-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createEnumColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + List.of("active", "inactive"), // elements + false, // required + "active", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-float-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-float-column.md new file mode 100644 index 000000000..5067f5cf6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-float-column.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createFloatColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + 0, // min (optional) + 100, // max (optional) + 10.5, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-index.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-index.md new file mode 100644 index 000000000..0eb20835e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-index.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; +import io.appwrite.enums.TablesDBIndexType; +import io.appwrite.enums.OrderBy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIndex( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + TablesDBIndexType.KEY, // type + List.of(), // columns + List.of(OrderBy.ASC), // orders (optional) + List.of(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-integer-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-integer-column.md new file mode 100644 index 000000000..dd879b3bf --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-integer-column.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIntegerColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + 0, // min (optional) + 100, // max (optional) + 10, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-ip-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-ip-column.md new file mode 100644 index 000000000..2f142a791 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-ip-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIpColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "192.0.2.0", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-line-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-line-column.md new file mode 100644 index 000000000..dfc8f874c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-line-column.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createLineColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6)), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-longtext-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..6a325d1cc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-longtext-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createLongtextColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..c408c2441 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-mediumtext-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createMediumtextColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-operations.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-operations.md new file mode 100644 index 000000000..066590410 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-operations.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createOperations( + "<TRANSACTION_ID>", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "<DATABASE_ID>", + "tableId", "<TABLE_ID>", + "rowId", "<ROW_ID>", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-point-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-point-column.md new file mode 100644 index 000000000..e7197d041 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-point-column.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createPointColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + List.of(1, 2), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-polygon-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..7a062560a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-polygon-column.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createPolygonColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + List.of(List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6), List.of(1, 2))), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-relationship-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..c8c6c2048 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-relationship-column.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; +import io.appwrite.enums.RelationshipType; +import io.appwrite.enums.RelationMutate; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRelationshipColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<RELATED_TABLE_ID>", // relatedTableId + RelationshipType.ONETOONE, // type + false, // twoWay (optional) + "<KEY>", // key (optional) + "<TWO_WAY_KEY>", // twoWayKey (optional) + RelationMutate.CASCADE, // onDelete (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-row.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-row.md new file mode 100644 index 000000000..c3193a422 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-row.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 30, + "isAdmin", false + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-rows.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-rows.md new file mode 100644 index 000000000..1e16a4dfd --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-rows.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + List.of(), // rows + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-string-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-string-column.md new file mode 100644 index 000000000..e396357a4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-string-column.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createStringColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + 1, // size + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-table.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-table.md new file mode 100644 index 000000000..079ff5de0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-table.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createTable( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<NAME>", // name + List.of(Permission.read(Role.any())), // permissions (optional) + false, // rowSecurity (optional) + false, // enabled (optional) + List.of(), // columns (optional) + List.of(), // indexes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-text-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-text-column.md new file mode 100644 index 000000000..acb041947 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-text-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createTextColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-transaction.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-transaction.md new file mode 100644 index 000000000..d66c22005 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-url-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-url-column.md new file mode 100644 index 000000000..57c75e113 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-url-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createUrlColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "https://example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create-varchar-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..7f8ecfa11 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create-varchar-column.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createVarcharColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + 1, // size + false, // required + "Hello World", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/create.md b/examples/2.0.x/server-kotlin/java/tablesdb/create.md new file mode 100644 index 000000000..ccd99cc2d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/create.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.create( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/decrement-row-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..b74427365 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/decrement-row-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.decrementRowColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + "<COLUMN>", // column + 1, // value (optional) + 0, // min (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/delete-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/delete-column.md new file mode 100644 index 000000000..4880cca9a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/delete-column.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/delete-index.md b/examples/2.0.x/server-kotlin/java/tablesdb/delete-index.md new file mode 100644 index 000000000..f434d9de5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/delete-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteIndex( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/delete-row.md b/examples/2.0.x/server-kotlin/java/tablesdb/delete-row.md new file mode 100644 index 000000000..800e4f799 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/delete-row.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/delete-rows.md b/examples/2.0.x/server-kotlin/java/tablesdb/delete-rows.md new file mode 100644 index 000000000..f12aaa368 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/delete-rows.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/delete-table.md b/examples/2.0.x/server-kotlin/java/tablesdb/delete-table.md new file mode 100644 index 000000000..b98290803 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/delete-table.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteTable( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/delete-transaction.md b/examples/2.0.x/server-kotlin/java/tablesdb/delete-transaction.md new file mode 100644 index 000000000..8a0a6507a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/delete-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteTransaction( + "<TRANSACTION_ID>", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/delete.md b/examples/2.0.x/server-kotlin/java/tablesdb/delete.md new file mode 100644 index 000000000..e66bb111c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.delete( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/get-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/get-column.md new file mode 100644 index 000000000..3a8e2b97e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/get-column.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/get-index.md b/examples/2.0.x/server-kotlin/java/tablesdb/get-index.md new file mode 100644 index 000000000..91c38b98d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/get-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getIndex( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/get-row.md b/examples/2.0.x/server-kotlin/java/tablesdb/get-row.md new file mode 100644 index 000000000..c424eb247 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/get-row.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/get-table.md b/examples/2.0.x/server-kotlin/java/tablesdb/get-table.md new file mode 100644 index 000000000..839e7b5af --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/get-table.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getTable( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/get-transaction.md b/examples/2.0.x/server-kotlin/java/tablesdb/get-transaction.md new file mode 100644 index 000000000..b4d22183b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/get-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getTransaction( + "<TRANSACTION_ID>", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/get.md b/examples/2.0.x/server-kotlin/java/tablesdb/get.md new file mode 100644 index 000000000..1593fce94 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.get( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/increment-row-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/increment-row-column.md new file mode 100644 index 000000000..3112170a2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/increment-row-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.incrementRowColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + "<COLUMN>", // column + 1, // value (optional) + 100, // max (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/list-columns.md b/examples/2.0.x/server-kotlin/java/tablesdb/list-columns.md new file mode 100644 index 000000000..6a997d81f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/list-columns.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listColumns( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/list-indexes.md b/examples/2.0.x/server-kotlin/java/tablesdb/list-indexes.md new file mode 100644 index 000000000..abe669b52 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/list-indexes.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listIndexes( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/list-rows.md b/examples/2.0.x/server-kotlin/java/tablesdb/list-rows.md new file mode 100644 index 000000000..174b4255b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/list-rows.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/list-tables.md b/examples/2.0.x/server-kotlin/java/tablesdb/list-tables.md new file mode 100644 index 000000000..37c046318 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/list-tables.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listTables( + "<DATABASE_ID>", // databaseId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/list-transactions.md b/examples/2.0.x/server-kotlin/java/tablesdb/list-transactions.md new file mode 100644 index 000000000..38ae582b1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/list-transactions.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/list.md b/examples/2.0.x/server-kotlin/java/tablesdb/list.md new file mode 100644 index 000000000..39ca54429 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.list( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-big-int-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..decd80da2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-big-int-column.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateBigIntColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + 0, // default + 0, // min (optional) + 1000000, // max (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-boolean-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..995635642 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-boolean-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateBooleanColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + false, // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-datetime-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..46f902b1f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-datetime-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateDatetimeColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "2020-10-15T06:38:00.000+00:00", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-email-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-email-column.md new file mode 100644 index 000000000..288d44e04 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-email-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateEmailColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "email@example.com", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-enum-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-enum-column.md new file mode 100644 index 000000000..da6e7e814 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-enum-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateEnumColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + List.of("active", "inactive"), // elements + false, // required + "active", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-float-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-float-column.md new file mode 100644 index 000000000..edc988a5d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-float-column.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateFloatColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + 10.5, // default + 0, // min (optional) + 100, // max (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-integer-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-integer-column.md new file mode 100644 index 000000000..84380679f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-integer-column.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateIntegerColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + 10, // default + 0, // min (optional) + 100, // max (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-ip-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-ip-column.md new file mode 100644 index 000000000..eabe7e417 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-ip-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateIpColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "192.0.2.0", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-line-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-line-column.md new file mode 100644 index 000000000..ac33ec893 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-line-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateLineColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6)), // default (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-longtext-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..d0b11583a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-longtext-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateLongtextColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "Hello World", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..fccd0e6ba --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-mediumtext-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateMediumtextColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "Hello World", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-point-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-point-column.md new file mode 100644 index 000000000..db21cbccc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-point-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updatePointColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + List.of(1, 2), // default (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-polygon-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..21985c5fa --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-polygon-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updatePolygonColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + List.of(List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6), List.of(1, 2))), // default (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-relationship-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..ad7eef91d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-relationship-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; +import io.appwrite.enums.RelationMutate; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRelationshipColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + RelationMutate.CASCADE, // onDelete (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-row.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-row.md new file mode 100644 index 000000000..e22abdfbd --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-row.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 33, + "isAdmin", false + ), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-rows.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-rows.md new file mode 100644 index 000000000..cc954291d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-rows.md @@ -0,0 +1,35 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 33, + "isAdmin", false + ), // data (optional) + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-string-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-string-column.md new file mode 100644 index 000000000..5478b4289 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-string-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateStringColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "Hello World", // default + 1, // size (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-table.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-table.md new file mode 100644 index 000000000..21120b77e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-table.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateTable( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<NAME>", // name (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + false, // rowSecurity (optional) + false, // enabled (optional) + false, // purge (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-text-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-text-column.md new file mode 100644 index 000000000..2364fe0b0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-text-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateTextColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "Hello World", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-transaction.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-transaction.md new file mode 100644 index 000000000..91790210a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-transaction.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateTransaction( + "<TRANSACTION_ID>", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-url-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-url-column.md new file mode 100644 index 000000000..e73705cde --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-url-column.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateUrlColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "https://example.com", // default + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update-varchar-column.md b/examples/2.0.x/server-kotlin/java/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..d1e44b5ad --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update-varchar-column.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateVarcharColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<KEY>", // key + false, // required + "Hello World", // default + 1, // size (optional) + "<NEW_KEY>", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/update.md b/examples/2.0.x/server-kotlin/java/tablesdb/update.md new file mode 100644 index 000000000..ee0448146 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/update.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.update( + "<DATABASE_ID>", // databaseId + "<NAME>", // name (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/upsert-row.md b/examples/2.0.x/server-kotlin/java/tablesdb/upsert-row.md new file mode 100644 index 000000000..faa683694 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/upsert-row.md @@ -0,0 +1,38 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.upsertRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + Map.of( + "username", "walter.obrien", + "email", "walter.obrien@example.com", + "fullName", "Walter O'Brien", + "age", 33, + "isAdmin", false + ), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tablesdb/upsert-rows.md b/examples/2.0.x/server-kotlin/java/tablesdb/upsert-rows.md new file mode 100644 index 000000000..1c46abfe7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tablesdb/upsert-rows.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.upsertRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + List.of(), // rows + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/create-membership.md b/examples/2.0.x/server-kotlin/java/teams/create-membership.md new file mode 100644 index 000000000..52cf1043d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/create-membership.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.createMembership( + "<TEAM_ID>", // teamId + List.of(), // roles + "email@example.com", // email (optional) + "<USER_ID>", // userId (optional) + "+12065550100", // phone (optional) + "https://example.com", // url (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/create.md b/examples/2.0.x/server-kotlin/java/teams/create.md new file mode 100644 index 000000000..d2d921bf8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/create.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.create( + "<TEAM_ID>", // teamId + "<NAME>", // name + List.of(), // roles (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/delete-membership.md b/examples/2.0.x/server-kotlin/java/teams/delete-membership.md new file mode 100644 index 000000000..9a8d609b8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/delete-membership.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.deleteMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/delete.md b/examples/2.0.x/server-kotlin/java/teams/delete.md new file mode 100644 index 000000000..a96e78ee7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.delete( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/get-membership.md b/examples/2.0.x/server-kotlin/java/teams/get-membership.md new file mode 100644 index 000000000..0ebfec907 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/get-membership.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.getMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/get-prefs.md b/examples/2.0.x/server-kotlin/java/teams/get-prefs.md new file mode 100644 index 000000000..8a4846f00 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/get-prefs.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.getPrefs( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/get.md b/examples/2.0.x/server-kotlin/java/teams/get.md new file mode 100644 index 000000000..8fc7fc6e1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.get( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/list-memberships.md b/examples/2.0.x/server-kotlin/java/teams/list-memberships.md new file mode 100644 index 000000000..348ffd834 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/list-memberships.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.listMemberships( + "<TEAM_ID>", // teamId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/list.md b/examples/2.0.x/server-kotlin/java/teams/list.md new file mode 100644 index 000000000..0f0827d65 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.list( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/update-membership-status.md b/examples/2.0.x/server-kotlin/java/teams/update-membership-status.md new file mode 100644 index 000000000..bb82703d9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/update-membership-status.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.updateMembershipStatus( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/update-membership.md b/examples/2.0.x/server-kotlin/java/teams/update-membership.md new file mode 100644 index 000000000..97034ae32 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/update-membership.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.updateMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + List.of(), // roles + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/update-name.md b/examples/2.0.x/server-kotlin/java/teams/update-name.md new file mode 100644 index 000000000..7ee251487 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/update-name.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.updateName( + "<TEAM_ID>", // teamId + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/teams/update-prefs.md b/examples/2.0.x/server-kotlin/java/teams/update-prefs.md new file mode 100644 index 000000000..7f7be4c77 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/teams/update-prefs.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.updatePrefs( + "<TEAM_ID>", // teamId + Map.of("a", "b"), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tokens/create-file-token.md b/examples/2.0.x/server-kotlin/java/tokens/create-file-token.md new file mode 100644 index 000000000..fae86d2b6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tokens/create-file-token.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.createFileToken( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "2020-10-15T06:38:00.000+00:00", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tokens/delete.md b/examples/2.0.x/server-kotlin/java/tokens/delete.md new file mode 100644 index 000000000..06c8478a2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tokens/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.delete( + "<TOKEN_ID>", // tokenId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tokens/get.md b/examples/2.0.x/server-kotlin/java/tokens/get.md new file mode 100644 index 000000000..584a37e44 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tokens/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.get( + "<TOKEN_ID>", // tokenId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tokens/list.md b/examples/2.0.x/server-kotlin/java/tokens/list.md new file mode 100644 index 000000000..fdda4490f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tokens/list.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.list( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/tokens/update.md b/examples/2.0.x/server-kotlin/java/tokens/update.md new file mode 100644 index 000000000..033cbc5b9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/tokens/update.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.update( + "<TOKEN_ID>", // tokenId + "2020-10-15T06:38:00.000+00:00", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-argon-2-user.md b/examples/2.0.x/server-kotlin/java/users/create-argon-2-user.md new file mode 100644 index 000000000..50fbb283c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-argon-2-user.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createArgon2User( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-bcrypt-user.md b/examples/2.0.x/server-kotlin/java/users/create-bcrypt-user.md new file mode 100644 index 000000000..0963995e8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-bcrypt-user.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createBcryptUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-jwt.md b/examples/2.0.x/server-kotlin/java/users/create-jwt.md new file mode 100644 index 000000000..0c88f2030 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-jwt.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createJWT( + "<USER_ID>", // userId + "recent()", // sessionId (optional) + 0, // duration (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-md-5-user.md b/examples/2.0.x/server-kotlin/java/users/create-md-5-user.md new file mode 100644 index 000000000..840ba29ab --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-md-5-user.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createMD5User( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/java/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..5715b9b17 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-mfa-recovery-codes.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createMFARecoveryCodes( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-ph-pass-user.md b/examples/2.0.x/server-kotlin/java/users/create-ph-pass-user.md new file mode 100644 index 000000000..fd9f5f5ba --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-ph-pass-user.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createPHPassUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-scrypt-modified-user.md b/examples/2.0.x/server-kotlin/java/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..892e49ffb --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-scrypt-modified-user.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createScryptModifiedUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<PASSWORD_SALT>", // passwordSalt + "<PASSWORD_SALT_SEPARATOR>", // passwordSaltSeparator + "<PASSWORD_SIGNER_KEY>", // passwordSignerKey + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-scrypt-user.md b/examples/2.0.x/server-kotlin/java/users/create-scrypt-user.md new file mode 100644 index 000000000..817264a99 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-scrypt-user.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createScryptUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<PASSWORD_SALT>", // passwordSalt + 8, // passwordCpu + 65536, // passwordMemory + 1, // passwordParallel + 64, // passwordLength + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-session.md b/examples/2.0.x/server-kotlin/java/users/create-session.md new file mode 100644 index 000000000..e5c77e421 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-session.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createSession( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-sha-user.md b/examples/2.0.x/server-kotlin/java/users/create-sha-user.md new file mode 100644 index 000000000..d60caa756 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-sha-user.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; +import io.appwrite.enums.PasswordHash; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createSHAUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + PasswordHash.SHA1, // passwordVersion (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-target.md b/examples/2.0.x/server-kotlin/java/users/create-target.md new file mode 100644 index 000000000..8a953ebb6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-target.md @@ -0,0 +1,31 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; +import io.appwrite.enums.MessagingProviderType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createTarget( + "<USER_ID>", // userId + "<TARGET_ID>", // targetId + MessagingProviderType.EMAIL, // providerType + "<IDENTIFIER>", // identifier + "<PROVIDER_ID>", // providerId (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create-token.md b/examples/2.0.x/server-kotlin/java/users/create-token.md new file mode 100644 index 000000000..fccdf6bae --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create-token.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createToken( + "<USER_ID>", // userId + 4, // length (optional) + 60, // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/create.md b/examples/2.0.x/server-kotlin/java/users/create.md new file mode 100644 index 000000000..760849ab1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/create.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.create( + "<USER_ID>", // userId + "email@example.com", // email (optional) + "+12065550100", // phone (optional) + "password", // password (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/delete-identity.md b/examples/2.0.x/server-kotlin/java/users/delete-identity.md new file mode 100644 index 000000000..f27e3af6c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/delete-identity.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteIdentity( + "<IDENTITY_ID>", // identityId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/delete-mfa-authenticator.md b/examples/2.0.x/server-kotlin/java/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..cdf8ec03e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/delete-mfa-authenticator.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteMFAAuthenticator( + "<USER_ID>", // userId + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/delete-session.md b/examples/2.0.x/server-kotlin/java/users/delete-session.md new file mode 100644 index 000000000..8b39eb11b --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/delete-session.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteSession( + "<USER_ID>", // userId + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/delete-sessions.md b/examples/2.0.x/server-kotlin/java/users/delete-sessions.md new file mode 100644 index 000000000..01b63b4c6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/delete-sessions.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteSessions( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/delete-target.md b/examples/2.0.x/server-kotlin/java/users/delete-target.md new file mode 100644 index 000000000..f222ec65c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/delete-target.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteTarget( + "<USER_ID>", // userId + "<TARGET_ID>", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/delete.md b/examples/2.0.x/server-kotlin/java/users/delete.md new file mode 100644 index 000000000..00dfd2370 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.delete( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/get-mfa-challenge.md b/examples/2.0.x/server-kotlin/java/users/get-mfa-challenge.md new file mode 100644 index 000000000..46baf423e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/get-mfa-challenge.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.getMFAChallenge( + "<USER_ID>", // userId + "<CHALLENGE_ID>", // challengeId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/java/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..28a433ff8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/get-mfa-recovery-codes.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.getMFARecoveryCodes( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/get-prefs.md b/examples/2.0.x/server-kotlin/java/users/get-prefs.md new file mode 100644 index 000000000..405f03317 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/get-prefs.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.getPrefs( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/get-target.md b/examples/2.0.x/server-kotlin/java/users/get-target.md new file mode 100644 index 000000000..f103524d1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/get-target.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.getTarget( + "<USER_ID>", // userId + "<TARGET_ID>", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/get.md b/examples/2.0.x/server-kotlin/java/users/get.md new file mode 100644 index 000000000..d72e78caf --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.get( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/list-identities.md b/examples/2.0.x/server-kotlin/java/users/list-identities.md new file mode 100644 index 000000000..505ac56bd --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/list-identities.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listIdentities( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/list-memberships.md b/examples/2.0.x/server-kotlin/java/users/list-memberships.md new file mode 100644 index 000000000..0beeb6a6d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/list-memberships.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listMemberships( + "<USER_ID>", // userId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/list-mfa-factors.md b/examples/2.0.x/server-kotlin/java/users/list-mfa-factors.md new file mode 100644 index 000000000..fc273e134 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/list-mfa-factors.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listMFAFactors( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/list-sessions.md b/examples/2.0.x/server-kotlin/java/users/list-sessions.md new file mode 100644 index 000000000..5c9d66c28 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/list-sessions.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listSessions( + "<USER_ID>", // userId + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/list-targets.md b/examples/2.0.x/server-kotlin/java/users/list-targets.md new file mode 100644 index 000000000..c531484dd --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/list-targets.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listTargets( + "<USER_ID>", // userId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/list.md b/examples/2.0.x/server-kotlin/java/users/list.md new file mode 100644 index 000000000..78bd24e61 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.list( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-email-verification.md b/examples/2.0.x/server-kotlin/java/users/update-email-verification.md new file mode 100644 index 000000000..c0b3b3149 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-email-verification.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateEmailVerification( + "<USER_ID>", // userId + false, // emailVerification + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-email.md b/examples/2.0.x/server-kotlin/java/users/update-email.md new file mode 100644 index 000000000..8d343ce22 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-email.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateEmail( + "<USER_ID>", // userId + "email@example.com", // email + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-impersonator.md b/examples/2.0.x/server-kotlin/java/users/update-impersonator.md new file mode 100644 index 000000000..879e4361f --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-impersonator.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateImpersonator( + "<USER_ID>", // userId + false, // impersonator + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-labels.md b/examples/2.0.x/server-kotlin/java/users/update-labels.md new file mode 100644 index 000000000..ae52debaa --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-labels.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateLabels( + "<USER_ID>", // userId + List.of(), // labels + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/java/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..a0b9d1b02 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-mfa-recovery-codes.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateMFARecoveryCodes( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-mfa.md b/examples/2.0.x/server-kotlin/java/users/update-mfa.md new file mode 100644 index 000000000..b7a5e337d --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-mfa.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateMFA( + "<USER_ID>", // userId + false, // mfa + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-name.md b/examples/2.0.x/server-kotlin/java/users/update-name.md new file mode 100644 index 000000000..0de8d5db9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-name.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateName( + "<USER_ID>", // userId + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-password.md b/examples/2.0.x/server-kotlin/java/users/update-password.md new file mode 100644 index 000000000..41924f0b4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-password.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updatePassword( + "<USER_ID>", // userId + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-phone-verification.md b/examples/2.0.x/server-kotlin/java/users/update-phone-verification.md new file mode 100644 index 000000000..b11e744fc --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-phone-verification.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updatePhoneVerification( + "<USER_ID>", // userId + false, // phoneVerification + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-phone.md b/examples/2.0.x/server-kotlin/java/users/update-phone.md new file mode 100644 index 000000000..2eee18334 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-phone.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updatePhone( + "<USER_ID>", // userId + "+12065550100", // number + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-prefs.md b/examples/2.0.x/server-kotlin/java/users/update-prefs.md new file mode 100644 index 000000000..ff2a6c118 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-prefs.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updatePrefs( + "<USER_ID>", // userId + Map.of("a", "b"), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-status.md b/examples/2.0.x/server-kotlin/java/users/update-status.md new file mode 100644 index 000000000..6ff97e198 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-status.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateStatus( + "<USER_ID>", // userId + false, // status + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/users/update-target.md b/examples/2.0.x/server-kotlin/java/users/update-target.md new file mode 100644 index 000000000..c9335828a --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/users/update-target.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateTarget( + "<USER_ID>", // userId + "<TARGET_ID>", // targetId + "<IDENTIFIER>", // identifier (optional) + "<PROVIDER_ID>", // providerId (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/create-collection.md b/examples/2.0.x/server-kotlin/java/vectorsdb/create-collection.md new file mode 100644 index 000000000..d3dc60bee --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/create-collection.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<NAME>", // name + 1, // dimension + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/create-document.md b/examples/2.0.x/server-kotlin/java/vectorsdb/create-document.md new file mode 100644 index 000000000..c68016786 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/create-document.md @@ -0,0 +1,37 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of( + "embeddings", List.of(0.12, -0.55, 0.88, 1.02), + "metadata", Map.of( + "key", "value" + ) + ), // data + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/create-documents.md b/examples/2.0.x/server-kotlin/java/vectorsdb/create-documents.md new file mode 100644 index 000000000..09628cb30 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/create-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // documents + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/create-index.md b/examples/2.0.x/server-kotlin/java/vectorsdb/create-index.md new file mode 100644 index 000000000..8934428c4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/create-index.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; +import io.appwrite.enums.VectorsDBIndexType; +import io.appwrite.enums.OrderBy; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + VectorsDBIndexType.HNSW_EUCLIDEAN, // type + List.of(), // attributes + List.of(OrderBy.ASC), // orders (optional) + List.of(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/create-operations.md b/examples/2.0.x/server-kotlin/java/vectorsdb/create-operations.md new file mode 100644 index 000000000..bc2f85e7c --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/create-operations.md @@ -0,0 +1,34 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createOperations( + "<TRANSACTION_ID>", // transactionId + List.of(Map.of( + "action", "create", + "databaseId", "<DATABASE_ID>", + "collectionId", "<COLLECTION_ID>", + "documentId", "<DOCUMENT_ID>", + "data", Map.of( + "name", "Walter O'Brien" + ) + )), // operations (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/create-query.md b/examples/2.0.x/server-kotlin/java/vectorsdb/create-query.md new file mode 100644 index 000000000..21ca0cebb --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/create-query.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createQuery( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/create-transaction.md b/examples/2.0.x/server-kotlin/java/vectorsdb/create-transaction.md new file mode 100644 index 000000000..c855284b3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/create-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.createTransaction( + 60, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/create.md b/examples/2.0.x/server-kotlin/java/vectorsdb/create.md new file mode 100644 index 000000000..e9a1e42e1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/create.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.create( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/delete-collection.md b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-collection.md new file mode 100644 index 000000000..c0d9eecbe --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/delete-document.md b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-document.md new file mode 100644 index 000000000..9ab5e5719 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-document.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/delete-documents.md b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-documents.md new file mode 100644 index 000000000..31a425a4e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/delete-index.md b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-index.md new file mode 100644 index 000000000..af9d7c88e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/delete-transaction.md b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..b71ee2a71 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/delete-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.deleteTransaction( + "<TRANSACTION_ID>", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/delete.md b/examples/2.0.x/server-kotlin/java/vectorsdb/delete.md new file mode 100644 index 000000000..821dacff3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.delete( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/get-collection.md b/examples/2.0.x/server-kotlin/java/vectorsdb/get-collection.md new file mode 100644 index 000000000..b158bd890 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/get-collection.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/get-document.md b/examples/2.0.x/server-kotlin/java/vectorsdb/get-document.md new file mode 100644 index 000000000..8a048ca83 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/get-document.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/get-index.md b/examples/2.0.x/server-kotlin/java/vectorsdb/get-index.md new file mode 100644 index 000000000..cc27b70b0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/get-index.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<KEY>", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/get-transaction.md b/examples/2.0.x/server-kotlin/java/vectorsdb/get-transaction.md new file mode 100644 index 000000000..8996a5661 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/get-transaction.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.getTransaction( + "<TRANSACTION_ID>", // transactionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/get.md b/examples/2.0.x/server-kotlin/java/vectorsdb/get.md new file mode 100644 index 000000000..47c549450 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.get( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/list-collections.md b/examples/2.0.x/server-kotlin/java/vectorsdb/list-collections.md new file mode 100644 index 000000000..39b35d590 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/list-collections.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listCollections( + "<DATABASE_ID>", // databaseId + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/list-documents.md b/examples/2.0.x/server-kotlin/java/vectorsdb/list-documents.md new file mode 100644 index 000000000..857d79677 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/list-documents.md @@ -0,0 +1,30 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + false, // total (optional) + 0, // ttl (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/list-indexes.md b/examples/2.0.x/server-kotlin/java/vectorsdb/list-indexes.md new file mode 100644 index 000000000..40b4dbc37 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/list-indexes.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listIndexes( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/list-transactions.md b/examples/2.0.x/server-kotlin/java/vectorsdb/list-transactions.md new file mode 100644 index 000000000..6b0890a63 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/list-transactions.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.listTransactions( + List.of(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/list.md b/examples/2.0.x/server-kotlin/java/vectorsdb/list.md new file mode 100644 index 000000000..80a20b666 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/list.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.list( + List.of(), // queries (optional) + "<SEARCH>", // search (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/update-collection.md b/examples/2.0.x/server-kotlin/java/vectorsdb/update-collection.md new file mode 100644 index 000000000..9359c8086 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/update-collection.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<NAME>", // name + 1, // dimension (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/update-document.md b/examples/2.0.x/server-kotlin/java/vectorsdb/update-document.md new file mode 100644 index 000000000..1800ff492 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/update-document.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/update-documents.md b/examples/2.0.x/server-kotlin/java/vectorsdb/update-documents.md new file mode 100644 index 000000000..820cbe572 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/update-documents.md @@ -0,0 +1,29 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + Map.of("a", "b"), // data (optional) + List.of(), // queries (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/update-transaction.md b/examples/2.0.x/server-kotlin/java/vectorsdb/update-transaction.md new file mode 100644 index 000000000..6d648df95 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/update-transaction.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.updateTransaction( + "<TRANSACTION_ID>", // transactionId + false, // commit (optional) + false, // rollback (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/update.md b/examples/2.0.x/server-kotlin/java/vectorsdb/update.md new file mode 100644 index 000000000..4fc2abe21 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/update.md @@ -0,0 +1,27 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.update( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/upsert-document.md b/examples/2.0.x/server-kotlin/java/vectorsdb/upsert-document.md new file mode 100644 index 000000000..cdefe6371 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/upsert-document.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.Permission; +import io.appwrite.Role; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.upsertDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + Map.of("a", "b"), // data (optional) + List.of(Permission.read(Role.any())), // permissions (optional) + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/vectorsdb/upsert-documents.md b/examples/2.0.x/server-kotlin/java/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..6371a0cb5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/vectorsdb/upsert-documents.md @@ -0,0 +1,28 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.VectorsDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +VectorsDB vectorsDB = new VectorsDB(client); + +vectorsDB.upsertDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + List.of(), // documents + "<TRANSACTION_ID>", // transactionId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/webhooks/create.md b/examples/2.0.x/server-kotlin/java/webhooks/create.md new file mode 100644 index 000000000..9759465e8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/webhooks/create.md @@ -0,0 +1,33 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.create( + "<WEBHOOK_ID>", // webhookId + "https://example.com/webhook", // url + "<NAME>", // name + List.of(), // events + false, // enabled (optional) + false, // tls (optional) + "<AUTH_USERNAME>", // authUsername (optional) + "password", // authPassword (optional) + "<SECRET>", // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/webhooks/delete.md b/examples/2.0.x/server-kotlin/java/webhooks/delete.md new file mode 100644 index 000000000..21c530473 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/webhooks/delete.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.delete( + "<WEBHOOK_ID>", // webhookId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/webhooks/get.md b/examples/2.0.x/server-kotlin/java/webhooks/get.md new file mode 100644 index 000000000..07ed7714e --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/webhooks/get.md @@ -0,0 +1,25 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.get( + "<WEBHOOK_ID>", // webhookId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/webhooks/list.md b/examples/2.0.x/server-kotlin/java/webhooks/list.md new file mode 100644 index 000000000..22e3d32d0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/webhooks/list.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.list( + List.of(), // queries (optional) + false, // total (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/webhooks/update-secret.md b/examples/2.0.x/server-kotlin/java/webhooks/update-secret.md new file mode 100644 index 000000000..eb18d8710 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/webhooks/update-secret.md @@ -0,0 +1,26 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.updateSecret( + "<WEBHOOK_ID>", // webhookId + "<SECRET>", // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/java/webhooks/update.md b/examples/2.0.x/server-kotlin/java/webhooks/update.md new file mode 100644 index 000000000..5c7f85f83 --- /dev/null +++ b/examples/2.0.x/server-kotlin/java/webhooks/update.md @@ -0,0 +1,32 @@ +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Webhooks; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Webhooks webhooks = new Webhooks(client); + +webhooks.update( + "<WEBHOOK_ID>", // webhookId + "<NAME>", // name + "https://example.com/webhook", // url + List.of(), // events + false, // enabled (optional) + false, // tls (optional) + "<AUTH_USERNAME>", // authUsername (optional) + "password", // authPassword (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-anonymous-session.md b/examples/2.0.x/server-kotlin/kotlin/account/create-anonymous-session.md new file mode 100644 index 000000000..68a9fd8cb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-anonymous-session.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createAnonymousSession() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-email-password-session.md b/examples/2.0.x/server-kotlin/kotlin/account/create-email-password-session.md new file mode 100644 index 000000000..a1cea8ff9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-email-password-session.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createEmailPasswordSession( + email = "email@example.com", + password = "password" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-email-token.md b/examples/2.0.x/server-kotlin/kotlin/account/create-email-token.md new file mode 100644 index 000000000..dcca57a7d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-email-token.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createEmailToken( + userId = "<USER_ID>", + email = "email@example.com", + phrase = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-email-verification.md b/examples/2.0.x/server-kotlin/kotlin/account/create-email-verification.md new file mode 100644 index 000000000..1e35db8b2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-email-verification.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createEmailVerification( + url = "https://example.com" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-magic-url-token.md b/examples/2.0.x/server-kotlin/kotlin/account/create-magic-url-token.md new file mode 100644 index 000000000..16a0a9ef4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-magic-url-token.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createMagicURLToken( + userId = "<USER_ID>", + email = "email@example.com", + url = "https://example.com", // optional + phrase = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-authenticator.md b/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-authenticator.md new file mode 100644 index 000000000..51b69b1cb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-authenticator.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createMFAAuthenticator( + type = AuthenticatorType.TOTP +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-challenge.md b/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-challenge.md new file mode 100644 index 000000000..664be4aff --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-challenge.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticationFactor + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createMFAChallenge( + factor = AuthenticationFactor.EMAIL +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..30dcdb745 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createMFARecoveryCodes() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-o-auth-2-token.md b/examples/2.0.x/server-kotlin/kotlin/account/create-o-auth-2-token.md new file mode 100644 index 000000000..bc993687d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-o-auth-2-token.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.OAuthProvider + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +account.createOAuth2Token( + provider = OAuthProvider.AMAZON, + success = "https://example.com", // optional + failure = "https://example.com", // optional + scopes = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-phone-token.md b/examples/2.0.x/server-kotlin/kotlin/account/create-phone-token.md new file mode 100644 index 000000000..c4f4075a7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-phone-token.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createPhoneToken( + userId = "<USER_ID>", + phone = "+12065550100" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-phone-verification.md b/examples/2.0.x/server-kotlin/kotlin/account/create-phone-verification.md new file mode 100644 index 000000000..991862fa4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-phone-verification.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createPhoneVerification() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-recovery.md b/examples/2.0.x/server-kotlin/kotlin/account/create-recovery.md new file mode 100644 index 000000000..826fb6363 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-recovery.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createRecovery( + email = "email@example.com", + url = "https://example.com" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-session.md b/examples/2.0.x/server-kotlin/kotlin/account/create-session.md new file mode 100644 index 000000000..fac50ff4d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-session.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createSession( + userId = "<USER_ID>", + secret = "<SECRET>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create-verification.md b/examples/2.0.x/server-kotlin/kotlin/account/create-verification.md new file mode 100644 index 000000000..6b01e27b6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create-verification.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createVerification( + url = "https://example.com" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/create.md b/examples/2.0.x/server-kotlin/kotlin/account/create.md new file mode 100644 index 000000000..2cd564dd6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/create.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.create( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/delete-identity.md b/examples/2.0.x/server-kotlin/kotlin/account/delete-identity.md new file mode 100644 index 000000000..528a225bd --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/delete-identity.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.deleteIdentity( + identityId = "<IDENTITY_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/delete-mfa-authenticator.md b/examples/2.0.x/server-kotlin/kotlin/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..231b312ba --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/delete-mfa-authenticator.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.deleteMFAAuthenticator( + type = AuthenticatorType.TOTP +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/delete-session.md b/examples/2.0.x/server-kotlin/kotlin/account/delete-session.md new file mode 100644 index 000000000..aabb48c1e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/delete-session.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.deleteSession( + sessionId = "<SESSION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/delete-sessions.md b/examples/2.0.x/server-kotlin/kotlin/account/delete-sessions.md new file mode 100644 index 000000000..5232e675e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/delete-sessions.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.deleteSessions() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/kotlin/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..04ff7a4ca --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/get-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.getMFARecoveryCodes() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/get-prefs.md b/examples/2.0.x/server-kotlin/kotlin/account/get-prefs.md new file mode 100644 index 000000000..51e682ee8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/get-prefs.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.getPrefs() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/get-session.md b/examples/2.0.x/server-kotlin/kotlin/account/get-session.md new file mode 100644 index 000000000..7311e5c15 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/get-session.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.getSession( + sessionId = "<SESSION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/get.md b/examples/2.0.x/server-kotlin/kotlin/account/get.md new file mode 100644 index 000000000..b8d2078ff --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/get.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.get() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/list-identities.md b/examples/2.0.x/server-kotlin/kotlin/account/list-identities.md new file mode 100644 index 000000000..612e06951 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/list-identities.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.listIdentities( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/list-mfa-factors.md b/examples/2.0.x/server-kotlin/kotlin/account/list-mfa-factors.md new file mode 100644 index 000000000..95c2ffde2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/list-mfa-factors.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.listMFAFactors() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/list-sessions.md b/examples/2.0.x/server-kotlin/kotlin/account/list-sessions.md new file mode 100644 index 000000000..120766637 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/list-sessions.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.listSessions() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-email-verification.md b/examples/2.0.x/server-kotlin/kotlin/account/update-email-verification.md new file mode 100644 index 000000000..e36908d2a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-email-verification.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateEmailVerification( + userId = "<USER_ID>", + secret = "<SECRET>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-email.md b/examples/2.0.x/server-kotlin/kotlin/account/update-email.md new file mode 100644 index 000000000..6319d8084 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-email.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateEmail( + email = "email@example.com", + password = "password" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-magic-url-session.md b/examples/2.0.x/server-kotlin/kotlin/account/update-magic-url-session.md new file mode 100644 index 000000000..7a9524008 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-magic-url-session.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMagicURLSession( + userId = "<USER_ID>", + secret = "<SECRET>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-authenticator.md b/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-authenticator.md new file mode 100644 index 000000000..cba56459b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-authenticator.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMFAAuthenticator( + type = AuthenticatorType.TOTP, + otp = "<OTP>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-challenge.md b/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-challenge.md new file mode 100644 index 000000000..f0d8e6a03 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-challenge.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMFAChallenge( + challengeId = "<CHALLENGE_ID>", + otp = "<OTP>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..4563b3bbf --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMFARecoveryCodes() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-mfa.md b/examples/2.0.x/server-kotlin/kotlin/account/update-mfa.md new file mode 100644 index 000000000..7a1a74d59 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-mfa.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMFA( + mfa = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-name.md b/examples/2.0.x/server-kotlin/kotlin/account/update-name.md new file mode 100644 index 000000000..6fc7f1cd4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-name.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateName( + name = "<NAME>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-password.md b/examples/2.0.x/server-kotlin/kotlin/account/update-password.md new file mode 100644 index 000000000..8d2fab101 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-password.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePassword( + password = "password", + oldPassword = "password" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-phone-session.md b/examples/2.0.x/server-kotlin/kotlin/account/update-phone-session.md new file mode 100644 index 000000000..368d77ab4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-phone-session.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePhoneSession( + userId = "<USER_ID>", + secret = "<SECRET>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-phone-verification.md b/examples/2.0.x/server-kotlin/kotlin/account/update-phone-verification.md new file mode 100644 index 000000000..22c05c0be --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-phone-verification.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePhoneVerification( + userId = "<USER_ID>", + secret = "<SECRET>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-phone.md b/examples/2.0.x/server-kotlin/kotlin/account/update-phone.md new file mode 100644 index 000000000..a3be3c875 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-phone.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePhone( + phone = "+12065550100", + password = "password" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-prefs.md b/examples/2.0.x/server-kotlin/kotlin/account/update-prefs.md new file mode 100644 index 000000000..87740321c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-prefs.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePrefs( + prefs = mapOf( + "language" to "en", + "timezone" to "UTC", + "darkTheme" to true + ) +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-recovery.md b/examples/2.0.x/server-kotlin/kotlin/account/update-recovery.md new file mode 100644 index 000000000..4b1869c61 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-recovery.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateRecovery( + userId = "<USER_ID>", + secret = "<SECRET>", + password = "password" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-session.md b/examples/2.0.x/server-kotlin/kotlin/account/update-session.md new file mode 100644 index 000000000..bc85529d4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-session.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateSession( + sessionId = "<SESSION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-status.md b/examples/2.0.x/server-kotlin/kotlin/account/update-status.md new file mode 100644 index 000000000..19e6496c0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-status.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateStatus() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/account/update-verification.md b/examples/2.0.x/server-kotlin/kotlin/account/update-verification.md new file mode 100644 index 000000000..f19aaa6c3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/account/update-verification.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateVerification( + userId = "<USER_ID>", + secret = "<SECRET>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/advisor/delete-report.md b/examples/2.0.x/server-kotlin/kotlin/advisor/delete-report.md new file mode 100644 index 000000000..bc77810fe --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/advisor/delete-report.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Advisor + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val advisor = Advisor(client) + +val response = advisor.deleteReport( + reportId = "<REPORT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/advisor/get-insight.md b/examples/2.0.x/server-kotlin/kotlin/advisor/get-insight.md new file mode 100644 index 000000000..44ea4391e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/advisor/get-insight.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Advisor + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val advisor = Advisor(client) + +val response = advisor.getInsight( + reportId = "<REPORT_ID>", + insightId = "<INSIGHT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/advisor/get-report.md b/examples/2.0.x/server-kotlin/kotlin/advisor/get-report.md new file mode 100644 index 000000000..b32c0cd6d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/advisor/get-report.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Advisor + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val advisor = Advisor(client) + +val response = advisor.getReport( + reportId = "<REPORT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/advisor/list-insights.md b/examples/2.0.x/server-kotlin/kotlin/advisor/list-insights.md new file mode 100644 index 000000000..b5cd6cf2e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/advisor/list-insights.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Advisor + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val advisor = Advisor(client) + +val response = advisor.listInsights( + reportId = "<REPORT_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/advisor/list-reports.md b/examples/2.0.x/server-kotlin/kotlin/advisor/list-reports.md new file mode 100644 index 000000000..815eaf325 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/advisor/list-reports.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Advisor + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val advisor = Advisor(client) + +val response = advisor.listReports( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-browser.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-browser.md new file mode 100644 index 000000000..2565bd7cf --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-browser.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.Browser + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getBrowser( + code = Browser.AVANT_BROWSER, + width = 0, // optional + height = 0, // optional + quality = -1 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-credit-card.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-credit-card.md new file mode 100644 index 000000000..08ce6f06c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-credit-card.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.CreditCard + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getCreditCard( + code = CreditCard.AMERICAN_EXPRESS, + width = 0, // optional + height = 0, // optional + quality = -1 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-favicon.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-favicon.md new file mode 100644 index 000000000..b19ad3ffc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-favicon.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getFavicon( + url = "https://example.com" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-flag.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-flag.md new file mode 100644 index 000000000..3f411c337 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-flag.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.Flag + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getFlag( + code = Flag.AFGHANISTAN, + width = 0, // optional + height = 0, // optional + quality = -1 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-image.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-image.md new file mode 100644 index 000000000..5efffd328 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-image.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getImage( + url = "https://example.com", + width = 0, // optional + height = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-initials.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-initials.md new file mode 100644 index 000000000..32e7c4ffb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-initials.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getInitials( + name = "<NAME>", // optional + width = 0, // optional + height = 0, // optional + background = "FFFFFF" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-photo.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-photo.md new file mode 100644 index 000000000..6cd21327b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-photo.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getPhoto( + width = 0, // optional + height = 0, // optional + quality = 0, // optional + output = "png", // optional + rating = "g", // optional + userId = "current()", // optional + emailHash = "<EMAIL_HASH>", // optional + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-qr.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-qr.md new file mode 100644 index 000000000..e9419fef5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-qr.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getQR( + text = "<TEXT>", + size = 1, // optional + margin = 0, // optional + download = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/avatars/get-screenshot.md b/examples/2.0.x/server-kotlin/kotlin/avatars/get-screenshot.md new file mode 100644 index 000000000..ea26656a8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/avatars/get-screenshot.md @@ -0,0 +1,42 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.BrowserTheme +import io.appwrite.enums.Timezone +import io.appwrite.enums.BrowserPermission +import io.appwrite.enums.ImageFormat + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getScreenshot( + url = "https://example.com", + headers = mapOf( + "Authorization" to "Bearer token123", + "X-Custom-Header" to "value" + ), // optional + viewportWidth = 1920, // optional + viewportHeight = 1080, // optional + scale = 2, // optional + theme = BrowserTheme.DARK, // optional + userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // optional + fullpage = true, // optional + locale = "en-US", // optional + timezone = Timezone.AFRICA_ABIDJAN, // optional + latitude = 37.7749, // optional + longitude = -122.4194, // optional + accuracy = 100, // optional + touch = true, // optional + permissions = listOf(BrowserPermission.GEOLOCATION, BrowserPermission.NOTIFICATIONS), // optional + sleep = 3, // optional + width = 800, // optional + height = 600, // optional + quality = 85, // optional + output = ImageFormat.JPEG // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-big-int-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-big-int-attribute.md new file mode 100644 index 000000000..be3879861 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-big-int-attribute.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createBigIntAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + min = 0, // optional + max = 1000000, // optional + default = 0, // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-boolean-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-boolean-attribute.md new file mode 100644 index 000000000..622db99d1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-boolean-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createBooleanAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = false, // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-collection.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-collection.md new file mode 100644 index 000000000..9dbc8696f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-collection.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + name = "<NAME>", + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false, // optional + attributes = listOf(), // optional + indexes = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-datetime-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-datetime-attribute.md new file mode 100644 index 000000000..56fbed55d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-datetime-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createDatetimeAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "2020-10-15T06:38:00.000+00:00", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-document.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-document.md new file mode 100644 index 000000000..f0cb24e9a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-document.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.createDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-documents.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-documents.md new file mode 100644 index 000000000..a0f32b6c3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documents = listOf(), + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-email-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-email-attribute.md new file mode 100644 index 000000000..cfa4557d5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-email-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createEmailAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "email@example.com", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-enum-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-enum-attribute.md new file mode 100644 index 000000000..e1e52ba11 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-enum-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createEnumAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + elements = listOf("active", "inactive"), + required = false, + default = "active", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-float-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-float-attribute.md new file mode 100644 index 000000000..2476449b9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-float-attribute.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createFloatAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + min = 0, // optional + max = 100, // optional + default = 10.5, // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-index.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-index.md new file mode 100644 index 000000000..4dd7197c3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-index.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.enums.DatabasesIndexType +import io.appwrite.enums.OrderBy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + type = DatabasesIndexType.KEY, + attributes = listOf(), + orders = listOf(OrderBy.ASC), // optional + lengths = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-integer-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-integer-attribute.md new file mode 100644 index 000000000..db177ae30 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-integer-attribute.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createIntegerAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + min = 0, // optional + max = 100, // optional + default = 10, // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-ip-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-ip-attribute.md new file mode 100644 index 000000000..48a394aa1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-ip-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createIpAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "192.0.2.0", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-line-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-line-attribute.md new file mode 100644 index 000000000..e902d8683 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-line-attribute.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createLineAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6)) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-longtext-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-longtext-attribute.md new file mode 100644 index 000000000..6fc1960a4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-longtext-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createLongtextAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..07e7ec97f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-mediumtext-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createMediumtextAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-operations.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-operations.md new file mode 100644 index 000000000..5c414afd1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-operations.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createOperations( + transactionId = "<TRANSACTION_ID>", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "<DATABASE_ID>", + "collectionId" to "<COLLECTION_ID>", + "documentId" to "<DOCUMENT_ID>", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-point-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-point-attribute.md new file mode 100644 index 000000000..824326ad9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-point-attribute.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createPointAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = listOf(1, 2) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-polygon-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-polygon-attribute.md new file mode 100644 index 000000000..3f117c375 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-polygon-attribute.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createPolygonAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = listOf(listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6), listOf(1, 2))) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-relationship-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-relationship-attribute.md new file mode 100644 index 000000000..1542d5b5a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-relationship-attribute.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.enums.RelationshipType +import io.appwrite.enums.RelationMutate + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createRelationshipAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + relatedCollectionId = "<RELATED_COLLECTION_ID>", + type = RelationshipType.ONETOONE, + twoWay = false, // optional + key = "<KEY>", // optional + twoWayKey = "<TWO_WAY_KEY>", // optional + onDelete = RelationMutate.CASCADE // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-string-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-string-attribute.md new file mode 100644 index 000000000..3f1133a80 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-string-attribute.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createStringAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + size = 1, + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-text-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-text-attribute.md new file mode 100644 index 000000000..339fad968 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-text-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createTextAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-transaction.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-transaction.md new file mode 100644 index 000000000..affea1ade --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createTransaction( + ttl = 60 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-url-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-url-attribute.md new file mode 100644 index 000000000..159dcbae5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-url-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createUrlAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "https://example.com", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create-varchar-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/create-varchar-attribute.md new file mode 100644 index 000000000..9dcd201ee --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create-varchar-attribute.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createVarcharAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + size = 1, + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/create.md b/examples/2.0.x/server-kotlin/kotlin/databases/create.md new file mode 100644 index 000000000..84b42af29 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/create.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.create( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/decrement-document-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/decrement-document-attribute.md new file mode 100644 index 000000000..fca8286ea --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.decrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "<ATTRIBUTE>", + value = 1, // optional + min = 0, // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/delete-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/delete-attribute.md new file mode 100644 index 000000000..3f916e318 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/delete-attribute.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/delete-collection.md b/examples/2.0.x/server-kotlin/kotlin/databases/delete-collection.md new file mode 100644 index 000000000..fcb70adf3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/delete-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/delete-document.md b/examples/2.0.x/server-kotlin/kotlin/databases/delete-document.md new file mode 100644 index 000000000..42e196e05 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/delete-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.deleteDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/delete-documents.md b/examples/2.0.x/server-kotlin/kotlin/databases/delete-documents.md new file mode 100644 index 000000000..43baf47bc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/delete-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/delete-index.md b/examples/2.0.x/server-kotlin/kotlin/databases/delete-index.md new file mode 100644 index 000000000..51cdeb6d4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/delete-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/delete-transaction.md b/examples/2.0.x/server-kotlin/kotlin/databases/delete-transaction.md new file mode 100644 index 000000000..20425d68b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/delete-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteTransaction( + transactionId = "<TRANSACTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/delete.md b/examples/2.0.x/server-kotlin/kotlin/databases/delete.md new file mode 100644 index 000000000..bee3ffc18 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.delete( + databaseId = "<DATABASE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/get-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/get-attribute.md new file mode 100644 index 000000000..735bec1b2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/get-attribute.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.getAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/get-collection.md b/examples/2.0.x/server-kotlin/kotlin/databases/get-collection.md new file mode 100644 index 000000000..374a96653 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/get-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.getCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/get-document.md b/examples/2.0.x/server-kotlin/kotlin/databases/get-document.md new file mode 100644 index 000000000..b7f492c1f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/get-document.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.getDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/get-index.md b/examples/2.0.x/server-kotlin/kotlin/databases/get-index.md new file mode 100644 index 000000000..5e5765ad4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/get-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.getIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/get-transaction.md b/examples/2.0.x/server-kotlin/kotlin/databases/get-transaction.md new file mode 100644 index 000000000..f4b58289e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/get-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.getTransaction( + transactionId = "<TRANSACTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/get.md b/examples/2.0.x/server-kotlin/kotlin/databases/get.md new file mode 100644 index 000000000..53f3359c0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.get( + databaseId = "<DATABASE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/increment-document-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/increment-document-attribute.md new file mode 100644 index 000000000..4d0ffb2a9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/increment-document-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.incrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "<ATTRIBUTE>", + value = 1, // optional + max = 100, // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/list-attributes.md b/examples/2.0.x/server-kotlin/kotlin/databases/list-attributes.md new file mode 100644 index 000000000..51b330a33 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/list-attributes.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.listAttributes( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/list-collections.md b/examples/2.0.x/server-kotlin/kotlin/databases/list-collections.md new file mode 100644 index 000000000..85dd1298e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/list-collections.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.listCollections( + databaseId = "<DATABASE_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/list-documents.md b/examples/2.0.x/server-kotlin/kotlin/databases/list-documents.md new file mode 100644 index 000000000..26e60e6ff --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/list-documents.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.listDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>", // optional + total = false, // optional + ttl = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/list-indexes.md b/examples/2.0.x/server-kotlin/kotlin/databases/list-indexes.md new file mode 100644 index 000000000..d91e4b2db --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/list-indexes.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.listIndexes( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/list-transactions.md b/examples/2.0.x/server-kotlin/kotlin/databases/list-transactions.md new file mode 100644 index 000000000..1195069e1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/list-transactions.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.listTransactions( + queries = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/list.md b/examples/2.0.x/server-kotlin/kotlin/databases/list.md new file mode 100644 index 000000000..f869a96f9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.list( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-big-int-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-big-int-attribute.md new file mode 100644 index 000000000..f0c67c649 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-big-int-attribute.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateBigIntAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = 0, + min = 0, // optional + max = 1000000, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-boolean-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-boolean-attribute.md new file mode 100644 index 000000000..6bd5e384c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-boolean-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateBooleanAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = false, + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-collection.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-collection.md new file mode 100644 index 000000000..f383054c0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-collection.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + name = "<NAME>", // optional + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false, // optional + purge = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-datetime-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-datetime-attribute.md new file mode 100644 index 000000000..d0eff7e1c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-datetime-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateDatetimeAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "2020-10-15T06:38:00.000+00:00", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-document.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-document.md new file mode 100644 index 000000000..15cebaa2c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-document.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.updateDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 33, + "isAdmin" to false + ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-documents.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-documents.md new file mode 100644 index 000000000..bed508885 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-documents.md @@ -0,0 +1,26 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 33, + "isAdmin" to false + ), // optional + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-email-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-email-attribute.md new file mode 100644 index 000000000..1a644541e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-email-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateEmailAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "email@example.com", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-enum-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-enum-attribute.md new file mode 100644 index 000000000..eb05deca5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-enum-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateEnumAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + elements = listOf("active", "inactive"), + required = false, + default = "active", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-float-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-float-attribute.md new file mode 100644 index 000000000..d0049003c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-float-attribute.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateFloatAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = 10.5, + min = 0, // optional + max = 100, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-integer-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-integer-attribute.md new file mode 100644 index 000000000..7ec1ccbe5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-integer-attribute.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateIntegerAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = 10, + min = 0, // optional + max = 100, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-ip-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-ip-attribute.md new file mode 100644 index 000000000..e0255a08b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-ip-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateIpAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "192.0.2.0", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-line-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-line-attribute.md new file mode 100644 index 000000000..528178ca7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-line-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateLineAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6)), // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-longtext-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-longtext-attribute.md new file mode 100644 index 000000000..2fa49ff80 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-longtext-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateLongtextAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..cd188faa3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-mediumtext-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateMediumtextAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-point-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-point-attribute.md new file mode 100644 index 000000000..31ada757f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-point-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updatePointAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = listOf(1, 2), // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-polygon-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-polygon-attribute.md new file mode 100644 index 000000000..0f0d0ed19 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-polygon-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updatePolygonAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = listOf(listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6), listOf(1, 2))), // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-relationship-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-relationship-attribute.md new file mode 100644 index 000000000..c6529458b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-relationship-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.enums.RelationMutate + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateRelationshipAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + onDelete = RelationMutate.CASCADE, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-string-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-string-attribute.md new file mode 100644 index 000000000..97b5fe3b0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-string-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateStringAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + size = 1, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-text-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-text-attribute.md new file mode 100644 index 000000000..7ba5d3adb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-text-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateTextAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-transaction.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-transaction.md new file mode 100644 index 000000000..d59a11057 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-transaction.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateTransaction( + transactionId = "<TRANSACTION_ID>", + commit = false, // optional + rollback = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-url-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-url-attribute.md new file mode 100644 index 000000000..6890bf5e2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-url-attribute.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateUrlAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "https://example.com", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update-varchar-attribute.md b/examples/2.0.x/server-kotlin/kotlin/databases/update-varchar-attribute.md new file mode 100644 index 000000000..4b0d4549b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update-varchar-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateVarcharAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + size = 1, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/update.md b/examples/2.0.x/server-kotlin/kotlin/databases/update.md new file mode 100644 index 000000000..5adc8a013 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/update.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.update( + databaseId = "<DATABASE_ID>", + name = "<NAME>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/upsert-document.md b/examples/2.0.x/server-kotlin/kotlin/databases/upsert-document.md new file mode 100644 index 000000000..5f1caef25 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/upsert-document.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.upsertDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/databases/upsert-documents.md b/examples/2.0.x/server-kotlin/kotlin/databases/upsert-documents.md new file mode 100644 index 000000000..a9e673c20 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/databases/upsert-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.upsertDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documents = listOf(), + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-collection.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-collection.md new file mode 100644 index 000000000..29974f2de --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-collection.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + name = "<NAME>", + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false, // optional + attributes = listOf(), // optional + indexes = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-document.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-document.md new file mode 100644 index 000000000..dc0bfa9ae --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-document.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-documents.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-documents.md new file mode 100644 index 000000000..b6f084798 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documents = listOf(), + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-index.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-index.md new file mode 100644 index 000000000..df6fdb523 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-index.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.enums.DocumentsDBIndexType +import io.appwrite.enums.OrderBy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + type = DocumentsDBIndexType.KEY, + attributes = listOf(), + orders = listOf(OrderBy.ASC), // optional + lengths = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-operations.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-operations.md new file mode 100644 index 000000000..851b65ced --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createOperations( + transactionId = "<TRANSACTION_ID>", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "<DATABASE_ID>", + "collectionId" to "<COLLECTION_ID>", + "documentId" to "<DOCUMENT_ID>", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-transaction.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-transaction.md new file mode 100644 index 000000000..b695e5326 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.createTransaction( + ttl = 60 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/create.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create.md new file mode 100644 index 000000000..51bbf1664 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/create.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.create( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..c4668ec55 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.decrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "<ATTRIBUTE>", + value = 1, // optional + min = 0, // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-collection.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-collection.md new file mode 100644 index 000000000..9f57b1889 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-document.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-document.md new file mode 100644 index 000000000..36624b6c9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-documents.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-documents.md new file mode 100644 index 000000000..9a5397c07 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-index.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-index.md new file mode 100644 index 000000000..e567127f2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-transaction.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-transaction.md new file mode 100644 index 000000000..3adfb9a67 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.deleteTransaction( + transactionId = "<TRANSACTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete.md new file mode 100644 index 000000000..63ef123f8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.delete( + databaseId = "<DATABASE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-collection.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-collection.md new file mode 100644 index 000000000..aee65b9b7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.getCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-document.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-document.md new file mode 100644 index 000000000..eb2aad88f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-document.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.getDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-index.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-index.md new file mode 100644 index 000000000..2630f3e4c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.getIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-transaction.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-transaction.md new file mode 100644 index 000000000..7ac55d4bd --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.getTransaction( + transactionId = "<TRANSACTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/get.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get.md new file mode 100644 index 000000000..aa2405569 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.get( + databaseId = "<DATABASE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..bfc586033 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/increment-document-attribute.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.incrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "<ATTRIBUTE>", + value = 1, // optional + max = 100, // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-collections.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-collections.md new file mode 100644 index 000000000..0240c1dac --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-collections.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.listCollections( + databaseId = "<DATABASE_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-documents.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-documents.md new file mode 100644 index 000000000..d1c688f25 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-documents.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.listDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>", // optional + total = false, // optional + ttl = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-indexes.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-indexes.md new file mode 100644 index 000000000..b83909ec5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-indexes.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.listIndexes( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-transactions.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-transactions.md new file mode 100644 index 000000000..00967cc24 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list-transactions.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.listTransactions( + queries = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/list.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list.md new file mode 100644 index 000000000..ec0f18b89 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.list( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-collection.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-collection.md new file mode 100644 index 000000000..4c873b96d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-collection.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.updateCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + name = "<NAME>", + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false, // optional + purge = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-document.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-document.md new file mode 100644 index 000000000..e7bdba5fc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-document.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.updateDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-documents.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-documents.md new file mode 100644 index 000000000..175b6eec2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.updateDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + data = mapOf( "a" to "b" ), // optional + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-transaction.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-transaction.md new file mode 100644 index 000000000..99ace754e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update-transaction.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.updateTransaction( + transactionId = "<TRANSACTION_ID>", + commit = false, // optional + rollback = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/update.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update.md new file mode 100644 index 000000000..4239c220d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/update.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.update( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/upsert-document.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/upsert-document.md new file mode 100644 index 000000000..6b31df066 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/upsert-document.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.upsertDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/documentsdb/upsert-documents.md b/examples/2.0.x/server-kotlin/kotlin/documentsdb/upsert-documents.md new file mode 100644 index 000000000..abf463385 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/documentsdb/upsert-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.DocumentsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val documentsDB = DocumentsDB(client) + +val response = documentsDB.upsertDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documents = listOf(), + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/embeddings/create-text-embeddings.md b/examples/2.0.x/server-kotlin/kotlin/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..6d0b3c1ca --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/embeddings/create-text-embeddings.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Embeddings +import io.appwrite.enums.EmbeddingModel + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val embeddings = Embeddings(client) + +val response = embeddings.createTextEmbeddings( + texts = listOf(), + model = EmbeddingModel.NOMIC_EMBED_TEXT // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/create-deployment.md b/examples/2.0.x/server-kotlin/kotlin/functions/create-deployment.md new file mode 100644 index 000000000..3fe1a24f6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/create-deployment.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createDeployment( + functionId = "<FUNCTION_ID>", + code = InputFile.fromPath("file.png"), + activate = false, + entrypoint = "<ENTRYPOINT>", // optional + commands = "<COMMANDS>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/create-duplicate-deployment.md b/examples/2.0.x/server-kotlin/kotlin/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..4fda762a9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/create-duplicate-deployment.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createDuplicateDeployment( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>", + buildId = "<BUILD_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/create-execution.md b/examples/2.0.x/server-kotlin/kotlin/functions/create-execution.md new file mode 100644 index 000000000..1bae93d37 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/create-execution.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.ExecutionMethod + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val functions = Functions(client) + +val response = functions.createExecution( + functionId = "<FUNCTION_ID>", + body = "<BODY>", // optional + async = false, // optional + path = "<PATH>", // optional + method = ExecutionMethod.GET, // optional + headers = mapOf( "a" to "b" ), // optional + scheduledAt = "<SCHEDULED_AT>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/create-template-deployment.md b/examples/2.0.x/server-kotlin/kotlin/functions/create-template-deployment.md new file mode 100644 index 000000000..ebc28411b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/create-template-deployment.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.TemplateReferenceType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createTemplateDeployment( + functionId = "<FUNCTION_ID>", + repository = "<REPOSITORY>", + owner = "<OWNER>", + rootDirectory = "<ROOT_DIRECTORY>", + type = TemplateReferenceType.COMMIT, + reference = "<REFERENCE>", + activate = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/create-variable.md b/examples/2.0.x/server-kotlin/kotlin/functions/create-variable.md new file mode 100644 index 000000000..28c8ef7f9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/create-variable.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createVariable( + functionId = "<FUNCTION_ID>", + variableId = "<VARIABLE_ID>", + key = "<KEY>", + value = "<VALUE>", + secret = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/create-vcs-deployment.md b/examples/2.0.x/server-kotlin/kotlin/functions/create-vcs-deployment.md new file mode 100644 index 000000000..143083c6c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/create-vcs-deployment.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.VCSReferenceType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createVcsDeployment( + functionId = "<FUNCTION_ID>", + type = VCSReferenceType.BRANCH, + reference = "<REFERENCE>", + activate = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/create.md b/examples/2.0.x/server-kotlin/kotlin/functions/create.md new file mode 100644 index 000000000..5c05100e7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/create.md @@ -0,0 +1,39 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.Runtime +import io.appwrite.enums.ProjectKeyScopes + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.create( + functionId = "<FUNCTION_ID>", + name = "<NAME>", + runtime = Runtime.NODE_14_5, + execute = listOf("any"), // optional + events = listOf(), // optional + schedule = "0 0 * * *", // optional + timeout = 1, // optional + enabled = false, // optional + logging = false, // optional + entrypoint = "<ENTRYPOINT>", // optional + commands = "<COMMANDS>", // optional + scopes = listOf(ProjectKeyScopes.PROJECT_READ), // optional + installationId = "<INSTALLATION_ID>", // optional + providerRepositoryId = "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch = "<PROVIDER_BRANCH>", // optional + providerSilentMode = false, // optional + providerRootDirectory = "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches = listOf(), // optional + providerPaths = listOf(), // optional + buildSpecification = "s-1vcpu-512mb", // optional + runtimeSpecification = "s-1vcpu-512mb", // optional + deploymentRetention = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/delete-deployment.md b/examples/2.0.x/server-kotlin/kotlin/functions/delete-deployment.md new file mode 100644 index 000000000..d3129ad60 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/delete-deployment.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.deleteDeployment( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/delete-execution.md b/examples/2.0.x/server-kotlin/kotlin/functions/delete-execution.md new file mode 100644 index 000000000..82e132b07 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/delete-execution.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.deleteExecution( + functionId = "<FUNCTION_ID>", + executionId = "<EXECUTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/delete-variable.md b/examples/2.0.x/server-kotlin/kotlin/functions/delete-variable.md new file mode 100644 index 000000000..803f5af18 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/delete-variable.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.deleteVariable( + functionId = "<FUNCTION_ID>", + variableId = "<VARIABLE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/delete.md b/examples/2.0.x/server-kotlin/kotlin/functions/delete.md new file mode 100644 index 000000000..5970fbb24 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.delete( + functionId = "<FUNCTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment-download.md b/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment-download.md new file mode 100644 index 000000000..bf7c03f1d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment-download.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.DeploymentDownloadType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val result = functions.getDeploymentDownload( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>", + type = DeploymentDownloadType.SOURCE, // optional + token = "<TOKEN>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment.md b/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment.md new file mode 100644 index 000000000..c8fd70766 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/get-deployment.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.getDeployment( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/get-execution.md b/examples/2.0.x/server-kotlin/kotlin/functions/get-execution.md new file mode 100644 index 000000000..38e313815 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/get-execution.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val functions = Functions(client) + +val response = functions.getExecution( + functionId = "<FUNCTION_ID>", + executionId = "<EXECUTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/get-variable.md b/examples/2.0.x/server-kotlin/kotlin/functions/get-variable.md new file mode 100644 index 000000000..09b9fd1fa --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/get-variable.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.getVariable( + functionId = "<FUNCTION_ID>", + variableId = "<VARIABLE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/get.md b/examples/2.0.x/server-kotlin/kotlin/functions/get.md new file mode 100644 index 000000000..035dc3b87 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.get( + functionId = "<FUNCTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/list-deployments.md b/examples/2.0.x/server-kotlin/kotlin/functions/list-deployments.md new file mode 100644 index 000000000..950e60480 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/list-deployments.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.listDeployments( + functionId = "<FUNCTION_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/list-executions.md b/examples/2.0.x/server-kotlin/kotlin/functions/list-executions.md new file mode 100644 index 000000000..42b23a261 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/list-executions.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val functions = Functions(client) + +val response = functions.listExecutions( + functionId = "<FUNCTION_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/list-runtimes.md b/examples/2.0.x/server-kotlin/kotlin/functions/list-runtimes.md new file mode 100644 index 000000000..b32e73bf0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/list-runtimes.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.listRuntimes() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/list-specifications.md b/examples/2.0.x/server-kotlin/kotlin/functions/list-specifications.md new file mode 100644 index 000000000..516eeb856 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/list-specifications.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.listSpecifications( + type = "runtimes" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/list-variables.md b/examples/2.0.x/server-kotlin/kotlin/functions/list-variables.md new file mode 100644 index 000000000..e7f0e55a0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/list-variables.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.listVariables( + functionId = "<FUNCTION_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/list.md b/examples/2.0.x/server-kotlin/kotlin/functions/list.md new file mode 100644 index 000000000..a76143269 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.list( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/update-deployment-status.md b/examples/2.0.x/server-kotlin/kotlin/functions/update-deployment-status.md new file mode 100644 index 000000000..acbb9bcd3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/update-deployment-status.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.updateDeploymentStatus( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/update-function-deployment.md b/examples/2.0.x/server-kotlin/kotlin/functions/update-function-deployment.md new file mode 100644 index 000000000..a94335067 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/update-function-deployment.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.updateFunctionDeployment( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/update-variable.md b/examples/2.0.x/server-kotlin/kotlin/functions/update-variable.md new file mode 100644 index 000000000..9085015fa --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/update-variable.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.updateVariable( + functionId = "<FUNCTION_ID>", + variableId = "<VARIABLE_ID>", + key = "<KEY>", // optional + value = "<VALUE>", // optional + secret = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/functions/update.md b/examples/2.0.x/server-kotlin/kotlin/functions/update.md new file mode 100644 index 000000000..a7acbe65a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/functions/update.md @@ -0,0 +1,39 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.Runtime +import io.appwrite.enums.ProjectKeyScopes + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.update( + functionId = "<FUNCTION_ID>", + name = "<NAME>", + runtime = Runtime.NODE_14_5, // optional + execute = listOf("any"), // optional + events = listOf(), // optional + schedule = "0 0 * * *", // optional + timeout = 1, // optional + enabled = false, // optional + logging = false, // optional + entrypoint = "<ENTRYPOINT>", // optional + commands = "<COMMANDS>", // optional + scopes = listOf(ProjectKeyScopes.PROJECT_READ), // optional + installationId = "<INSTALLATION_ID>", // optional + providerRepositoryId = "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch = "<PROVIDER_BRANCH>", // optional + providerSilentMode = false, // optional + providerRootDirectory = "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches = listOf(), // optional + providerPaths = listOf(), // optional + buildSpecification = "s-1vcpu-512mb", // optional + runtimeSpecification = "s-1vcpu-512mb", // optional + deploymentRetention = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/graphql/mutation.md b/examples/2.0.x/server-kotlin/kotlin/graphql/mutation.md new file mode 100644 index 000000000..3ec94a5d4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/graphql/mutation.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Graphql + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val graphql = Graphql(client) + +val response = graphql.mutation( + query = mapOf( "a" to "b" ) +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/graphql/query.md b/examples/2.0.x/server-kotlin/kotlin/graphql/query.md new file mode 100644 index 000000000..e22d508b3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/graphql/query.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Graphql + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val graphql = Graphql(client) + +val response = graphql.query( + query = mapOf( "a" to "b" ) +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/locale/get.md b/examples/2.0.x/server-kotlin/kotlin/locale/get.md new file mode 100644 index 000000000..aa14e4501 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/locale/get.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.get() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/locale/list-codes.md b/examples/2.0.x/server-kotlin/kotlin/locale/list-codes.md new file mode 100644 index 000000000..d7d323e4f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/locale/list-codes.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCodes() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/locale/list-continents.md b/examples/2.0.x/server-kotlin/kotlin/locale/list-continents.md new file mode 100644 index 000000000..84fd76bcf --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/locale/list-continents.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listContinents() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/locale/list-countries-eu.md b/examples/2.0.x/server-kotlin/kotlin/locale/list-countries-eu.md new file mode 100644 index 000000000..4fbcee6c1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/locale/list-countries-eu.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCountriesEU() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/locale/list-countries-phones.md b/examples/2.0.x/server-kotlin/kotlin/locale/list-countries-phones.md new file mode 100644 index 000000000..02c56bbcc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/locale/list-countries-phones.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCountriesPhones() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/locale/list-countries.md b/examples/2.0.x/server-kotlin/kotlin/locale/list-countries.md new file mode 100644 index 000000000..441e130e5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/locale/list-countries.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCountries() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/locale/list-currencies.md b/examples/2.0.x/server-kotlin/kotlin/locale/list-currencies.md new file mode 100644 index 000000000..c68d676a5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/locale/list-currencies.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCurrencies() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/locale/list-languages.md b/examples/2.0.x/server-kotlin/kotlin/locale/list-languages.md new file mode 100644 index 000000000..307d0b796 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/locale/list-languages.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listLanguages() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-apns-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-apns-provider.md new file mode 100644 index 000000000..e9d80cad2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-apns-provider.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createAPNSProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + authKey = "<AUTH_KEY>", // optional + authKeyId = "<AUTH_KEY_ID>", // optional + teamId = "<TEAM_ID>", // optional + bundleId = "<BUNDLE_ID>", // optional + sandbox = false, // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-email.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-email.md new file mode 100644 index 000000000..a5a813b38 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-email.md @@ -0,0 +1,27 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createEmail( + messageId = "<MESSAGE_ID>", + subject = "<SUBJECT>", + content = "<CONTENT>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + cc = listOf(), // optional + bcc = listOf(), // optional + attachments = listOf(), // optional + draft = false, // optional + html = false, // optional + scheduledAt = "2020-10-15T06:38:00.000+00:00" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-fcm-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-fcm-provider.md new file mode 100644 index 000000000..495b9ac67 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-fcm-provider.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createFCMProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + serviceAccountJSON = mapOf( "a" to "b" ), // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-mailgun-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..94aa9a54b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-mailgun-provider.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createMailgunProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + apiKey = "<API_KEY>", // optional + domain = "example.com", // optional + isEuRegion = false, // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-msg-91-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..a80004b80 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-msg-91-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createMsg91Provider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + templateId = "<TEMPLATE_ID>", // optional + senderId = "<SENDER_ID>", // optional + authKey = "<AUTH_KEY>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-push.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-push.md new file mode 100644 index 000000000..500478d68 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-push.md @@ -0,0 +1,35 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging +import io.appwrite.enums.MessagePriority + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createPush( + messageId = "<MESSAGE_ID>", + title = "<TITLE>", // optional + body = "<BODY>", // optional + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + data = mapOf( "a" to "b" ), // optional + action = "<ACTION>", // optional + image = "<ID1:ID2>", // optional + icon = "<ICON>", // optional + sound = "<SOUND>", // optional + color = "<COLOR>", // optional + tag = "<TAG>", // optional + badge = 1, // optional + draft = false, // optional + scheduledAt = "2020-10-15T06:38:00.000+00:00", // optional + contentAvailable = false, // optional + critical = false, // optional + priority = MessagePriority.NORMAL // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-resend-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-resend-provider.md new file mode 100644 index 000000000..313bbb705 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-resend-provider.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createResendProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + apiKey = "<API_KEY>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..05b263bbb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-sendgrid-provider.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createSendgridProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + apiKey = "<API_KEY>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-ses-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-ses-provider.md new file mode 100644 index 000000000..47f54967f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-ses-provider.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createSesProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + accessKey = "<ACCESS_KEY>", // optional + secretKey = "<SECRET_KEY>", // optional + region = "<REGION>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-sms.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-sms.md new file mode 100644 index 000000000..124b2a501 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-sms.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createSMS( + messageId = "<MESSAGE_ID>", + content = "<CONTENT>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + draft = false, // optional + scheduledAt = "2020-10-15T06:38:00.000+00:00" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-smtp-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-smtp-provider.md new file mode 100644 index 000000000..635a566af --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-smtp-provider.md @@ -0,0 +1,30 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging +import io.appwrite.enums.SmtpEncryption + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createSMTPProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + host = "<HOST>", + port = 587, // optional + username = "<USERNAME>", // optional + password = "password", // optional + encryption = SmtpEncryption.NONE, // optional + autoTLS = false, // optional + mailer = "<MAILER>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-subscriber.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-subscriber.md new file mode 100644 index 000000000..8b72a8133 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-subscriber.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>") // Your secret JSON Web Token + +val messaging = Messaging(client) + +val response = messaging.createSubscriber( + topicId = "<TOPIC_ID>", + subscriberId = "<SUBSCRIBER_ID>", + targetId = "<TARGET_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-telesign-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-telesign-provider.md new file mode 100644 index 000000000..585fddeb3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-telesign-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createTelesignProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + from = "+12065550100", // optional + customerId = "<CUSTOMER_ID>", // optional + apiKey = "<API_KEY>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-textmagic-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..d9290bb27 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-textmagic-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createTextmagicProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + from = "+12065550100", // optional + username = "<USERNAME>", // optional + apiKey = "<API_KEY>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-topic.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-topic.md new file mode 100644 index 000000000..139dcf6aa --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-topic.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createTopic( + topicId = "<TOPIC_ID>", + name = "<NAME>", + subscribe = listOf("any") // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-twilio-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-twilio-provider.md new file mode 100644 index 000000000..94556b562 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-twilio-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createTwilioProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + from = "+12065550100", // optional + accountSid = "<ACCOUNT_SID>", // optional + authToken = "<AUTH_TOKEN>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/create-vonage-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/create-vonage-provider.md new file mode 100644 index 000000000..d4b8b3dcc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/create-vonage-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createVonageProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + from = "+12065550100", // optional + apiKey = "<API_KEY>", // optional + apiSecret = "<API_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/delete-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/delete-provider.md new file mode 100644 index 000000000..82875d674 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/delete-provider.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.deleteProvider( + providerId = "<PROVIDER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/delete-subscriber.md b/examples/2.0.x/server-kotlin/kotlin/messaging/delete-subscriber.md new file mode 100644 index 000000000..d475b5b41 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/delete-subscriber.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>") // Your secret JSON Web Token + +val messaging = Messaging(client) + +val response = messaging.deleteSubscriber( + topicId = "<TOPIC_ID>", + subscriberId = "<SUBSCRIBER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/delete-topic.md b/examples/2.0.x/server-kotlin/kotlin/messaging/delete-topic.md new file mode 100644 index 000000000..46407e82b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/delete-topic.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.deleteTopic( + topicId = "<TOPIC_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/delete.md b/examples/2.0.x/server-kotlin/kotlin/messaging/delete.md new file mode 100644 index 000000000..25a5cfb43 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.delete( + messageId = "<MESSAGE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/get-message.md b/examples/2.0.x/server-kotlin/kotlin/messaging/get-message.md new file mode 100644 index 000000000..9e9254f58 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/get-message.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.getMessage( + messageId = "<MESSAGE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/get-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/get-provider.md new file mode 100644 index 000000000..a318451d6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/get-provider.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.getProvider( + providerId = "<PROVIDER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/get-subscriber.md b/examples/2.0.x/server-kotlin/kotlin/messaging/get-subscriber.md new file mode 100644 index 000000000..ef49cf15f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/get-subscriber.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.getSubscriber( + topicId = "<TOPIC_ID>", + subscriberId = "<SUBSCRIBER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/get-topic.md b/examples/2.0.x/server-kotlin/kotlin/messaging/get-topic.md new file mode 100644 index 000000000..1a5738f8e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/get-topic.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.getTopic( + topicId = "<TOPIC_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/list-messages.md b/examples/2.0.x/server-kotlin/kotlin/messaging/list-messages.md new file mode 100644 index 000000000..cbf689e23 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/list-messages.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listMessages( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/list-providers.md b/examples/2.0.x/server-kotlin/kotlin/messaging/list-providers.md new file mode 100644 index 000000000..27c875d41 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/list-providers.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listProviders( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/list-subscribers.md b/examples/2.0.x/server-kotlin/kotlin/messaging/list-subscribers.md new file mode 100644 index 000000000..8ae76791f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/list-subscribers.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listSubscribers( + topicId = "<TOPIC_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/list-targets.md b/examples/2.0.x/server-kotlin/kotlin/messaging/list-targets.md new file mode 100644 index 000000000..e6ff5faaa --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/list-targets.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listTargets( + messageId = "<MESSAGE_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/list-topics.md b/examples/2.0.x/server-kotlin/kotlin/messaging/list-topics.md new file mode 100644 index 000000000..23cae83dd --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/list-topics.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listTopics( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-apns-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-apns-provider.md new file mode 100644 index 000000000..2d8812910 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-apns-provider.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateAPNSProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + authKey = "<AUTH_KEY>", // optional + authKeyId = "<AUTH_KEY_ID>", // optional + teamId = "<TEAM_ID>", // optional + bundleId = "<BUNDLE_ID>", // optional + sandbox = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-email.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-email.md new file mode 100644 index 000000000..d072c39de --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-email.md @@ -0,0 +1,27 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateEmail( + messageId = "<MESSAGE_ID>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + subject = "<SUBJECT>", // optional + content = "<CONTENT>", // optional + draft = false, // optional + html = false, // optional + cc = listOf(), // optional + bcc = listOf(), // optional + scheduledAt = "2020-10-15T06:38:00.000+00:00", // optional + attachments = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-fcm-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-fcm-provider.md new file mode 100644 index 000000000..2d5e52573 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-fcm-provider.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateFCMProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + serviceAccountJSON = mapOf( "a" to "b" ) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-mailgun-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..5d6bb2416 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-mailgun-provider.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateMailgunProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + apiKey = "<API_KEY>", // optional + domain = "example.com", // optional + isEuRegion = false, // optional + enabled = false, // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "<REPLY_TO_EMAIL>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-msg-91-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..f4901b70a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-msg-91-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateMsg91Provider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + templateId = "<TEMPLATE_ID>", // optional + senderId = "<SENDER_ID>", // optional + authKey = "<AUTH_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-push.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-push.md new file mode 100644 index 000000000..9d9f24e6b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-push.md @@ -0,0 +1,35 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging +import io.appwrite.enums.MessagePriority + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updatePush( + messageId = "<MESSAGE_ID>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + title = "<TITLE>", // optional + body = "<BODY>", // optional + data = mapOf( "a" to "b" ), // optional + action = "<ACTION>", // optional + image = "<ID1:ID2>", // optional + icon = "<ICON>", // optional + sound = "<SOUND>", // optional + color = "<COLOR>", // optional + tag = "<TAG>", // optional + badge = 1, // optional + draft = false, // optional + scheduledAt = "2020-10-15T06:38:00.000+00:00", // optional + contentAvailable = false, // optional + critical = false, // optional + priority = MessagePriority.NORMAL // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-resend-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-resend-provider.md new file mode 100644 index 000000000..c16fa845e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-resend-provider.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateResendProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + apiKey = "<API_KEY>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "<REPLY_TO_EMAIL>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..2d82d6a86 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-sendgrid-provider.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateSendgridProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + apiKey = "<API_KEY>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "<REPLY_TO_EMAIL>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-ses-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-ses-provider.md new file mode 100644 index 000000000..097b15e80 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-ses-provider.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateSesProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + accessKey = "<ACCESS_KEY>", // optional + secretKey = "<SECRET_KEY>", // optional + region = "<REGION>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "<REPLY_TO_EMAIL>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-sms.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-sms.md new file mode 100644 index 000000000..aa53bf147 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-sms.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateSMS( + messageId = "<MESSAGE_ID>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + content = "<CONTENT>", // optional + draft = false, // optional + scheduledAt = "2020-10-15T06:38:00.000+00:00" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-smtp-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-smtp-provider.md new file mode 100644 index 000000000..581a95763 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-smtp-provider.md @@ -0,0 +1,30 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging +import io.appwrite.enums.SmtpEncryption + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateSMTPProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + host = "<HOST>", // optional + port = 1, // optional + username = "<USERNAME>", // optional + password = "password", // optional + encryption = SmtpEncryption.NONE, // optional + autoTLS = false, // optional + mailer = "<MAILER>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "<REPLY_TO_EMAIL>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-telesign-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-telesign-provider.md new file mode 100644 index 000000000..f2cb5b251 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-telesign-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateTelesignProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + customerId = "<CUSTOMER_ID>", // optional + apiKey = "<API_KEY>", // optional + from = "<FROM>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-textmagic-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..1640c79d5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-textmagic-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateTextmagicProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + username = "<USERNAME>", // optional + apiKey = "<API_KEY>", // optional + from = "<FROM>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-topic.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-topic.md new file mode 100644 index 000000000..d9a6a78c2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-topic.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateTopic( + topicId = "<TOPIC_ID>", + name = "<NAME>", // optional + subscribe = listOf("any") // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-twilio-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-twilio-provider.md new file mode 100644 index 000000000..b60901a90 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-twilio-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateTwilioProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + accountSid = "<ACCOUNT_SID>", // optional + authToken = "<AUTH_TOKEN>", // optional + from = "<FROM>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/messaging/update-vonage-provider.md b/examples/2.0.x/server-kotlin/kotlin/messaging/update-vonage-provider.md new file mode 100644 index 000000000..8458a7b43 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/messaging/update-vonage-provider.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateVonageProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + apiKey = "<API_KEY>", // optional + apiSecret = "<API_SECRET>", // optional + from = "<FROM>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/organization/create-project.md b/examples/2.0.x/server-kotlin/kotlin/organization/create-project.md new file mode 100644 index 000000000..ffc5bce6f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/organization/create-project.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organization +import io.appwrite.enums.Region + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val organization = Organization(client) + +val response = organization.createProject( + projectId = "<PROJECT_ID>", + name = "<NAME>", + region = Region.DEFAULT // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/organization/delete-project.md b/examples/2.0.x/server-kotlin/kotlin/organization/delete-project.md new file mode 100644 index 000000000..5f4b96520 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/organization/delete-project.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organization + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val organization = Organization(client) + +val response = organization.deleteProject( + projectId = "<PROJECT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/organization/get-project.md b/examples/2.0.x/server-kotlin/kotlin/organization/get-project.md new file mode 100644 index 000000000..a6611776a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/organization/get-project.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organization + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val organization = Organization(client) + +val response = organization.getProject( + projectId = "<PROJECT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/organization/list-projects.md b/examples/2.0.x/server-kotlin/kotlin/organization/list-projects.md new file mode 100644 index 000000000..2433900c7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/organization/list-projects.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organization + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val organization = Organization(client) + +val response = organization.listProjects( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/organization/update-project.md b/examples/2.0.x/server-kotlin/kotlin/organization/update-project.md new file mode 100644 index 000000000..74b935314 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/organization/update-project.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Organization + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val organization = Organization(client) + +val response = organization.updateProject( + projectId = "<PROJECT_ID>", + name = "<NAME>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/presences/delete.md b/examples/2.0.x/server-kotlin/kotlin/presences/delete.md new file mode 100644 index 000000000..f19489f26 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/presences/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val presences = Presences(client) + +val response = presences.delete( + presenceId = "<PRESENCE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/presences/get.md b/examples/2.0.x/server-kotlin/kotlin/presences/get.md new file mode 100644 index 000000000..bf1529539 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/presences/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val presences = Presences(client) + +val response = presences.get( + presenceId = "<PRESENCE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/presences/list.md b/examples/2.0.x/server-kotlin/kotlin/presences/list.md new file mode 100644 index 000000000..3426a0a29 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/presences/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val presences = Presences(client) + +val response = presences.list( + queries = listOf(), // optional + total = false, // optional + ttl = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/presences/update.md b/examples/2.0.x/server-kotlin/kotlin/presences/update.md new file mode 100644 index 000000000..2089c6441 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/presences/update.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val presences = Presences(client) + +val response = presences.update( + presenceId = "<PRESENCE_ID>", + userId = "<USER_ID>", + status = "<STATUS>", // optional + expiresAt = "2020-10-15T06:38:00.000+00:00", // optional + metadata = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + purge = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/presences/upsert.md b/examples/2.0.x/server-kotlin/kotlin/presences/upsert.md new file mode 100644 index 000000000..39d0c859b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/presences/upsert.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Presences +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val presences = Presences(client) + +val response = presences.upsert( + presenceId = "<PRESENCE_ID>", + userId = "<USER_ID>", + status = "<STATUS>", + permissions = listOf(Permission.read(Role.any())), // optional + expiresAt = "2020-10-15T06:38:00.000+00:00", // optional + metadata = mapOf( "a" to "b" ) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-android-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/create-android-platform.md new file mode 100644 index 000000000..9b2d64fbc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-android-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createAndroidPlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + applicationId = "<APPLICATION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-apple-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/create-apple-platform.md new file mode 100644 index 000000000..2ab03170a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-apple-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createApplePlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + bundleIdentifier = "<BUNDLE_IDENTIFIER>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-ephemeral-key.md b/examples/2.0.x/server-kotlin/kotlin/project/create-ephemeral-key.md new file mode 100644 index 000000000..b29f4b406 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-ephemeral-key.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectKeyScopes + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createEphemeralKey( + scopes = listOf(ProjectKeyScopes.PROJECT_READ), + duration = 600 +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-linux-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/create-linux-platform.md new file mode 100644 index 000000000..0443dfbe4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-linux-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createLinuxPlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + packageName = "<PACKAGE_NAME>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-mock-phone.md b/examples/2.0.x/server-kotlin/kotlin/project/create-mock-phone.md new file mode 100644 index 000000000..e8babf68c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-mock-phone.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createMockPhone( + number = "+12065550100", + otp = "<OTP>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-smtp-test.md b/examples/2.0.x/server-kotlin/kotlin/project/create-smtp-test.md new file mode 100644 index 000000000..b457518ec --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-smtp-test.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createSMTPTest( + emails = listOf() +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-variable.md b/examples/2.0.x/server-kotlin/kotlin/project/create-variable.md new file mode 100644 index 000000000..e61e1baad --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-variable.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createVariable( + variableId = "<VARIABLE_ID>", + key = "<KEY>", + value = "<VALUE>", + secret = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-web-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/create-web-platform.md new file mode 100644 index 000000000..309e6a2fb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-web-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createWebPlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + hostname = "app.example.com" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/create-windows-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/create-windows-platform.md new file mode 100644 index 000000000..648851dcc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/create-windows-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.createWindowsPlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + packageIdentifierName = "<PACKAGE_IDENTIFIER_NAME>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/delete-key.md b/examples/2.0.x/server-kotlin/kotlin/project/delete-key.md new file mode 100644 index 000000000..0141ae95f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/delete-key.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.deleteKey( + keyId = "<KEY_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/delete-mock-phone.md b/examples/2.0.x/server-kotlin/kotlin/project/delete-mock-phone.md new file mode 100644 index 000000000..963fbc981 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/delete-mock-phone.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.deleteMockPhone( + number = "+12065550100" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/delete-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/delete-platform.md new file mode 100644 index 000000000..7b3a91230 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/delete-platform.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.deletePlatform( + platformId = "<PLATFORM_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/delete-variable.md b/examples/2.0.x/server-kotlin/kotlin/project/delete-variable.md new file mode 100644 index 000000000..674d805dc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/delete-variable.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.deleteVariable( + variableId = "<VARIABLE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/delete.md b/examples/2.0.x/server-kotlin/kotlin/project/delete.md new file mode 100644 index 000000000..29668a25c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/delete.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.delete() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/get-email-template.md b/examples/2.0.x/server-kotlin/kotlin/project/get-email-template.md new file mode 100644 index 000000000..afb83fb05 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/get-email-template.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectEmailTemplateId +import io.appwrite.enums.ProjectEmailTemplateLocale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.getEmailTemplate( + templateId = ProjectEmailTemplateId.VERIFICATION, + locale = ProjectEmailTemplateLocale.AF // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/get-key.md b/examples/2.0.x/server-kotlin/kotlin/project/get-key.md new file mode 100644 index 000000000..20c00451a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/get-key.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.getKey( + keyId = "<KEY_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/get-mock-phone.md b/examples/2.0.x/server-kotlin/kotlin/project/get-mock-phone.md new file mode 100644 index 000000000..3051539db --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/get-mock-phone.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.getMockPhone( + number = "+12065550100" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/get-o-auth-2-provider.md b/examples/2.0.x/server-kotlin/kotlin/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..7a41003d7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/get-o-auth-2-provider.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectOAuthProviderId + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.getOAuth2Provider( + providerId = ProjectOAuthProviderId.AMAZON +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/get-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/get-platform.md new file mode 100644 index 000000000..d436d7306 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/get-platform.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.getPlatform( + platformId = "<PLATFORM_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/get-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/get-policy.md new file mode 100644 index 000000000..62b5dcd54 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/get-policy.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectPolicyId + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.getPolicy( + policyId = ProjectPolicyId.PASSWORD_DICTIONARY +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/get-variable.md b/examples/2.0.x/server-kotlin/kotlin/project/get-variable.md new file mode 100644 index 000000000..59dea6483 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/get-variable.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.getVariable( + variableId = "<VARIABLE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/get.md b/examples/2.0.x/server-kotlin/kotlin/project/get.md new file mode 100644 index 000000000..c910566a6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/get.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.get() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/list-email-templates.md b/examples/2.0.x/server-kotlin/kotlin/project/list-email-templates.md new file mode 100644 index 000000000..f1ced3985 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/list-email-templates.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.listEmailTemplates( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/list-keys.md b/examples/2.0.x/server-kotlin/kotlin/project/list-keys.md new file mode 100644 index 000000000..d1e4ebf86 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/list-keys.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.listKeys( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/list-mock-phones.md b/examples/2.0.x/server-kotlin/kotlin/project/list-mock-phones.md new file mode 100644 index 000000000..6ac56a26d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/list-mock-phones.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.listMockPhones( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/list-o-auth-2-providers.md b/examples/2.0.x/server-kotlin/kotlin/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..de6e25adc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/list-o-auth-2-providers.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.listOAuth2Providers( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/list-platforms.md b/examples/2.0.x/server-kotlin/kotlin/project/list-platforms.md new file mode 100644 index 000000000..04f5cbf86 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/list-platforms.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.listPlatforms( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/list-policies.md b/examples/2.0.x/server-kotlin/kotlin/project/list-policies.md new file mode 100644 index 000000000..bfad4f513 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/list-policies.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.listPolicies( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/list-variables.md b/examples/2.0.x/server-kotlin/kotlin/project/list-variables.md new file mode 100644 index 000000000..d455a1536 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/list-variables.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.listVariables( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-android-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/update-android-platform.md new file mode 100644 index 000000000..ae25a8c5e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-android-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateAndroidPlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + applicationId = "<APPLICATION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-apple-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/update-apple-platform.md new file mode 100644 index 000000000..c299acb9f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-apple-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateApplePlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + bundleIdentifier = "<BUNDLE_IDENTIFIER>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-auth-method.md b/examples/2.0.x/server-kotlin/kotlin/project/update-auth-method.md new file mode 100644 index 000000000..0761cf5a6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-auth-method.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectAuthMethodId + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateAuthMethod( + methodId = ProjectAuthMethodId.EMAIL_PASSWORD, + enabled = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-email-template.md b/examples/2.0.x/server-kotlin/kotlin/project/update-email-template.md new file mode 100644 index 000000000..211ac14c2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-email-template.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectEmailTemplateId +import io.appwrite.enums.ProjectEmailTemplateLocale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateEmailTemplate( + templateId = ProjectEmailTemplateId.VERIFICATION, + locale = ProjectEmailTemplateLocale.AF, // optional + subject = "<SUBJECT>", // optional + message = "<MESSAGE>", // optional + senderName = "<SENDER_NAME>", // optional + senderEmail = "email@example.com", // optional + replyToEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-key.md b/examples/2.0.x/server-kotlin/kotlin/project/update-key.md new file mode 100644 index 000000000..714a20e20 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-key.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectKeyScopes + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateKey( + keyId = "<KEY_ID>", + name = "<NAME>", + scopes = listOf(ProjectKeyScopes.PROJECT_READ), + expire = "2020-10-15T06:38:00.000+00:00" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-labels.md b/examples/2.0.x/server-kotlin/kotlin/project/update-labels.md new file mode 100644 index 000000000..fd68ba524 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-labels.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateLabels( + labels = listOf() +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-linux-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/update-linux-platform.md new file mode 100644 index 000000000..8ddd08496 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-linux-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateLinuxPlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + packageName = "<PACKAGE_NAME>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-membership-privacy-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..d3d90669b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-membership-privacy-policy.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateMembershipPrivacyPolicy( + userId = false, // optional + userEmail = false, // optional + userPhone = false, // optional + userName = false, // optional + userMFA = false, // optional + userAccessedAt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-mfa-factors-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..85fb7580d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-mfa-factors-policy.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateMFAFactorsPolicy( + totp = false, // optional + email = false, // optional + phone = false, // optional + custom = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-mock-phone.md b/examples/2.0.x/server-kotlin/kotlin/project/update-mock-phone.md new file mode 100644 index 000000000..54b132a33 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-mock-phone.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateMockPhone( + number = "+12065550100", + otp = "<OTP>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..552ac2a0b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-amazon.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Amazon( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-apple.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..9739c0bfe --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-apple.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Apple( + serviceId = "<SERVICE_ID>", // optional + keyId = "<KEY_ID>", // optional + teamId = "<TEAM_ID>", // optional + p8File = "<P8_FILE>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..f3a47a0d2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-appwrite.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Appwrite( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..da0419765 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-auth-0.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Auth0( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + endpoint = "<ENDPOINT>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..8c3b47d37 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-authentik.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Authentik( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + endpoint = "<ENDPOINT>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..7e0b6dfa3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-autodesk.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Autodesk( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..6a38d096f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Bitbucket( + key = "<KEY>", // optional + secret = "<SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..eb6e346ad --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-bitly.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Bitly( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-box.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-box.md new file mode 100644 index 000000000..b77a82cd5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-box.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Box( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..0d7e20d57 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Cloudflare( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..d45444122 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Dailymotion( + apiKey = "<API_KEY>", // optional + apiSecret = "<API_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-discord.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..a4d506b3f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-discord.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Discord( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..83f0d6904 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-disqus.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Disqus( + publicKey = "<PUBLIC_KEY>", // optional + secretKey = "<SECRET_KEY>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..0b36434ab --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-dropbox.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Dropbox( + appKey = "<APP_KEY>", // optional + appSecret = "<APP_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..edec5b5e3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-etsy.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Etsy( + keyString = "<KEY_STRING>", // optional + sharedSecret = "<SHARED_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..952151f25 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-facebook.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Facebook( + appId = "<APP_ID>", // optional + appSecret = "<APP_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-figma.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..fb305af6a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-figma.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Figma( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..0db1694e2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2FusionAuth( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + endpoint = "<ENDPOINT>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..e4070b396 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-git-hub.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2GitHub( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..b7779c832 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-gitlab.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Gitlab( + applicationId = "<APPLICATION_ID>", // optional + secret = "<SECRET>", // optional + endpoint = "https://example.com", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-google.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-google.md new file mode 100644 index 000000000..d083b2987 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-google.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectOAuth2GooglePrompt + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Google( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + prompt = listOf(ProjectOAuth2GooglePrompt.NONE), // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..afaa54359 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2HuggingFace( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..ac4012d7b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-keycloak.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Keycloak( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + endpoint = "<ENDPOINT>", // optional + realmName = "<REALM_NAME>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-kick.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..1da5c8a09 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-kick.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Kick( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..99e404f4d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-linkedin.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Linkedin( + clientId = "<CLIENT_ID>", // optional + primaryClientSecret = "<PRIMARY_CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..c44372a88 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-microsoft.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Microsoft( + applicationId = "<APPLICATION_ID>", // optional + applicationSecret = "<APPLICATION_SECRET>", // optional + tenant = "<TENANT>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-notion.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..05dc95023 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-notion.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Notion( + oauthClientId = "<OAUTH_CLIENT_ID>", // optional + oauthClientSecret = "<OAUTH_CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..e05e2bfad --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-oidc.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectOAuth2OidcPrompt + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Oidc( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + wellKnownURL = "https://example.com", // optional + authorizationURL = "https://example.com", // optional + tokenURL = "https://example.com", // optional + userInfoURL = "https://example.com", // optional + prompt = listOf(ProjectOAuth2OidcPrompt.NONE), // optional + maxAge = 0, // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-okta.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..532079ae8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-okta.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Okta( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + domain = "example.com", // optional + authorizationServerId = "<AUTHORIZATION_SERVER_ID>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..bec13bde6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2PaypalSandbox( + clientId = "<CLIENT_ID>", // optional + secretKey = "<SECRET_KEY>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..7ceeaa6b4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-paypal.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Paypal( + clientId = "<CLIENT_ID>", // optional + secretKey = "<SECRET_KEY>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-podio.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..9cc859732 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-podio.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Podio( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-resend.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..c4e13e4e9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-resend.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Resend( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..a8b1244b4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-salesforce.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Salesforce( + customerKey = "<CUSTOMER_KEY>", // optional + customerSecret = "<CUSTOMER_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-slack.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..358611030 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-slack.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Slack( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..c1431e483 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-spotify.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Spotify( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..bad2cc42a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-stripe.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Stripe( + clientId = "<CLIENT_ID>", // optional + apiSecretKey = "<API_SECRET_KEY>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..aec834f93 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2TradeshiftSandbox( + oauth2ClientId = "<OAUTH2_CLIENT_ID>", // optional + oauth2ClientSecret = "<OAUTH2_CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..ac5b816a0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Tradeshift( + oauth2ClientId = "<OAUTH2_CLIENT_ID>", // optional + oauth2ClientSecret = "<OAUTH2_CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..e8c1b957e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-twitch.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Twitch( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..6fbe200d6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-word-press.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2WordPress( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..c96e6fd7b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-yahoo.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Yahoo( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..a48d01942 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-yandex.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Yandex( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..98f72a65f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-zoho.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Zoho( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..c934edf05 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2-zoom.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2Zoom( + clientId = "<CLIENT_ID>", // optional + clientSecret = "<CLIENT_SECRET>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2x.md b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2x.md new file mode 100644 index 000000000..ebcc4543a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-o-auth-2x.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateOAuth2X( + customerKey = "<CUSTOMER_KEY>", // optional + secretKey = "<SECRET_KEY>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-password-dictionary-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..672a89f0e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-password-dictionary-policy.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updatePasswordDictionaryPolicy( + enabled = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-password-history-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-password-history-policy.md new file mode 100644 index 000000000..6580d3e5d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-password-history-policy.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updatePasswordHistoryPolicy( + total = 1 +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-password-personal-data-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..49b08f335 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-password-personal-data-policy.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updatePasswordPersonalDataPolicy( + enabled = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-password-strength-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-password-strength-policy.md new file mode 100644 index 000000000..7f4019b17 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-password-strength-policy.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updatePasswordStrengthPolicy( + min = 8, // optional + uppercase = false, // optional + lowercase = false, // optional + number = false, // optional + symbols = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-protocol.md b/examples/2.0.x/server-kotlin/kotlin/project/update-protocol.md new file mode 100644 index 000000000..fe9533b27 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-protocol.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectProtocolId + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateProtocol( + protocolId = ProjectProtocolId.REST, + enabled = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-service.md b/examples/2.0.x/server-kotlin/kotlin/project/update-service.md new file mode 100644 index 000000000..19943d7dd --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-service.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectServiceId + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateService( + serviceId = ProjectServiceId.ACCOUNT, + enabled = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-session-alert-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-session-alert-policy.md new file mode 100644 index 000000000..233999533 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-session-alert-policy.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateSessionAlertPolicy( + enabled = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-session-duration-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-session-duration-policy.md new file mode 100644 index 000000000..9b69ee1b1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-session-duration-policy.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateSessionDurationPolicy( + duration = 60 +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-session-invalidation-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..c7f336e9d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-session-invalidation-policy.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateSessionInvalidationPolicy( + enabled = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-session-limit-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-session-limit-policy.md new file mode 100644 index 000000000..56831a952 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-session-limit-policy.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateSessionLimitPolicy( + total = 1 +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-smtp.md b/examples/2.0.x/server-kotlin/kotlin/project/update-smtp.md new file mode 100644 index 000000000..7d043d009 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-smtp.md @@ -0,0 +1,26 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project +import io.appwrite.enums.ProjectSMTPSecure + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateSMTP( + host = "example.com", // optional + port = 587, // optional + username = "<USERNAME>", // optional + password = "password", // optional + senderEmail = "email@example.com", // optional + senderName = "<SENDER_NAME>", // optional + replyToEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + secure = ProjectSMTPSecure.TLS, // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-user-limit-policy.md b/examples/2.0.x/server-kotlin/kotlin/project/update-user-limit-policy.md new file mode 100644 index 000000000..67d22ca08 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-user-limit-policy.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateUserLimitPolicy( + total = 0 +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-variable.md b/examples/2.0.x/server-kotlin/kotlin/project/update-variable.md new file mode 100644 index 000000000..cc6b22e1a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-variable.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateVariable( + variableId = "<VARIABLE_ID>", + key = "<KEY>", // optional + value = "<VALUE>", // optional + secret = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-web-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/update-web-platform.md new file mode 100644 index 000000000..923ba70e5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-web-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateWebPlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + hostname = "app.example.com" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/project/update-windows-platform.md b/examples/2.0.x/server-kotlin/kotlin/project/update-windows-platform.md new file mode 100644 index 000000000..a8e709218 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/project/update-windows-platform.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Project + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val project = Project(client) + +val response = project.updateWindowsPlatform( + platformId = "<PLATFORM_ID>", + name = "<NAME>", + packageIdentifierName = "<PACKAGE_IDENTIFIER_NAME>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/proxy/create-api-rule.md b/examples/2.0.x/server-kotlin/kotlin/proxy/create-api-rule.md new file mode 100644 index 000000000..8440808f5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/proxy/create-api-rule.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Proxy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val proxy = Proxy(client) + +val response = proxy.createAPIRule( + domain = "example.com" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/proxy/create-function-rule.md b/examples/2.0.x/server-kotlin/kotlin/proxy/create-function-rule.md new file mode 100644 index 000000000..d7e610bfa --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/proxy/create-function-rule.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Proxy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val proxy = Proxy(client) + +val response = proxy.createFunctionRule( + domain = "example.com", + functionId = "<FUNCTION_ID>", + branch = "<BRANCH>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/proxy/create-redirect-rule.md b/examples/2.0.x/server-kotlin/kotlin/proxy/create-redirect-rule.md new file mode 100644 index 000000000..48de0957c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/proxy/create-redirect-rule.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Proxy +import io.appwrite.enums.StatusCode +import io.appwrite.enums.ProxyResourceType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val proxy = Proxy(client) + +val response = proxy.createRedirectRule( + domain = "example.com", + url = "https://example.com", + statusCode = StatusCode.MOVEDPERMANENTLY, + resourceId = "<RESOURCE_ID>", + resourceType = ProxyResourceType.SITE +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/proxy/create-site-rule.md b/examples/2.0.x/server-kotlin/kotlin/proxy/create-site-rule.md new file mode 100644 index 000000000..001b1201f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/proxy/create-site-rule.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Proxy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val proxy = Proxy(client) + +val response = proxy.createSiteRule( + domain = "example.com", + siteId = "<SITE_ID>", + branch = "<BRANCH>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/proxy/delete-rule.md b/examples/2.0.x/server-kotlin/kotlin/proxy/delete-rule.md new file mode 100644 index 000000000..79035f3d4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/proxy/delete-rule.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Proxy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val proxy = Proxy(client) + +val response = proxy.deleteRule( + ruleId = "<RULE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/proxy/get-rule.md b/examples/2.0.x/server-kotlin/kotlin/proxy/get-rule.md new file mode 100644 index 000000000..598bcb08c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/proxy/get-rule.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Proxy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val proxy = Proxy(client) + +val response = proxy.getRule( + ruleId = "<RULE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/proxy/list-rules.md b/examples/2.0.x/server-kotlin/kotlin/proxy/list-rules.md new file mode 100644 index 000000000..1c77b7545 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/proxy/list-rules.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Proxy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val proxy = Proxy(client) + +val response = proxy.listRules( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/proxy/update-rule-status.md b/examples/2.0.x/server-kotlin/kotlin/proxy/update-rule-status.md new file mode 100644 index 000000000..df40b2012 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/proxy/update-rule-status.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Proxy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val proxy = Proxy(client) + +val response = proxy.updateRuleStatus( + ruleId = "<RULE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/create-deployment.md b/examples/2.0.x/server-kotlin/kotlin/sites/create-deployment.md new file mode 100644 index 000000000..f9691190f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/create-deployment.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createDeployment( + siteId = "<SITE_ID>", + code = InputFile.fromPath("file.png"), + installCommand = "<INSTALL_COMMAND>", // optional + buildCommand = "<BUILD_COMMAND>", // optional + outputDirectory = "<OUTPUT_DIRECTORY>", // optional + activate = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/create-duplicate-deployment.md b/examples/2.0.x/server-kotlin/kotlin/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..0bbc1c117 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/create-duplicate-deployment.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createDuplicateDeployment( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/create-template-deployment.md b/examples/2.0.x/server-kotlin/kotlin/sites/create-template-deployment.md new file mode 100644 index 000000000..65515cc8c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/create-template-deployment.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.TemplateReferenceType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createTemplateDeployment( + siteId = "<SITE_ID>", + repository = "<REPOSITORY>", + owner = "<OWNER>", + rootDirectory = "<ROOT_DIRECTORY>", + type = TemplateReferenceType.BRANCH, + reference = "<REFERENCE>", + activate = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/create-variable.md b/examples/2.0.x/server-kotlin/kotlin/sites/create-variable.md new file mode 100644 index 000000000..f3df9cf13 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/create-variable.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createVariable( + siteId = "<SITE_ID>", + variableId = "<VARIABLE_ID>", + key = "<KEY>", + value = "<VALUE>", + secret = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/create-vcs-deployment.md b/examples/2.0.x/server-kotlin/kotlin/sites/create-vcs-deployment.md new file mode 100644 index 000000000..9e7cd91ee --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/create-vcs-deployment.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.VCSReferenceType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createVcsDeployment( + siteId = "<SITE_ID>", + type = VCSReferenceType.BRANCH, + reference = "<REFERENCE>", + activate = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/create.md b/examples/2.0.x/server-kotlin/kotlin/sites/create.md new file mode 100644 index 000000000..7c4102f55 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/create.md @@ -0,0 +1,43 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.Framework +import io.appwrite.enums.BuildRuntime +import io.appwrite.enums.Adapter +import io.appwrite.enums.ProjectKeyScopes + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.create( + siteId = "<SITE_ID>", + name = "<NAME>", + framework = Framework.ANALOG, + buildRuntime = BuildRuntime.NODE_14_5, + enabled = false, // optional + logging = false, // optional + timeout = 1, // optional + installCommand = "<INSTALL_COMMAND>", // optional + buildCommand = "<BUILD_COMMAND>", // optional + startCommand = "<START_COMMAND>", // optional + outputDirectory = "<OUTPUT_DIRECTORY>", // optional + adapter = Adapter.STATIC, // optional + installationId = "<INSTALLATION_ID>", // optional + fallbackFile = "<FALLBACK_FILE>", // optional + providerRepositoryId = "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch = "<PROVIDER_BRANCH>", // optional + providerSilentMode = false, // optional + providerRootDirectory = "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches = listOf(), // optional + providerPaths = listOf(), // optional + buildSpecification = "s-1vcpu-512mb", // optional + runtimeSpecification = "s-1vcpu-512mb", // optional + deploymentRetention = 0, // optional + scopes = listOf(ProjectKeyScopes.PROJECT_READ) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/delete-deployment.md b/examples/2.0.x/server-kotlin/kotlin/sites/delete-deployment.md new file mode 100644 index 000000000..76400fc5d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/delete-deployment.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteDeployment( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/delete-log.md b/examples/2.0.x/server-kotlin/kotlin/sites/delete-log.md new file mode 100644 index 000000000..5a3714107 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/delete-log.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteLog( + siteId = "<SITE_ID>", + logId = "<LOG_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/delete-variable.md b/examples/2.0.x/server-kotlin/kotlin/sites/delete-variable.md new file mode 100644 index 000000000..4df5d2904 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/delete-variable.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteVariable( + siteId = "<SITE_ID>", + variableId = "<VARIABLE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/delete.md b/examples/2.0.x/server-kotlin/kotlin/sites/delete.md new file mode 100644 index 000000000..d1c5bbe44 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.delete( + siteId = "<SITE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment-download.md b/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment-download.md new file mode 100644 index 000000000..374e13764 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment-download.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.DeploymentDownloadType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val result = sites.getDeploymentDownload( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>", + type = DeploymentDownloadType.SOURCE, // optional + token = "<TOKEN>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment.md b/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment.md new file mode 100644 index 000000000..f20cd5e70 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/get-deployment.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.getDeployment( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/get-log.md b/examples/2.0.x/server-kotlin/kotlin/sites/get-log.md new file mode 100644 index 000000000..57f352025 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/get-log.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.getLog( + siteId = "<SITE_ID>", + logId = "<LOG_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/get-variable.md b/examples/2.0.x/server-kotlin/kotlin/sites/get-variable.md new file mode 100644 index 000000000..691e919f4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/get-variable.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.getVariable( + siteId = "<SITE_ID>", + variableId = "<VARIABLE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/get.md b/examples/2.0.x/server-kotlin/kotlin/sites/get.md new file mode 100644 index 000000000..735b51967 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.get( + siteId = "<SITE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/list-deployments.md b/examples/2.0.x/server-kotlin/kotlin/sites/list-deployments.md new file mode 100644 index 000000000..cf092dbc2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/list-deployments.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listDeployments( + siteId = "<SITE_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/list-frameworks.md b/examples/2.0.x/server-kotlin/kotlin/sites/list-frameworks.md new file mode 100644 index 000000000..6c7aa92de --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/list-frameworks.md @@ -0,0 +1,14 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listFrameworks() +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/list-logs.md b/examples/2.0.x/server-kotlin/kotlin/sites/list-logs.md new file mode 100644 index 000000000..bfb8556b9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/list-logs.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listLogs( + siteId = "<SITE_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/list-specifications.md b/examples/2.0.x/server-kotlin/kotlin/sites/list-specifications.md new file mode 100644 index 000000000..12d0e9c8f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/list-specifications.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listSpecifications( + type = "runtimes" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/list-variables.md b/examples/2.0.x/server-kotlin/kotlin/sites/list-variables.md new file mode 100644 index 000000000..5ff7f7d95 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/list-variables.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listVariables( + siteId = "<SITE_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/list.md b/examples/2.0.x/server-kotlin/kotlin/sites/list.md new file mode 100644 index 000000000..3b064979f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.list( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/update-deployment-status.md b/examples/2.0.x/server-kotlin/kotlin/sites/update-deployment-status.md new file mode 100644 index 000000000..c9727b374 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/update-deployment-status.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateDeploymentStatus( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/update-site-deployment.md b/examples/2.0.x/server-kotlin/kotlin/sites/update-site-deployment.md new file mode 100644 index 000000000..7f3da4237 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/update-site-deployment.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateSiteDeployment( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/update-variable.md b/examples/2.0.x/server-kotlin/kotlin/sites/update-variable.md new file mode 100644 index 000000000..ed5e7179a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/update-variable.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateVariable( + siteId = "<SITE_ID>", + variableId = "<VARIABLE_ID>", + key = "<KEY>", // optional + value = "<VALUE>", // optional + secret = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/sites/update.md b/examples/2.0.x/server-kotlin/kotlin/sites/update.md new file mode 100644 index 000000000..8f885cf14 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/sites/update.md @@ -0,0 +1,43 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.Framework +import io.appwrite.enums.BuildRuntime +import io.appwrite.enums.Adapter +import io.appwrite.enums.ProjectKeyScopes + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.update( + siteId = "<SITE_ID>", + name = "<NAME>", + framework = Framework.ANALOG, + enabled = false, // optional + logging = false, // optional + timeout = 1, // optional + installCommand = "<INSTALL_COMMAND>", // optional + buildCommand = "<BUILD_COMMAND>", // optional + startCommand = "<START_COMMAND>", // optional + outputDirectory = "<OUTPUT_DIRECTORY>", // optional + buildRuntime = BuildRuntime.NODE_14_5, // optional + adapter = Adapter.STATIC, // optional + fallbackFile = "<FALLBACK_FILE>", // optional + installationId = "<INSTALLATION_ID>", // optional + providerRepositoryId = "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch = "<PROVIDER_BRANCH>", // optional + providerSilentMode = false, // optional + providerRootDirectory = "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches = listOf(), // optional + providerPaths = listOf(), // optional + buildSpecification = "s-1vcpu-512mb", // optional + runtimeSpecification = "s-1vcpu-512mb", // optional + deploymentRetention = 0, // optional + scopes = listOf(ProjectKeyScopes.PROJECT_READ) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/create-bucket.md b/examples/2.0.x/server-kotlin/kotlin/storage/create-bucket.md new file mode 100644 index 000000000..a2f2be7af --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/create-bucket.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage +import io.appwrite.enums.Compression +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.createBucket( + bucketId = "<BUCKET_ID>", + name = "<NAME>", + permissions = listOf(Permission.read(Role.any())), // optional + fileSecurity = false, // optional + enabled = false, // optional + maximumFileSize = 1, // optional + allowedFileExtensions = listOf(), // optional + compression = Compression.NONE, // optional + encryption = false, // optional + antivirus = false, // optional + transformations = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/create-file.md b/examples/2.0.x/server-kotlin/kotlin/storage/create-file.md new file mode 100644 index 000000000..dc0bc17fc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/create-file.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Storage +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.createFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + file = InputFile.fromPath("file.png"), + permissions = listOf(Permission.read(Role.any())), // optional + folder = "photos/2026" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/delete-bucket.md b/examples/2.0.x/server-kotlin/kotlin/storage/delete-bucket.md new file mode 100644 index 000000000..a5f681c67 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/delete-bucket.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.deleteBucket( + bucketId = "<BUCKET_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/delete-file.md b/examples/2.0.x/server-kotlin/kotlin/storage/delete-file.md new file mode 100644 index 000000000..8ba5a38cb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/delete-file.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.deleteFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/get-bucket.md b/examples/2.0.x/server-kotlin/kotlin/storage/get-bucket.md new file mode 100644 index 000000000..b243bc3f7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/get-bucket.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.getBucket( + bucketId = "<BUCKET_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-download.md b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-download.md new file mode 100644 index 000000000..ed3198dde --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-download.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val result = storage.getFileDownload( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + token = "<TOKEN>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-preview.md b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-preview.md new file mode 100644 index 000000000..a2d4e18be --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-preview.md @@ -0,0 +1,31 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage +import io.appwrite.enums.ImageGravity +import io.appwrite.enums.ImageFormat + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val result = storage.getFilePreview( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + width = 0, // optional + height = 0, // optional + gravity = ImageGravity.CENTER, // optional + quality = -1, // optional + borderWidth = 0, // optional + borderColor = "FFFFFF", // optional + borderRadius = 0, // optional + opacity = 0, // optional + rotation = -360, // optional + background = "FFFFFF", // optional + output = ImageFormat.JPG, // optional + token = "<TOKEN>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/get-file-view.md b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-view.md new file mode 100644 index 000000000..141a8cd4f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/get-file-view.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val result = storage.getFileView( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + token = "<TOKEN>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/get-file.md b/examples/2.0.x/server-kotlin/kotlin/storage/get-file.md new file mode 100644 index 000000000..223075939 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/get-file.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.getFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/list-buckets.md b/examples/2.0.x/server-kotlin/kotlin/storage/list-buckets.md new file mode 100644 index 000000000..94c0bb6a1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/list-buckets.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.listBuckets( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/list-files.md b/examples/2.0.x/server-kotlin/kotlin/storage/list-files.md new file mode 100644 index 000000000..bc1e60aae --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/list-files.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.listFiles( + bucketId = "<BUCKET_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/update-bucket.md b/examples/2.0.x/server-kotlin/kotlin/storage/update-bucket.md new file mode 100644 index 000000000..99e928c6c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/update-bucket.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage +import io.appwrite.enums.Compression +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.updateBucket( + bucketId = "<BUCKET_ID>", + name = "<NAME>", + permissions = listOf(Permission.read(Role.any())), // optional + fileSecurity = false, // optional + enabled = false, // optional + maximumFileSize = 1, // optional + allowedFileExtensions = listOf(), // optional + compression = Compression.NONE, // optional + encryption = false, // optional + antivirus = false, // optional + transformations = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/storage/update-file.md b/examples/2.0.x/server-kotlin/kotlin/storage/update-file.md new file mode 100644 index 000000000..8bcebadd7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/storage/update-file.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.updateFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + name = "<NAME>", // optional + permissions = listOf(Permission.read(Role.any())) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-big-int-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..66bb973af --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-big-int-column.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createBigIntColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + min = 0, // optional + max = 1000000, // optional + default = 0, // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-boolean-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..b04ddff3a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-boolean-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createBooleanColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = false, // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-datetime-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..40208f9b5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-datetime-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createDatetimeColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "2020-10-15T06:38:00.000+00:00", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-email-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-email-column.md new file mode 100644 index 000000000..2ae58ac3d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-email-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createEmailColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "email@example.com", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-enum-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-enum-column.md new file mode 100644 index 000000000..a8ed38176 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-enum-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createEnumColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + elements = listOf("active", "inactive"), + required = false, + default = "active", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-float-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-float-column.md new file mode 100644 index 000000000..321b83c2c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-float-column.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createFloatColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + min = 0, // optional + max = 100, // optional + default = 10.5, // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-index.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-index.md new file mode 100644 index 000000000..5364f58d1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-index.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.enums.TablesDBIndexType +import io.appwrite.enums.OrderBy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIndex( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + type = TablesDBIndexType.KEY, + columns = listOf(), + orders = listOf(OrderBy.ASC), // optional + lengths = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-integer-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-integer-column.md new file mode 100644 index 000000000..98dc8a19c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-integer-column.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIntegerColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + min = 0, // optional + max = 100, // optional + default = 10, // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-ip-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-ip-column.md new file mode 100644 index 000000000..759ad7aaf --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-ip-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIpColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "192.0.2.0", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-line-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-line-column.md new file mode 100644 index 000000000..4f28769f9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-line-column.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createLineColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6)) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-longtext-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..fd6b58ac4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-longtext-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createLongtextColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..67e372ae3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-mediumtext-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createMediumtextColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-operations.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-operations.md new file mode 100644 index 000000000..d2c6f7a02 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-operations.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createOperations( + transactionId = "<TRANSACTION_ID>", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "<DATABASE_ID>", + "tableId" to "<TABLE_ID>", + "rowId" to "<ROW_ID>", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-point-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-point-column.md new file mode 100644 index 000000000..f48aa2c01 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-point-column.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createPointColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = listOf(1, 2) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-polygon-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..2d7478f8c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-polygon-column.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createPolygonColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = listOf(listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6), listOf(1, 2))) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-relationship-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..66f318eab --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-relationship-column.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.enums.RelationshipType +import io.appwrite.enums.RelationMutate + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRelationshipColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + relatedTableId = "<RELATED_TABLE_ID>", + type = RelationshipType.ONETOONE, + twoWay = false, // optional + key = "<KEY>", // optional + twoWayKey = "<TWO_WAY_KEY>", // optional + onDelete = RelationMutate.CASCADE // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-row.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-row.md new file mode 100644 index 000000000..4cd0dd06f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-row.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-rows.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-rows.md new file mode 100644 index 000000000..5cb02b780 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-rows.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rows = listOf(), + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-string-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-string-column.md new file mode 100644 index 000000000..c7af9b773 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-string-column.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createStringColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + size = 1, + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-table.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-table.md new file mode 100644 index 000000000..cdc00e204 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-table.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createTable( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + name = "<NAME>", + permissions = listOf(Permission.read(Role.any())), // optional + rowSecurity = false, // optional + enabled = false, // optional + columns = listOf(), // optional + indexes = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-text-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-text-column.md new file mode 100644 index 000000000..5cee07d6b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-text-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createTextColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-transaction.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-transaction.md new file mode 100644 index 000000000..c7594185b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createTransaction( + ttl = 60 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-url-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-url-column.md new file mode 100644 index 000000000..3acd47c17 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-url-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createUrlColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "https://example.com", // optional + array = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-varchar-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..724c81dfa --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create-varchar-column.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createVarcharColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + size = 1, + required = false, + default = "Hello World", // optional + array = false, // optional + encrypt = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/create.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create.md new file mode 100644 index 000000000..622f66e2a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/create.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.create( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/decrement-row-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..bba950a9d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/decrement-row-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.decrementRowColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + column = "<COLUMN>", + value = 1, // optional + min = 0, // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-column.md new file mode 100644 index 000000000..cf8eed8f4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-column.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-index.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-index.md new file mode 100644 index 000000000..25e176e33 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteIndex( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-row.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-row.md new file mode 100644 index 000000000..e332db02f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-row.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-rows.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-rows.md new file mode 100644 index 000000000..00cd5abe0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-rows.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-table.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-table.md new file mode 100644 index 000000000..d83d92701 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-table.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteTable( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-transaction.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-transaction.md new file mode 100644 index 000000000..8e8641bf7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteTransaction( + transactionId = "<TRANSACTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete.md new file mode 100644 index 000000000..15035253a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.delete( + databaseId = "<DATABASE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-column.md new file mode 100644 index 000000000..56550c9de --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-column.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-index.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-index.md new file mode 100644 index 000000000..e40b0c1b5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getIndex( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-row.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-row.md new file mode 100644 index 000000000..18845e2a3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-row.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.getRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-table.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-table.md new file mode 100644 index 000000000..6595254a2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-table.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getTable( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-transaction.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-transaction.md new file mode 100644 index 000000000..c478eb8e5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getTransaction( + transactionId = "<TRANSACTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/get.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get.md new file mode 100644 index 000000000..9d9de009f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.get( + databaseId = "<DATABASE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/increment-row-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/increment-row-column.md new file mode 100644 index 000000000..ad4056d4d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/increment-row-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.incrementRowColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + column = "<COLUMN>", + value = 1, // optional + max = 100, // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-columns.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-columns.md new file mode 100644 index 000000000..786773749 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-columns.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listColumns( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-indexes.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-indexes.md new file mode 100644 index 000000000..edd5cbd2b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-indexes.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listIndexes( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-rows.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-rows.md new file mode 100644 index 000000000..c8b518d5d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-rows.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.listRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>", // optional + total = false, // optional + ttl = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-tables.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-tables.md new file mode 100644 index 000000000..a60bbfe93 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-tables.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listTables( + databaseId = "<DATABASE_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-transactions.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-transactions.md new file mode 100644 index 000000000..52ebbefbb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list-transactions.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listTransactions( + queries = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/list.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list.md new file mode 100644 index 000000000..a5b2d1037 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.list( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-big-int-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..8a654a4e1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-big-int-column.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateBigIntColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = 0, + min = 0, // optional + max = 1000000, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-boolean-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..5c22769d0 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-boolean-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateBooleanColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = false, + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-datetime-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..683e31187 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-datetime-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateDatetimeColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "2020-10-15T06:38:00.000+00:00", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-email-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-email-column.md new file mode 100644 index 000000000..787597557 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-email-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateEmailColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "email@example.com", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-enum-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-enum-column.md new file mode 100644 index 000000000..091bdc3c4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-enum-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateEnumColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + elements = listOf("active", "inactive"), + required = false, + default = "active", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-float-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-float-column.md new file mode 100644 index 000000000..4d156e060 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-float-column.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateFloatColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = 10.5, + min = 0, // optional + max = 100, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-integer-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-integer-column.md new file mode 100644 index 000000000..ed2e6da7c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-integer-column.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateIntegerColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = 10, + min = 0, // optional + max = 100, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-ip-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-ip-column.md new file mode 100644 index 000000000..c655997ad --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-ip-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateIpColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "192.0.2.0", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-line-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-line-column.md new file mode 100644 index 000000000..2838853c8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-line-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateLineColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6)), // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-longtext-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..25ac20c29 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-longtext-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateLongtextColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..71b6e0a5d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-mediumtext-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateMediumtextColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-point-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-point-column.md new file mode 100644 index 000000000..29b9daa3f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-point-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updatePointColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = listOf(1, 2), // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-polygon-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..8f3d3973b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-polygon-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updatePolygonColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = listOf(listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6), listOf(1, 2))), // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-relationship-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..d8bbf94ca --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-relationship-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.enums.RelationMutate + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRelationshipColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + onDelete = RelationMutate.CASCADE, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-row.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-row.md new file mode 100644 index 000000000..1ef355353 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-row.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 33, + "isAdmin" to false + ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-rows.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-rows.md new file mode 100644 index 000000000..89eba7dfa --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-rows.md @@ -0,0 +1,26 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 33, + "isAdmin" to false + ), // optional + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-string-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-string-column.md new file mode 100644 index 000000000..ca1b5b8e2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-string-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateStringColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + size = 1, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-table.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-table.md new file mode 100644 index 000000000..db1db5b00 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-table.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateTable( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + name = "<NAME>", // optional + permissions = listOf(Permission.read(Role.any())), // optional + rowSecurity = false, // optional + enabled = false, // optional + purge = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-text-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-text-column.md new file mode 100644 index 000000000..363625ea9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-text-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateTextColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-transaction.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-transaction.md new file mode 100644 index 000000000..1e452f4b3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-transaction.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateTransaction( + transactionId = "<TRANSACTION_ID>", + commit = false, // optional + rollback = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-url-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-url-column.md new file mode 100644 index 000000000..3e6db48f8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-url-column.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateUrlColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "https://example.com", + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-varchar-column.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..1fb7fe290 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update-varchar-column.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateVarcharColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "<KEY>", + required = false, + default = "Hello World", + size = 1, // optional + newKey = "<NEW_KEY>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/update.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update.md new file mode 100644 index 000000000..becb2b9f6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/update.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.update( + databaseId = "<DATABASE_ID>", + name = "<NAME>", // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/upsert-row.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/upsert-row.md new file mode 100644 index 000000000..7ae1397e4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/upsert-row.md @@ -0,0 +1,29 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.upsertRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 33, + "isAdmin" to false + ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tablesdb/upsert-rows.md b/examples/2.0.x/server-kotlin/kotlin/tablesdb/upsert-rows.md new file mode 100644 index 000000000..5ee9beb6c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tablesdb/upsert-rows.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.upsertRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rows = listOf(), + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/create-membership.md b/examples/2.0.x/server-kotlin/kotlin/teams/create-membership.md new file mode 100644 index 000000000..8a27e6ea2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/create-membership.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.createMembership( + teamId = "<TEAM_ID>", + roles = listOf(), + email = "email@example.com", // optional + userId = "<USER_ID>", // optional + phone = "+12065550100", // optional + url = "https://example.com", // optional + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/create.md b/examples/2.0.x/server-kotlin/kotlin/teams/create.md new file mode 100644 index 000000000..f14fb19d4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/create.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.create( + teamId = "<TEAM_ID>", + name = "<NAME>", + roles = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/delete-membership.md b/examples/2.0.x/server-kotlin/kotlin/teams/delete-membership.md new file mode 100644 index 000000000..1291b5ddc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/delete-membership.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.deleteMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/delete.md b/examples/2.0.x/server-kotlin/kotlin/teams/delete.md new file mode 100644 index 000000000..d6b5389db --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.delete( + teamId = "<TEAM_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/get-membership.md b/examples/2.0.x/server-kotlin/kotlin/teams/get-membership.md new file mode 100644 index 000000000..e35179ee9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/get-membership.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.getMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/get-prefs.md b/examples/2.0.x/server-kotlin/kotlin/teams/get-prefs.md new file mode 100644 index 000000000..615a59d07 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/get-prefs.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.getPrefs( + teamId = "<TEAM_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/get.md b/examples/2.0.x/server-kotlin/kotlin/teams/get.md new file mode 100644 index 000000000..d5dc888ae --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.get( + teamId = "<TEAM_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/list-memberships.md b/examples/2.0.x/server-kotlin/kotlin/teams/list-memberships.md new file mode 100644 index 000000000..762336d10 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/list-memberships.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.listMemberships( + teamId = "<TEAM_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/list.md b/examples/2.0.x/server-kotlin/kotlin/teams/list.md new file mode 100644 index 000000000..bcb4c83a1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.list( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/update-membership-status.md b/examples/2.0.x/server-kotlin/kotlin/teams/update-membership-status.md new file mode 100644 index 000000000..082004b8a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/update-membership-status.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.updateMembershipStatus( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>", + userId = "<USER_ID>", + secret = "<SECRET>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/update-membership.md b/examples/2.0.x/server-kotlin/kotlin/teams/update-membership.md new file mode 100644 index 000000000..51e01d69c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/update-membership.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.updateMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>", + roles = listOf() +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/update-name.md b/examples/2.0.x/server-kotlin/kotlin/teams/update-name.md new file mode 100644 index 000000000..229bea6c8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/update-name.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.updateName( + teamId = "<TEAM_ID>", + name = "<NAME>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/teams/update-prefs.md b/examples/2.0.x/server-kotlin/kotlin/teams/update-prefs.md new file mode 100644 index 000000000..d9e68fa2c --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/teams/update-prefs.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.updatePrefs( + teamId = "<TEAM_ID>", + prefs = mapOf( "a" to "b" ) +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tokens/create-file-token.md b/examples/2.0.x/server-kotlin/kotlin/tokens/create-file-token.md new file mode 100644 index 000000000..7d831ce0f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tokens/create-file-token.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.createFileToken( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + expire = "2020-10-15T06:38:00.000+00:00" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tokens/delete.md b/examples/2.0.x/server-kotlin/kotlin/tokens/delete.md new file mode 100644 index 000000000..25e4b19fa --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tokens/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.delete( + tokenId = "<TOKEN_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tokens/get.md b/examples/2.0.x/server-kotlin/kotlin/tokens/get.md new file mode 100644 index 000000000..803030987 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tokens/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.get( + tokenId = "<TOKEN_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tokens/list.md b/examples/2.0.x/server-kotlin/kotlin/tokens/list.md new file mode 100644 index 000000000..39ffb7618 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tokens/list.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.list( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/tokens/update.md b/examples/2.0.x/server-kotlin/kotlin/tokens/update.md new file mode 100644 index 000000000..4e7de71fc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/tokens/update.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.update( + tokenId = "<TOKEN_ID>", + expire = "2020-10-15T06:38:00.000+00:00" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-argon-2-user.md b/examples/2.0.x/server-kotlin/kotlin/users/create-argon-2-user.md new file mode 100644 index 000000000..ba0c2d0cb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-argon-2-user.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createArgon2User( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-bcrypt-user.md b/examples/2.0.x/server-kotlin/kotlin/users/create-bcrypt-user.md new file mode 100644 index 000000000..3a563f726 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-bcrypt-user.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createBcryptUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-jwt.md b/examples/2.0.x/server-kotlin/kotlin/users/create-jwt.md new file mode 100644 index 000000000..e4703d849 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-jwt.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createJWT( + userId = "<USER_ID>", + sessionId = "recent()", // optional + duration = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-md-5-user.md b/examples/2.0.x/server-kotlin/kotlin/users/create-md-5-user.md new file mode 100644 index 000000000..04e30b452 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-md-5-user.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createMD5User( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/kotlin/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..385bb2ca2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createMFARecoveryCodes( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-ph-pass-user.md b/examples/2.0.x/server-kotlin/kotlin/users/create-ph-pass-user.md new file mode 100644 index 000000000..a62814dbc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-ph-pass-user.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createPHPassUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md b/examples/2.0.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..0b5fb50d2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createScryptModifiedUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + passwordSalt = "<PASSWORD_SALT>", + passwordSaltSeparator = "<PASSWORD_SALT_SEPARATOR>", + passwordSignerKey = "<PASSWORD_SIGNER_KEY>", + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-scrypt-user.md b/examples/2.0.x/server-kotlin/kotlin/users/create-scrypt-user.md new file mode 100644 index 000000000..11846dda1 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-scrypt-user.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createScryptUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + passwordSalt = "<PASSWORD_SALT>", + passwordCpu = 8, + passwordMemory = 65536, + passwordParallel = 1, + passwordLength = 64, + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-session.md b/examples/2.0.x/server-kotlin/kotlin/users/create-session.md new file mode 100644 index 000000000..9379a0102 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-session.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createSession( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-sha-user.md b/examples/2.0.x/server-kotlin/kotlin/users/create-sha-user.md new file mode 100644 index 000000000..91566c8c2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-sha-user.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users +import io.appwrite.enums.PasswordHash + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createSHAUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + passwordVersion = PasswordHash.SHA1, // optional + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-target.md b/examples/2.0.x/server-kotlin/kotlin/users/create-target.md new file mode 100644 index 000000000..774120d55 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-target.md @@ -0,0 +1,22 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users +import io.appwrite.enums.MessagingProviderType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createTarget( + userId = "<USER_ID>", + targetId = "<TARGET_ID>", + providerType = MessagingProviderType.EMAIL, + identifier = "<IDENTIFIER>", + providerId = "<PROVIDER_ID>", // optional + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create-token.md b/examples/2.0.x/server-kotlin/kotlin/users/create-token.md new file mode 100644 index 000000000..fedd9392f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create-token.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createToken( + userId = "<USER_ID>", + length = 4, // optional + expire = 60 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/create.md b/examples/2.0.x/server-kotlin/kotlin/users/create.md new file mode 100644 index 000000000..f084a8c34 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/create.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.create( + userId = "<USER_ID>", + email = "email@example.com", // optional + phone = "+12065550100", // optional + password = "password", // optional + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/delete-identity.md b/examples/2.0.x/server-kotlin/kotlin/users/delete-identity.md new file mode 100644 index 000000000..1953d4efb --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/delete-identity.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteIdentity( + identityId = "<IDENTITY_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/delete-mfa-authenticator.md b/examples/2.0.x/server-kotlin/kotlin/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..a8add4152 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/delete-mfa-authenticator.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users +import io.appwrite.enums.AuthenticatorType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteMFAAuthenticator( + userId = "<USER_ID>", + type = AuthenticatorType.TOTP +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/delete-session.md b/examples/2.0.x/server-kotlin/kotlin/users/delete-session.md new file mode 100644 index 000000000..4d17c24ac --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/delete-session.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteSession( + userId = "<USER_ID>", + sessionId = "<SESSION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/delete-sessions.md b/examples/2.0.x/server-kotlin/kotlin/users/delete-sessions.md new file mode 100644 index 000000000..843285f7f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/delete-sessions.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteSessions( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/delete-target.md b/examples/2.0.x/server-kotlin/kotlin/users/delete-target.md new file mode 100644 index 000000000..650678a9a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/delete-target.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteTarget( + userId = "<USER_ID>", + targetId = "<TARGET_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/delete.md b/examples/2.0.x/server-kotlin/kotlin/users/delete.md new file mode 100644 index 000000000..088727d03 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.delete( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/get-mfa-challenge.md b/examples/2.0.x/server-kotlin/kotlin/users/get-mfa-challenge.md new file mode 100644 index 000000000..ecae4b450 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/get-mfa-challenge.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.getMFAChallenge( + userId = "<USER_ID>", + challengeId = "<CHALLENGE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/kotlin/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..1215a91b8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/get-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.getMFARecoveryCodes( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/get-prefs.md b/examples/2.0.x/server-kotlin/kotlin/users/get-prefs.md new file mode 100644 index 000000000..896c87084 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/get-prefs.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.getPrefs( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/get-target.md b/examples/2.0.x/server-kotlin/kotlin/users/get-target.md new file mode 100644 index 000000000..94e19177d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/get-target.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.getTarget( + userId = "<USER_ID>", + targetId = "<TARGET_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/get.md b/examples/2.0.x/server-kotlin/kotlin/users/get.md new file mode 100644 index 000000000..9d24b9834 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.get( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/list-identities.md b/examples/2.0.x/server-kotlin/kotlin/users/list-identities.md new file mode 100644 index 000000000..e745da3d2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/list-identities.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listIdentities( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/list-memberships.md b/examples/2.0.x/server-kotlin/kotlin/users/list-memberships.md new file mode 100644 index 000000000..3d001fde4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/list-memberships.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listMemberships( + userId = "<USER_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/list-mfa-factors.md b/examples/2.0.x/server-kotlin/kotlin/users/list-mfa-factors.md new file mode 100644 index 000000000..ee17cc096 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/list-mfa-factors.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listMFAFactors( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/list-sessions.md b/examples/2.0.x/server-kotlin/kotlin/users/list-sessions.md new file mode 100644 index 000000000..05d002479 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/list-sessions.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listSessions( + userId = "<USER_ID>", + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/list-targets.md b/examples/2.0.x/server-kotlin/kotlin/users/list-targets.md new file mode 100644 index 000000000..bb026ed8f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/list-targets.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listTargets( + userId = "<USER_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/list.md b/examples/2.0.x/server-kotlin/kotlin/users/list.md new file mode 100644 index 000000000..4cc3195f2 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.list( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-email-verification.md b/examples/2.0.x/server-kotlin/kotlin/users/update-email-verification.md new file mode 100644 index 000000000..f30e40159 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-email-verification.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateEmailVerification( + userId = "<USER_ID>", + emailVerification = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-email.md b/examples/2.0.x/server-kotlin/kotlin/users/update-email.md new file mode 100644 index 000000000..7642a957d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-email.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateEmail( + userId = "<USER_ID>", + email = "email@example.com" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-impersonator.md b/examples/2.0.x/server-kotlin/kotlin/users/update-impersonator.md new file mode 100644 index 000000000..58a8e6ef4 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-impersonator.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateImpersonator( + userId = "<USER_ID>", + impersonator = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-labels.md b/examples/2.0.x/server-kotlin/kotlin/users/update-labels.md new file mode 100644 index 000000000..3d88c7aff --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-labels.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateLabels( + userId = "<USER_ID>", + labels = listOf() +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-kotlin/kotlin/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..642f1525a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateMFARecoveryCodes( + userId = "<USER_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-mfa.md b/examples/2.0.x/server-kotlin/kotlin/users/update-mfa.md new file mode 100644 index 000000000..1cde68adc --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-mfa.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateMFA( + userId = "<USER_ID>", + mfa = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-name.md b/examples/2.0.x/server-kotlin/kotlin/users/update-name.md new file mode 100644 index 000000000..beb53d55d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-name.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateName( + userId = "<USER_ID>", + name = "<NAME>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-password.md b/examples/2.0.x/server-kotlin/kotlin/users/update-password.md new file mode 100644 index 000000000..b0ed76a93 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-password.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updatePassword( + userId = "<USER_ID>", + password = "password" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-phone-verification.md b/examples/2.0.x/server-kotlin/kotlin/users/update-phone-verification.md new file mode 100644 index 000000000..f574b2623 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-phone-verification.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updatePhoneVerification( + userId = "<USER_ID>", + phoneVerification = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-phone.md b/examples/2.0.x/server-kotlin/kotlin/users/update-phone.md new file mode 100644 index 000000000..855a459da --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-phone.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updatePhone( + userId = "<USER_ID>", + number = "+12065550100" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-prefs.md b/examples/2.0.x/server-kotlin/kotlin/users/update-prefs.md new file mode 100644 index 000000000..8d610eb6e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-prefs.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updatePrefs( + userId = "<USER_ID>", + prefs = mapOf( "a" to "b" ) +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-status.md b/examples/2.0.x/server-kotlin/kotlin/users/update-status.md new file mode 100644 index 000000000..600bd6faf --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-status.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateStatus( + userId = "<USER_ID>", + status = false +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/users/update-target.md b/examples/2.0.x/server-kotlin/kotlin/users/update-target.md new file mode 100644 index 000000000..55f0f9732 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/users/update-target.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateTarget( + userId = "<USER_ID>", + targetId = "<TARGET_ID>", + identifier = "<IDENTIFIER>", // optional + providerId = "<PROVIDER_ID>", // optional + name = "<NAME>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-collection.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-collection.md new file mode 100644 index 000000000..0cd1e4a51 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-collection.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + name = "<NAME>", + dimension = 1, + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-document.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-document.md new file mode 100644 index 000000000..b931336e8 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-document.md @@ -0,0 +1,28 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( + "embeddings" to listOf(0.12, -0.55, 0.88, 1.02), + "metadata" to mapOf( + "key" to "value" + ) + ), + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-documents.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-documents.md new file mode 100644 index 000000000..3a79fd2db --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documents = listOf(), + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-index.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-index.md new file mode 100644 index 000000000..76e691162 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-index.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.enums.VectorsDBIndexType +import io.appwrite.enums.OrderBy + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>", + type = VectorsDBIndexType.HNSW_EUCLIDEAN, + attributes = listOf(), + orders = listOf(OrderBy.ASC), // optional + lengths = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-operations.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-operations.md new file mode 100644 index 000000000..f6bc63626 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createOperations( + transactionId = "<TRANSACTION_ID>", + operations = listOf(mapOf( + "action" to "create", + "databaseId" to "<DATABASE_ID>", + "collectionId" to "<COLLECTION_ID>", + "documentId" to "<DOCUMENT_ID>", + "data" to mapOf( + "name" to "Walter O'Brien" + ) + )) // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-query.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-query.md new file mode 100644 index 000000000..c8ab0951e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-query.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createQuery( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>", // optional + total = false, // optional + ttl = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-transaction.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-transaction.md new file mode 100644 index 000000000..b2430a18e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.createTransaction( + ttl = 60 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create.md new file mode 100644 index 000000000..cff2ab108 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/create.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.create( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-collection.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-collection.md new file mode 100644 index 000000000..4e929caca --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-document.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-document.md new file mode 100644 index 000000000..2fff745da --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-document.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-documents.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-documents.md new file mode 100644 index 000000000..53ecd505d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-index.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-index.md new file mode 100644 index 000000000..229ee96d3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-transaction.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..f04bef21e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.deleteTransaction( + transactionId = "<TRANSACTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete.md new file mode 100644 index 000000000..d4d480e5e --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.delete( + databaseId = "<DATABASE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-collection.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-collection.md new file mode 100644 index 000000000..68599a754 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-collection.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.getCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-document.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-document.md new file mode 100644 index 000000000..9a2fb13f3 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-document.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.getDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-index.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-index.md new file mode 100644 index 000000000..6a0e1854f --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-index.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.getIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "<KEY>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-transaction.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-transaction.md new file mode 100644 index 000000000..9fee4491d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get-transaction.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.getTransaction( + transactionId = "<TRANSACTION_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get.md new file mode 100644 index 000000000..fc9d6bd9b --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.get( + databaseId = "<DATABASE_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-collections.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-collections.md new file mode 100644 index 000000000..12250df74 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-collections.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.listCollections( + databaseId = "<DATABASE_ID>", + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-documents.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-documents.md new file mode 100644 index 000000000..ec74ab640 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-documents.md @@ -0,0 +1,21 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.listDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>", // optional + total = false, // optional + ttl = 0 // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-indexes.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-indexes.md new file mode 100644 index 000000000..28f0fc003 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-indexes.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.listIndexes( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-transactions.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-transactions.md new file mode 100644 index 000000000..3801d18e7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list-transactions.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.listTransactions( + queries = listOf() // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list.md new file mode 100644 index 000000000..4051f0f98 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/list.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.list( + queries = listOf(), // optional + search = "<SEARCH>", // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-collection.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-collection.md new file mode 100644 index 000000000..331c85c27 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-collection.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.updateCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + name = "<NAME>", + dimension = 1, // optional + permissions = listOf(Permission.read(Role.any())), // optional + documentSecurity = false, // optional + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-document.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-document.md new file mode 100644 index 000000000..572575732 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-document.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.updateDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-documents.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-documents.md new file mode 100644 index 000000000..32aac30e7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-documents.md @@ -0,0 +1,20 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.updateDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + data = mapOf( "a" to "b" ), // optional + queries = listOf(), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-transaction.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-transaction.md new file mode 100644 index 000000000..5f34609f5 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update-transaction.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.updateTransaction( + transactionId = "<TRANSACTION_ID>", + commit = false, // optional + rollback = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update.md new file mode 100644 index 000000000..1a42f4fd6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/update.md @@ -0,0 +1,18 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.update( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/upsert-document.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/upsert-document.md new file mode 100644 index 000000000..dd18e1d56 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/upsert-document.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB +import io.appwrite.Permission +import io.appwrite.Role + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.upsertDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), // optional + permissions = listOf(Permission.read(Role.any())), // optional + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/vectorsdb/upsert-documents.md b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..717222282 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/vectorsdb/upsert-documents.md @@ -0,0 +1,19 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.VectorsDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val vectorsDB = VectorsDB(client) + +val response = vectorsDB.upsertDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documents = listOf(), + transactionId = "<TRANSACTION_ID>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/webhooks/create.md b/examples/2.0.x/server-kotlin/kotlin/webhooks/create.md new file mode 100644 index 000000000..5de5b5593 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/webhooks/create.md @@ -0,0 +1,24 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.create( + webhookId = "<WEBHOOK_ID>", + url = "https://example.com/webhook", + name = "<NAME>", + events = listOf(), + enabled = false, // optional + tls = false, // optional + authUsername = "<AUTH_USERNAME>", // optional + authPassword = "password", // optional + secret = "<SECRET>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/webhooks/delete.md b/examples/2.0.x/server-kotlin/kotlin/webhooks/delete.md new file mode 100644 index 000000000..6f381c2b6 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/webhooks/delete.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.delete( + webhookId = "<WEBHOOK_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/webhooks/get.md b/examples/2.0.x/server-kotlin/kotlin/webhooks/get.md new file mode 100644 index 000000000..1f82c0b2d --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/webhooks/get.md @@ -0,0 +1,16 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.get( + webhookId = "<WEBHOOK_ID>" +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/webhooks/list.md b/examples/2.0.x/server-kotlin/kotlin/webhooks/list.md new file mode 100644 index 000000000..f3f9f23d7 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/webhooks/list.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.list( + queries = listOf(), // optional + total = false // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/webhooks/update-secret.md b/examples/2.0.x/server-kotlin/kotlin/webhooks/update-secret.md new file mode 100644 index 000000000..08e58452a --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/webhooks/update-secret.md @@ -0,0 +1,17 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.updateSecret( + webhookId = "<WEBHOOK_ID>", + secret = "<SECRET>" // optional +) +``` diff --git a/examples/2.0.x/server-kotlin/kotlin/webhooks/update.md b/examples/2.0.x/server-kotlin/kotlin/webhooks/update.md new file mode 100644 index 000000000..daa1706a9 --- /dev/null +++ b/examples/2.0.x/server-kotlin/kotlin/webhooks/update.md @@ -0,0 +1,23 @@ +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Webhooks + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val webhooks = Webhooks(client) + +val response = webhooks.update( + webhookId = "<WEBHOOK_ID>", + name = "<NAME>", + url = "https://example.com/webhook", + events = listOf(), + enabled = false, // optional + tls = false, // optional + authUsername = "<AUTH_USERNAME>", // optional + authPassword = "password" // optional +) +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-anonymous-session.md b/examples/2.0.x/server-nodejs/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..036df9b94 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-anonymous-session.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createAnonymousSession(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-email-password-session.md b/examples/2.0.x/server-nodejs/examples/account/create-email-password-session.md new file mode 100644 index 000000000..fcc1ff183 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-email-password-session.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-email-token.md b/examples/2.0.x/server-nodejs/examples/account/create-email-token.md new file mode 100644 index 000000000..639d3e184 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-email-token.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createEmailToken({ + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-email-verification.md b/examples/2.0.x/server-nodejs/examples/account/create-email-verification.md new file mode 100644 index 000000000..15111f2f4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-email-verification.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createEmailVerification({ + url: 'https://example.com', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-magic-url-token.md b/examples/2.0.x/server-nodejs/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..e1a850180 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-magic-url-token.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createMagicURLToken({ + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-nodejs/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..7574207e0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-mfa-authenticator.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createMFAAuthenticator({ + type: sdk.AuthenticatorType.Totp, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-nodejs/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..d3550e37c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-mfa-challenge.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createMFAChallenge({ + factor: sdk.AuthenticationFactor.Email, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-nodejs/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..5e8e4021b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-nodejs/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..40e1d1fbb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-o-auth-2-token.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createOAuth2Token({ + provider: sdk.OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-phone-token.md b/examples/2.0.x/server-nodejs/examples/account/create-phone-token.md new file mode 100644 index 000000000..d40e003ad --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-phone-token.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createPhoneToken({ + userId: '<USER_ID>', + phone: '+12065550100', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-phone-verification.md b/examples/2.0.x/server-nodejs/examples/account/create-phone-verification.md new file mode 100644 index 000000000..05708153e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-phone-verification.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createPhoneVerification(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-recovery.md b/examples/2.0.x/server-nodejs/examples/account/create-recovery.md new file mode 100644 index 000000000..9b6d8f3e3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-recovery.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-session.md b/examples/2.0.x/server-nodejs/examples/account/create-session.md new file mode 100644 index 000000000..75a2ee447 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-session.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createSession({ + userId: '<USER_ID>', + secret: '<SECRET>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create-verification.md b/examples/2.0.x/server-nodejs/examples/account/create-verification.md new file mode 100644 index 000000000..abe7084e0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create-verification.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createVerification({ + url: 'https://example.com', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/create.md b/examples/2.0.x/server-nodejs/examples/account/create.md new file mode 100644 index 000000000..2c94473e0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/create.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.create({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/delete-identity.md b/examples/2.0.x/server-nodejs/examples/account/delete-identity.md new file mode 100644 index 000000000..050134cfe --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/delete-identity.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteIdentity({ + identityId: '<IDENTITY_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-nodejs/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..b3e5156f8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteMFAAuthenticator({ + type: sdk.AuthenticatorType.Totp, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/delete-session.md b/examples/2.0.x/server-nodejs/examples/account/delete-session.md new file mode 100644 index 000000000..ed992d472 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/delete-session.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteSession({ + sessionId: '<SESSION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/delete-sessions.md b/examples/2.0.x/server-nodejs/examples/account/delete-sessions.md new file mode 100644 index 000000000..912575cea --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/delete-sessions.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteSessions(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-nodejs/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..cb08fe7cd --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/get-prefs.md b/examples/2.0.x/server-nodejs/examples/account/get-prefs.md new file mode 100644 index 000000000..67edf19fa --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/get-prefs.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getPrefs(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/get-session.md b/examples/2.0.x/server-nodejs/examples/account/get-session.md new file mode 100644 index 000000000..7ccfd7794 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/get-session.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getSession({ + sessionId: '<SESSION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/get.md b/examples/2.0.x/server-nodejs/examples/account/get.md new file mode 100644 index 000000000..e755aa46f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/get.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.get(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/list-identities.md b/examples/2.0.x/server-nodejs/examples/account/list-identities.md new file mode 100644 index 000000000..e538a49ed --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/list-identities.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listIdentities({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/list-mfa-factors.md b/examples/2.0.x/server-nodejs/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..313621904 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/list-mfa-factors.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listMFAFactors(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/list-sessions.md b/examples/2.0.x/server-nodejs/examples/account/list-sessions.md new file mode 100644 index 000000000..0bbd093e9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/list-sessions.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listSessions(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-email-verification.md b/examples/2.0.x/server-nodejs/examples/account/update-email-verification.md new file mode 100644 index 000000000..49f012f09 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-email-verification.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateEmailVerification({ + userId: '<USER_ID>', + secret: '<SECRET>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-email.md b/examples/2.0.x/server-nodejs/examples/account/update-email.md new file mode 100644 index 000000000..ed5188a89 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-email.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateEmail({ + email: 'email@example.com', + password: 'password', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-magic-url-session.md b/examples/2.0.x/server-nodejs/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..790f69fcd --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-magic-url-session.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMagicURLSession({ + userId: '<USER_ID>', + secret: '<SECRET>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-nodejs/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..5f3edbebc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-mfa-authenticator.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMFAAuthenticator({ + type: sdk.AuthenticatorType.Totp, + otp: '<OTP>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-nodejs/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..01defd1c4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-mfa-challenge.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMFAChallenge({ + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-nodejs/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..c893c231f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-mfa.md b/examples/2.0.x/server-nodejs/examples/account/update-mfa.md new file mode 100644 index 000000000..63fa217e8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-mfa.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMFA({ + mfa: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-name.md b/examples/2.0.x/server-nodejs/examples/account/update-name.md new file mode 100644 index 000000000..20bac30ac --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-name.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateName({ + name: '<NAME>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-password.md b/examples/2.0.x/server-nodejs/examples/account/update-password.md new file mode 100644 index 000000000..cef8c6905 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-password.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePassword({ + password: 'password', + oldPassword: 'password', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-phone-session.md b/examples/2.0.x/server-nodejs/examples/account/update-phone-session.md new file mode 100644 index 000000000..5a2035e40 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-phone-session.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePhoneSession({ + userId: '<USER_ID>', + secret: '<SECRET>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-phone-verification.md b/examples/2.0.x/server-nodejs/examples/account/update-phone-verification.md new file mode 100644 index 000000000..796cdfab7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-phone-verification.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePhoneVerification({ + userId: '<USER_ID>', + secret: '<SECRET>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-phone.md b/examples/2.0.x/server-nodejs/examples/account/update-phone.md new file mode 100644 index 000000000..29158e3e6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-phone.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePhone({ + phone: '+12065550100', + password: 'password', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-prefs.md b/examples/2.0.x/server-nodejs/examples/account/update-prefs.md new file mode 100644 index 000000000..a4b167ffc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-prefs.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePrefs({ + prefs: { + language: 'en', + timezone: 'UTC', + darkTheme: true, + }, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-recovery.md b/examples/2.0.x/server-nodejs/examples/account/update-recovery.md new file mode 100644 index 000000000..a33078b8b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-recovery.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateRecovery({ + userId: '<USER_ID>', + secret: '<SECRET>', + password: 'password', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-session.md b/examples/2.0.x/server-nodejs/examples/account/update-session.md new file mode 100644 index 000000000..1e257276b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-session.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateSession({ + sessionId: '<SESSION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-status.md b/examples/2.0.x/server-nodejs/examples/account/update-status.md new file mode 100644 index 000000000..ffb3f25e0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-status.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateStatus(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/account/update-verification.md b/examples/2.0.x/server-nodejs/examples/account/update-verification.md new file mode 100644 index 000000000..6a7336225 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/account/update-verification.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateVerification({ + userId: '<USER_ID>', + secret: '<SECRET>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/advisor/delete-report.md b/examples/2.0.x/server-nodejs/examples/advisor/delete-report.md new file mode 100644 index 000000000..16929bbb0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/advisor/delete-report.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const advisor = new sdk.Advisor(client); + +const result = await advisor.deleteReport({ + reportId: '<REPORT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/advisor/get-insight.md b/examples/2.0.x/server-nodejs/examples/advisor/get-insight.md new file mode 100644 index 000000000..882d5edea --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/advisor/get-insight.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const advisor = new sdk.Advisor(client); + +const result = await advisor.getInsight({ + reportId: '<REPORT_ID>', + insightId: '<INSIGHT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/advisor/get-report.md b/examples/2.0.x/server-nodejs/examples/advisor/get-report.md new file mode 100644 index 000000000..a523bdc25 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/advisor/get-report.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const advisor = new sdk.Advisor(client); + +const result = await advisor.getReport({ + reportId: '<REPORT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/advisor/list-insights.md b/examples/2.0.x/server-nodejs/examples/advisor/list-insights.md new file mode 100644 index 000000000..6b1d5ea99 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/advisor/list-insights.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const advisor = new sdk.Advisor(client); + +const result = await advisor.listInsights({ + reportId: '<REPORT_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/advisor/list-reports.md b/examples/2.0.x/server-nodejs/examples/advisor/list-reports.md new file mode 100644 index 000000000..328570e33 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/advisor/list-reports.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const advisor = new sdk.Advisor(client); + +const result = await advisor.listReports({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-browser.md b/examples/2.0.x/server-nodejs/examples/avatars/get-browser.md new file mode 100644 index 000000000..be84bc599 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-browser.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getBrowser({ + code: sdk.Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-credit-card.md b/examples/2.0.x/server-nodejs/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..86c270676 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-credit-card.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getCreditCard({ + code: sdk.CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-favicon.md b/examples/2.0.x/server-nodejs/examples/avatars/get-favicon.md new file mode 100644 index 000000000..d9ba40928 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-favicon.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getFavicon({ + url: 'https://example.com', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-flag.md b/examples/2.0.x/server-nodejs/examples/avatars/get-flag.md new file mode 100644 index 000000000..bbf954bc4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-flag.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getFlag({ + code: sdk.Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-image.md b/examples/2.0.x/server-nodejs/examples/avatars/get-image.md new file mode 100644 index 000000000..89b6c7331 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-image.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-initials.md b/examples/2.0.x/server-nodejs/examples/avatars/get-initials.md new file mode 100644 index 000000000..ee5650673 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-initials.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getInitials({ + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: 'FFFFFF', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-photo.md b/examples/2.0.x/server-nodejs/examples/avatars/get-photo.md new file mode 100644 index 000000000..8421fbb95 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-photo.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getPhoto({ + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '<EMAIL_HASH>', // optional + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-qr.md b/examples/2.0.x/server-nodejs/examples/avatars/get-qr.md new file mode 100644 index 000000000..791202ed7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-qr.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getQR({ + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/avatars/get-screenshot.md b/examples/2.0.x/server-nodejs/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..708db1ca9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/avatars/get-screenshot.md @@ -0,0 +1,40 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getScreenshot({ + url: 'https://example.com', + headers: { + Authorization: 'Bearer token123', + 'X-Custom-Header': 'value', + }, // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: sdk.BrowserTheme.Dark, // optional + userAgent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + fullpage: true, // optional + locale: 'en-US', // optional + timezone: sdk.Timezone.AfricaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [ + sdk.BrowserPermission.Geolocation, + sdk.BrowserPermission.Notifications, + ], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: sdk.ImageFormat.Jpeg, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..f52034eba --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-big-int-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createBigIntAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 1000000, // optional + xdefault: 0, // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..88aac3515 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-boolean-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createBooleanAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: false, // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-collection.md b/examples/2.0.x/server-nodejs/examples/databases/create-collection.md new file mode 100644 index 000000000..8eda4155d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-collection.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..0a90cbc73 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-datetime-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createDatetimeAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: '2020-10-15T06:38:00.000+00:00', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-document.md b/examples/2.0.x/server-nodejs/examples/databases/create-document.md new file mode 100644 index 000000000..f9147dfad --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-document.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-documents.md b/examples/2.0.x/server-nodejs/examples/databases/create-documents.md new file mode 100644 index 000000000..29f12043a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-email-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..0f2f7ac71 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-email-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createEmailAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'email@example.com', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..fddf585d7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-enum-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createEnumAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + elements: ['active', 'inactive'], + required: false, + xdefault: 'active', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-float-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..ebf6ef51e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-float-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createFloatAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + xdefault: 10.5, // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-index.md b/examples/2.0.x/server-nodejs/examples/databases/create-index.md new file mode 100644 index 000000000..095bd46a8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-index.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: sdk.DatabasesIndexType.Key, + attributes: [], + orders: [sdk.OrderBy.Asc], // optional + lengths: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..b9f565475 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-integer-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createIntegerAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + xdefault: 10, // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..edcee6752 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-ip-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createIpAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: '192.0.2.0', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-line-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..01ae03eef --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-line-attribute.md @@ -0,0 +1,22 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createLineAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [1, 2], + [3, 4], + [5, 6], + ], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..6685fde8d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-longtext-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createLongtextAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..ed950b4e0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createMediumtextAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-operations.md b/examples/2.0.x/server-nodejs/examples/databases/create-operations.md new file mode 100644 index 000000000..42e518985 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-operations.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createOperations({ + transactionId: '<TRANSACTION_ID>', + operations: [ + { + action: 'create', + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-point-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..6825bfeb0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-point-attribute.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createPointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: [1, 2], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..c155e136a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-polygon-attribute.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createPolygonAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [ + [1, 2], + [3, 4], + [5, 6], + [1, 2], + ], + ], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..4d79cf457 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-relationship-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createRelationshipAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + relatedCollectionId: '<RELATED_COLLECTION_ID>', + type: sdk.RelationshipType.OneToOne, + twoWay: false, // optional + key: '<KEY>', // optional + twoWayKey: '<TWO_WAY_KEY>', // optional + onDelete: sdk.RelationMutate.Cascade, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-string-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..187afaf2e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-string-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createStringAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + size: 1, + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-text-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..3dec73cf0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-text-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createTextAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-transaction.md b/examples/2.0.x/server-nodejs/examples/databases/create-transaction.md new file mode 100644 index 000000000..2ef16fcab --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createTransaction({ + ttl: 60, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-url-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..41c5db975 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-url-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createUrlAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'https://example.com', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..ce55e847a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create-varchar-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createVarcharAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + size: 1, + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/create.md b/examples/2.0.x/server-nodejs/examples/databases/create.md new file mode 100644 index 000000000..ce42a134c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/create.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..c48bf9b42 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/decrement-document-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.decrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // optional + min: 0, // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/delete-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/delete-attribute.md new file mode 100644 index 000000000..89ffcd84c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/delete-attribute.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/delete-collection.md b/examples/2.0.x/server-nodejs/examples/databases/delete-collection.md new file mode 100644 index 000000000..473e92ddd --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/delete-collection.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/delete-document.md b/examples/2.0.x/server-nodejs/examples/databases/delete-document.md new file mode 100644 index 000000000..9ecdbbe92 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/delete-document.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/delete-documents.md b/examples/2.0.x/server-nodejs/examples/databases/delete-documents.md new file mode 100644 index 000000000..682c0e7bc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/delete-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/delete-index.md b/examples/2.0.x/server-nodejs/examples/databases/delete-index.md new file mode 100644 index 000000000..861a842d5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/delete-index.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/delete-transaction.md b/examples/2.0.x/server-nodejs/examples/databases/delete-transaction.md new file mode 100644 index 000000000..8868eb922 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/delete-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteTransaction({ + transactionId: '<TRANSACTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/delete.md b/examples/2.0.x/server-nodejs/examples/databases/delete.md new file mode 100644 index 000000000..101b2246c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.delete({ + databaseId: '<DATABASE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/get-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/get-attribute.md new file mode 100644 index 000000000..4cdaa8ae4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/get-attribute.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.getAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/get-collection.md b/examples/2.0.x/server-nodejs/examples/databases/get-collection.md new file mode 100644 index 000000000..ccfc0f093 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/get-collection.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.getCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/get-document.md b/examples/2.0.x/server-nodejs/examples/databases/get-document.md new file mode 100644 index 000000000..282552474 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/get-document.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/get-index.md b/examples/2.0.x/server-nodejs/examples/databases/get-index.md new file mode 100644 index 000000000..71872676f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/get-index.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.getIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/get-transaction.md b/examples/2.0.x/server-nodejs/examples/databases/get-transaction.md new file mode 100644 index 000000000..0f4bbd45b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/get-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.getTransaction({ + transactionId: '<TRANSACTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/get.md b/examples/2.0.x/server-nodejs/examples/databases/get.md new file mode 100644 index 000000000..6b5834e89 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.get({ + databaseId: '<DATABASE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..3f5d7e70d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/increment-document-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.incrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // optional + max: 100, // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/list-attributes.md b/examples/2.0.x/server-nodejs/examples/databases/list-attributes.md new file mode 100644 index 000000000..5d9af70ed --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/list-attributes.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.listAttributes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/list-collections.md b/examples/2.0.x/server-nodejs/examples/databases/list-collections.md new file mode 100644 index 000000000..595851023 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/list-collections.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.listCollections({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/list-documents.md b/examples/2.0.x/server-nodejs/examples/databases/list-documents.md new file mode 100644 index 000000000..e395ef127 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/list-documents.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/list-indexes.md b/examples/2.0.x/server-nodejs/examples/databases/list-indexes.md new file mode 100644 index 000000000..0100d77f2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/list-indexes.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.listIndexes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/list-transactions.md b/examples/2.0.x/server-nodejs/examples/databases/list-transactions.md new file mode 100644 index 000000000..c33568281 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/list-transactions.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.listTransactions({ + queries: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/list.md b/examples/2.0.x/server-nodejs/examples/databases/list.md new file mode 100644 index 000000000..b2a38dfa3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..7603578d0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-big-int-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateBigIntAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 0, + min: 0, // optional + max: 1000000, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..5184217c9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-boolean-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateBooleanAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: false, + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-collection.md b/examples/2.0.x/server-nodejs/examples/databases/update-collection.md new file mode 100644 index 000000000..d33ce0b69 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-collection.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..f3bb80ead --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-datetime-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateDatetimeAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: '2020-10-15T06:38:00.000+00:00', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-document.md b/examples/2.0.x/server-nodejs/examples/databases/update-document.md new file mode 100644 index 000000000..703725527 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-document.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-documents.md b/examples/2.0.x/server-nodejs/examples/databases/update-documents.md new file mode 100644 index 000000000..b32cc8870 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-documents.md @@ -0,0 +1,24 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-email-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..69658e203 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-email-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateEmailAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'email@example.com', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..2463223fc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-enum-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateEnumAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + elements: ['active', 'inactive'], + required: false, + xdefault: 'active', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-float-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..63af3be95 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-float-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateFloatAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 10.5, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..14a16a938 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-integer-attribute.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateIntegerAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 10, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..1ece66585 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-ip-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateIpAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: '192.0.2.0', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-line-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..bd3668998 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-line-attribute.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateLineAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [1, 2], + [3, 4], + [5, 6], + ], // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..97d3c28d9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-longtext-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateLongtextAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..5398f7104 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateMediumtextAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-point-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..1c64a2c82 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-point-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updatePointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: [1, 2], // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..9cff57789 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-polygon-attribute.md @@ -0,0 +1,26 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updatePolygonAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [ + [1, 2], + [3, 4], + [5, 6], + [1, 2], + ], + ], // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..50710f8ec --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-relationship-attribute.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateRelationshipAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + onDelete: sdk.RelationMutate.Cascade, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-string-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..75f269c46 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-string-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateStringAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-text-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..0075135e9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-text-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateTextAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-transaction.md b/examples/2.0.x/server-nodejs/examples/databases/update-transaction.md new file mode 100644 index 000000000..6d31e2e56 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-transaction.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateTransaction({ + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-url-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..96c695341 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-url-attribute.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateUrlAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'https://example.com', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-nodejs/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..1a2ad8c14 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update-varchar-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateVarcharAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/update.md b/examples/2.0.x/server-nodejs/examples/databases/update.md new file mode 100644 index 000000000..6ae2bc11e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/update.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/upsert-document.md b/examples/2.0.x/server-nodejs/examples/databases/upsert-document.md new file mode 100644 index 000000000..580baf23c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/upsert-document.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/databases/upsert-documents.md b/examples/2.0.x/server-nodejs/examples/databases/upsert-documents.md new file mode 100644 index 000000000..aa2535473 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/databases/upsert-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.upsertDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/create-collection.md b/examples/2.0.x/server-nodejs/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..5915ae971 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/create-collection.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.createCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/create-document.md b/examples/2.0.x/server-nodejs/examples/documentsdb/create-document.md new file mode 100644 index 000000000..96733e346 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/create-document.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/create-documents.md b/examples/2.0.x/server-nodejs/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..298af8c6a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/create-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.createDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/create-index.md b/examples/2.0.x/server-nodejs/examples/documentsdb/create-index.md new file mode 100644 index 000000000..72e4669c1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/create-index.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.createIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: sdk.DocumentsDBIndexType.Key, + attributes: [], + orders: [sdk.OrderBy.Asc], // optional + lengths: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/create-operations.md b/examples/2.0.x/server-nodejs/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..c874aa338 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/create-operations.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.createOperations({ + transactionId: '<TRANSACTION_ID>', + operations: [ + { + action: 'create', + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-nodejs/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..241425f28 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/create-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.createTransaction({ + ttl: 60, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/create.md b/examples/2.0.x/server-nodejs/examples/documentsdb/create.md new file mode 100644 index 000000000..29f469d6e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/create.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-nodejs/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..27f8bdf2e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.decrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // optional + min: 0, // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..5ff38ef7b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-collection.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.deleteCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/delete-document.md b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..9fac5c0d5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-document.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..9bb214ee7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.deleteDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/delete-index.md b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..f4c043541 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-index.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.deleteIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..f8144ced1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/delete-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.deleteTransaction({ + transactionId: '<TRANSACTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/delete.md b/examples/2.0.x/server-nodejs/examples/documentsdb/delete.md new file mode 100644 index 000000000..46b532dec --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.delete({ + databaseId: '<DATABASE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/get-collection.md b/examples/2.0.x/server-nodejs/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..dc68d3e51 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/get-collection.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.getCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/get-document.md b/examples/2.0.x/server-nodejs/examples/documentsdb/get-document.md new file mode 100644 index 000000000..9755fda2d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/get-document.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/get-index.md b/examples/2.0.x/server-nodejs/examples/documentsdb/get-index.md new file mode 100644 index 000000000..9faf529d4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/get-index.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.getIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-nodejs/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..132bef360 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/get-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.getTransaction({ + transactionId: '<TRANSACTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/get.md b/examples/2.0.x/server-nodejs/examples/documentsdb/get.md new file mode 100644 index 000000000..092bad498 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.get({ + databaseId: '<DATABASE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-nodejs/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..11015d8ec --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.incrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // optional + max: 100, // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/list-collections.md b/examples/2.0.x/server-nodejs/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..8d4bb1d29 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/list-collections.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.listCollections({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/list-documents.md b/examples/2.0.x/server-nodejs/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..dde50aa3f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/list-documents.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-nodejs/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..32b0acaa4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/list-indexes.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.listIndexes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-nodejs/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..8bc66d4b6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/list-transactions.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.listTransactions({ + queries: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/list.md b/examples/2.0.x/server-nodejs/examples/documentsdb/list.md new file mode 100644 index 000000000..529875f66 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/update-collection.md b/examples/2.0.x/server-nodejs/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..beb1cd3d3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/update-collection.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.updateCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/update-document.md b/examples/2.0.x/server-nodejs/examples/documentsdb/update-document.md new file mode 100644 index 000000000..7e9538bca --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/update-document.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/update-documents.md b/examples/2.0.x/server-nodejs/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..bb5a46e65 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/update-documents.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.updateDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-nodejs/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..5a1491733 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/update-transaction.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.updateTransaction({ + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/update.md b/examples/2.0.x/server-nodejs/examples/documentsdb/update.md new file mode 100644 index 000000000..c0397755d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/update.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-nodejs/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..e9ffed17d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/upsert-document.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-nodejs/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..23b522008 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/documentsdb/upsert-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const documentsDB = new sdk.DocumentsDB(client); + +const result = await documentsDB.upsertDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-nodejs/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..537a44021 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const embeddings = new sdk.Embeddings(client); + +const result = await embeddings.createTextEmbeddings({ + texts: [], + model: sdk.EmbeddingModel.NomicEmbedText, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/create-deployment.md b/examples/2.0.x/server-nodejs/examples/functions/create-deployment.md new file mode 100644 index 000000000..0a4baff1f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/create-deployment.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); +const fs = require('fs'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createDeployment({ + functionId: '<FUNCTION_ID>', + code: InputFile.fromPath('/path/to/file', 'filename'), + activate: false, + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-nodejs/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..179bb3792 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createDuplicateDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + buildId: '<BUILD_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/create-execution.md b/examples/2.0.x/server-nodejs/examples/functions/create-execution.md new file mode 100644 index 000000000..f5c5bc429 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/create-execution.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new sdk.Functions(client); + +const result = await functions.createExecution({ + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + async: false, // optional + xpath: '<PATH>', // optional + method: sdk.ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '<SCHEDULED_AT>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/create-template-deployment.md b/examples/2.0.x/server-nodejs/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..a3e819f31 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/create-template-deployment.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createTemplateDeployment({ + functionId: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + type: sdk.TemplateReferenceType.Commit, + reference: '<REFERENCE>', + activate: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/create-variable.md b/examples/2.0.x/server-nodejs/examples/functions/create-variable.md new file mode 100644 index 000000000..e6ffd3d08 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/create-variable.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-nodejs/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..36672fa48 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/create-vcs-deployment.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createVcsDeployment({ + functionId: '<FUNCTION_ID>', + type: sdk.VCSReferenceType.Branch, + reference: '<REFERENCE>', + activate: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/create.md b/examples/2.0.x/server-nodejs/examples/functions/create.md new file mode 100644 index 000000000..7d6e855bf --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/create.md @@ -0,0 +1,35 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.create({ + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: sdk.Runtime.Node145, + execute: ['any'], // optional + events: [], // optional + schedule: '0 0 * * *', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [sdk.ProjectKeyScopes.ProjectRead], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/delete-deployment.md b/examples/2.0.x/server-nodejs/examples/functions/delete-deployment.md new file mode 100644 index 000000000..101508c9a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/delete-deployment.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.deleteDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/delete-execution.md b/examples/2.0.x/server-nodejs/examples/functions/delete-execution.md new file mode 100644 index 000000000..bbbc60626 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/delete-execution.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.deleteExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/delete-variable.md b/examples/2.0.x/server-nodejs/examples/functions/delete-variable.md new file mode 100644 index 000000000..1882393af --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/delete-variable.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.deleteVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/delete.md b/examples/2.0.x/server-nodejs/examples/functions/delete.md new file mode 100644 index 000000000..b2259a16b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.delete({ + functionId: '<FUNCTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/get-deployment-download.md b/examples/2.0.x/server-nodejs/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..e85081a0f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/get-deployment-download.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.getDeploymentDownload({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: sdk.DeploymentDownloadType.Source, // optional + token: '<TOKEN>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/get-deployment.md b/examples/2.0.x/server-nodejs/examples/functions/get-deployment.md new file mode 100644 index 000000000..c6b1b8822 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/get-deployment.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.getDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/get-execution.md b/examples/2.0.x/server-nodejs/examples/functions/get-execution.md new file mode 100644 index 000000000..dae7043aa --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/get-execution.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new sdk.Functions(client); + +const result = await functions.getExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/get-variable.md b/examples/2.0.x/server-nodejs/examples/functions/get-variable.md new file mode 100644 index 000000000..8f9f37e01 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/get-variable.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.getVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/get.md b/examples/2.0.x/server-nodejs/examples/functions/get.md new file mode 100644 index 000000000..5eb892c44 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.get({ + functionId: '<FUNCTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/list-deployments.md b/examples/2.0.x/server-nodejs/examples/functions/list-deployments.md new file mode 100644 index 000000000..966e5638e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/list-deployments.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.listDeployments({ + functionId: '<FUNCTION_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/list-executions.md b/examples/2.0.x/server-nodejs/examples/functions/list-executions.md new file mode 100644 index 000000000..ad4ea3d89 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/list-executions.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new sdk.Functions(client); + +const result = await functions.listExecutions({ + functionId: '<FUNCTION_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/list-runtimes.md b/examples/2.0.x/server-nodejs/examples/functions/list-runtimes.md new file mode 100644 index 000000000..fdaefd3ae --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/list-runtimes.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.listRuntimes(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/list-specifications.md b/examples/2.0.x/server-nodejs/examples/functions/list-specifications.md new file mode 100644 index 000000000..f779206d4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/list-specifications.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.listSpecifications({ + type: 'runtimes', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/list-variables.md b/examples/2.0.x/server-nodejs/examples/functions/list-variables.md new file mode 100644 index 000000000..e0f09516a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/list-variables.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.listVariables({ + functionId: '<FUNCTION_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/list.md b/examples/2.0.x/server-nodejs/examples/functions/list.md new file mode 100644 index 000000000..db5204eb3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/update-deployment-status.md b/examples/2.0.x/server-nodejs/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..acbdea42d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/update-deployment-status.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.updateDeploymentStatus({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/update-function-deployment.md b/examples/2.0.x/server-nodejs/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..fc183f8a3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/update-function-deployment.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.updateFunctionDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/update-variable.md b/examples/2.0.x/server-nodejs/examples/functions/update-variable.md new file mode 100644 index 000000000..61b96621b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/update-variable.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.updateVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', // optional + value: '<VALUE>', // optional + secret: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/functions/update.md b/examples/2.0.x/server-nodejs/examples/functions/update.md new file mode 100644 index 000000000..2f299f28d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/functions/update.md @@ -0,0 +1,35 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.update({ + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: sdk.Runtime.Node145, // optional + execute: ['any'], // optional + events: [], // optional + schedule: '0 0 * * *', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [sdk.ProjectKeyScopes.ProjectRead], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/graphql/mutation.md b/examples/2.0.x/server-nodejs/examples/graphql/mutation.md new file mode 100644 index 000000000..cb60aa527 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/graphql/mutation.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const graphql = new sdk.Graphql(client); + +const result = await graphql.mutation({ + query: {}, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/graphql/query.md b/examples/2.0.x/server-nodejs/examples/graphql/query.md new file mode 100644 index 000000000..86ba69626 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/graphql/query.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const graphql = new sdk.Graphql(client); + +const result = await graphql.query({ + query: {}, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/locale/get.md b/examples/2.0.x/server-nodejs/examples/locale/get.md new file mode 100644 index 000000000..004a93257 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/locale/get.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.get(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/locale/list-codes.md b/examples/2.0.x/server-nodejs/examples/locale/list-codes.md new file mode 100644 index 000000000..136992f40 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/locale/list-codes.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCodes(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/locale/list-continents.md b/examples/2.0.x/server-nodejs/examples/locale/list-continents.md new file mode 100644 index 000000000..aa58ec572 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/locale/list-continents.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listContinents(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/locale/list-countries-eu.md b/examples/2.0.x/server-nodejs/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..538b49271 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/locale/list-countries-eu.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCountriesEU(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/locale/list-countries-phones.md b/examples/2.0.x/server-nodejs/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..c27014185 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/locale/list-countries-phones.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCountriesPhones(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/locale/list-countries.md b/examples/2.0.x/server-nodejs/examples/locale/list-countries.md new file mode 100644 index 000000000..99ee2d350 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/locale/list-countries.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCountries(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/locale/list-currencies.md b/examples/2.0.x/server-nodejs/examples/locale/list-currencies.md new file mode 100644 index 000000000..c381774d2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/locale/list-currencies.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCurrencies(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/locale/list-languages.md b/examples/2.0.x/server-nodejs/examples/locale/list-languages.md new file mode 100644 index 000000000..cfd522c6f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/locale/list-languages.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listLanguages(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..04e45525d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-apns-provider.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-email.md b/examples/2.0.x/server-nodejs/examples/messaging/create-email.md new file mode 100644 index 000000000..c979b47c0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-email.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..d23e5f468 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-fcm-provider.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: {}, // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..70f64eb45 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + domain: 'example.com', // optional + isEuRegion: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..ace599e3a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-push.md b/examples/2.0.x/server-nodejs/examples/messaging/create-push.md new file mode 100644 index 000000000..6e2fd1409 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-push.md @@ -0,0 +1,32 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createPush({ + messageId: '<MESSAGE_ID>', + title: '<TITLE>', // optional + body: '<BODY>', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '<ID1:ID2>', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: sdk.MessagePriority.Normal, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..746cdeb99 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-resend-provider.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createResendProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..18eea0b92 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..2112c2838 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-ses-provider.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSesProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + accessKey: '<ACCESS_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + region: '<REGION>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-sms.md b/examples/2.0.x/server-nodejs/examples/messaging/create-sms.md new file mode 100644 index 000000000..0108af62f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-sms.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSMS({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..65e264ff4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-smtp-provider.md @@ -0,0 +1,27 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 587, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + encryption: sdk.SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-subscriber.md b/examples/2.0.x/server-nodejs/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..cd5027e9d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-subscriber.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..7d2a8e33c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-telesign-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..05b493473 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-topic.md b/examples/2.0.x/server-nodejs/examples/messaging/create-topic.md new file mode 100644 index 000000000..5a05064ee --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-topic.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ['any'], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..4b25a767a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-twilio-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..f5f94a5bd --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/create-vonage-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/delete-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/delete-provider.md new file mode 100644 index 000000000..d1bc60747 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/delete-provider.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.deleteProvider({ + providerId: '<PROVIDER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-nodejs/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..d25b9d792 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/delete-subscriber.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +const messaging = new sdk.Messaging(client); + +const result = await messaging.deleteSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/delete-topic.md b/examples/2.0.x/server-nodejs/examples/messaging/delete-topic.md new file mode 100644 index 000000000..78a0898fc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/delete-topic.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.deleteTopic({ + topicId: '<TOPIC_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/delete.md b/examples/2.0.x/server-nodejs/examples/messaging/delete.md new file mode 100644 index 000000000..feb7e028d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.delete({ + messageId: '<MESSAGE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/get-message.md b/examples/2.0.x/server-nodejs/examples/messaging/get-message.md new file mode 100644 index 000000000..30c5ee154 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/get-message.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.getMessage({ + messageId: '<MESSAGE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/get-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/get-provider.md new file mode 100644 index 000000000..e7f43b890 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/get-provider.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.getProvider({ + providerId: '<PROVIDER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/get-subscriber.md b/examples/2.0.x/server-nodejs/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..7fbb75d0c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/get-subscriber.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.getSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/get-topic.md b/examples/2.0.x/server-nodejs/examples/messaging/get-topic.md new file mode 100644 index 000000000..72c855f3a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/get-topic.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.getTopic({ + topicId: '<TOPIC_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/list-messages.md b/examples/2.0.x/server-nodejs/examples/messaging/list-messages.md new file mode 100644 index 000000000..39ad98fa6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/list-messages.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listMessages({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/list-providers.md b/examples/2.0.x/server-nodejs/examples/messaging/list-providers.md new file mode 100644 index 000000000..968921d12 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/list-providers.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listProviders({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/list-subscribers.md b/examples/2.0.x/server-nodejs/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..241c7493b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/list-subscribers.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listSubscribers({ + topicId: '<TOPIC_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/list-targets.md b/examples/2.0.x/server-nodejs/examples/messaging/list-targets.md new file mode 100644 index 000000000..d318da81c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/list-targets.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listTargets({ + messageId: '<MESSAGE_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/list-topics.md b/examples/2.0.x/server-nodejs/examples/messaging/list-topics.md new file mode 100644 index 000000000..eaef351fb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/list-topics.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listTopics({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..800e88506 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-apns-provider.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-email.md b/examples/2.0.x/server-nodejs/examples/messaging/update-email.md new file mode 100644 index 000000000..aaf9d751c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-email.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateEmail({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: '<SUBJECT>', // optional + content: '<CONTENT>', // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + attachments: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..8612b2a69 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-fcm-provider.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + serviceAccountJSON: {}, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..fddbf5d69 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + apiKey: '<API_KEY>', // optional + domain: 'example.com', // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..debc079b0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-push.md b/examples/2.0.x/server-nodejs/examples/messaging/update-push.md new file mode 100644 index 000000000..cf8f6f1b5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-push.md @@ -0,0 +1,32 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updatePush({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '<ID1:ID2>', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: sdk.MessagePriority.Normal, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..e3c7fc2f4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-resend-provider.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateResendProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..8e5b59b99 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..d3e943a17 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-ses-provider.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateSesProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accessKey: '<ACCESS_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + region: '<REGION>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-sms.md b/examples/2.0.x/server-nodejs/examples/messaging/update-sms.md new file mode 100644 index 000000000..940474a44 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-sms.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateSMS({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + content: '<CONTENT>', // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..94e862bec --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-smtp-provider.md @@ -0,0 +1,27 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + host: '<HOST>', // optional + port: 1, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + encryption: sdk.SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..5d9442f29 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-telesign-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..ef15093d1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-topic.md b/examples/2.0.x/server-nodejs/examples/messaging/update-topic.md new file mode 100644 index 000000000..2397220a5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-topic.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', // optional + subscribe: ['any'], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..eb02eccdb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-twilio-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + from: '<FROM>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-nodejs/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..203e435c8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/messaging/update-vonage-provider.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + from: '<FROM>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/organization/create-project.md b/examples/2.0.x/server-nodejs/examples/organization/create-project.md new file mode 100644 index 000000000..61cbdf0aa --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/organization/create-project.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.createProject({ + projectId: '<PROJECT_ID>', + name: '<NAME>', + region: sdk.Region.Default, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/organization/delete-project.md b/examples/2.0.x/server-nodejs/examples/organization/delete-project.md new file mode 100644 index 000000000..fcc24c806 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/organization/delete-project.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.deleteProject({ + projectId: '<PROJECT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/organization/get-project.md b/examples/2.0.x/server-nodejs/examples/organization/get-project.md new file mode 100644 index 000000000..a44109679 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/organization/get-project.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.getProject({ + projectId: '<PROJECT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/organization/list-projects.md b/examples/2.0.x/server-nodejs/examples/organization/list-projects.md new file mode 100644 index 000000000..e883082df --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/organization/list-projects.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.listProjects({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/organization/update-project.md b/examples/2.0.x/server-nodejs/examples/organization/update-project.md new file mode 100644 index 000000000..5daee821a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/organization/update-project.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.updateProject({ + projectId: '<PROJECT_ID>', + name: '<NAME>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/presences/delete.md b/examples/2.0.x/server-nodejs/examples/presences/delete.md new file mode 100644 index 000000000..866d674b0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/presences/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.delete({ + presenceId: '<PRESENCE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/presences/get.md b/examples/2.0.x/server-nodejs/examples/presences/get.md new file mode 100644 index 000000000..76aee5980 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/presences/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.get({ + presenceId: '<PRESENCE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/presences/list.md b/examples/2.0.x/server-nodejs/examples/presences/list.md new file mode 100644 index 000000000..cd6e51d6e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/presences/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.list({ + queries: [], // optional + total: false, // optional + ttl: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/presences/update.md b/examples/2.0.x/server-nodejs/examples/presences/update.md new file mode 100644 index 000000000..e456487cb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/presences/update.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.update({ + presenceId: '<PRESENCE_ID>', + userId: '<USER_ID>', + status: '<STATUS>', // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + purge: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/presences/upsert.md b/examples/2.0.x/server-nodejs/examples/presences/upsert.md new file mode 100644 index 000000000..646cab86c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/presences/upsert.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const presences = new sdk.Presences(client); + +const result = await presences.upsert({ + presenceId: '<PRESENCE_ID>', + userId: '<USER_ID>', + status: '<STATUS>', + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: {}, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-android-platform.md b/examples/2.0.x/server-nodejs/examples/project/create-android-platform.md new file mode 100644 index 000000000..083eee147 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-android-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createAndroidPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + applicationId: '<APPLICATION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-apple-platform.md b/examples/2.0.x/server-nodejs/examples/project/create-apple-platform.md new file mode 100644 index 000000000..544e3068a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-apple-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createApplePlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + bundleIdentifier: '<BUNDLE_IDENTIFIER>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-nodejs/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..352c6316a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-ephemeral-key.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createEphemeralKey({ + scopes: [sdk.ProjectKeyScopes.ProjectRead], + duration: 600, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-linux-platform.md b/examples/2.0.x/server-nodejs/examples/project/create-linux-platform.md new file mode 100644 index 000000000..7555da386 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-linux-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createLinuxPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageName: '<PACKAGE_NAME>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-mock-phone.md b/examples/2.0.x/server-nodejs/examples/project/create-mock-phone.md new file mode 100644 index 000000000..74fc63991 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-mock-phone.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createMockPhone({ + number: '+12065550100', + otp: '<OTP>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-smtp-test.md b/examples/2.0.x/server-nodejs/examples/project/create-smtp-test.md new file mode 100644 index 000000000..0246650b0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-smtp-test.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createSMTPTest({ + emails: [], +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-variable.md b/examples/2.0.x/server-nodejs/examples/project/create-variable.md new file mode 100644 index 000000000..3f06a9e60 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-variable.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createVariable({ + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-web-platform.md b/examples/2.0.x/server-nodejs/examples/project/create-web-platform.md new file mode 100644 index 000000000..50ae6db8b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-web-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createWebPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/create-windows-platform.md b/examples/2.0.x/server-nodejs/examples/project/create-windows-platform.md new file mode 100644 index 000000000..4bc666e05 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/create-windows-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createWindowsPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageIdentifierName: '<PACKAGE_IDENTIFIER_NAME>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/delete-key.md b/examples/2.0.x/server-nodejs/examples/project/delete-key.md new file mode 100644 index 000000000..10013221e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/delete-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deleteKey({ + keyId: '<KEY_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/delete-mock-phone.md b/examples/2.0.x/server-nodejs/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..7270f738a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/delete-mock-phone.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deleteMockPhone({ + number: '+12065550100', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/delete-platform.md b/examples/2.0.x/server-nodejs/examples/project/delete-platform.md new file mode 100644 index 000000000..f1cd0a9f2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/delete-platform.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deletePlatform({ + platformId: '<PLATFORM_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/delete-variable.md b/examples/2.0.x/server-nodejs/examples/project/delete-variable.md new file mode 100644 index 000000000..9db9b3a21 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/delete-variable.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deleteVariable({ + variableId: '<VARIABLE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/delete.md b/examples/2.0.x/server-nodejs/examples/project/delete.md new file mode 100644 index 000000000..150939ed3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/delete.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.delete(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/get-email-template.md b/examples/2.0.x/server-nodejs/examples/project/get-email-template.md new file mode 100644 index 000000000..5645f4057 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/get-email-template.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getEmailTemplate({ + templateId: sdk.ProjectEmailTemplateId.Verification, + locale: sdk.ProjectEmailTemplateLocale.Af, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/get-key.md b/examples/2.0.x/server-nodejs/examples/project/get-key.md new file mode 100644 index 000000000..ef42cd150 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/get-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getKey({ + keyId: '<KEY_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/get-mock-phone.md b/examples/2.0.x/server-nodejs/examples/project/get-mock-phone.md new file mode 100644 index 000000000..d17069d90 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/get-mock-phone.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getMockPhone({ + number: '+12065550100', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-nodejs/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..94012a514 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getOAuth2Provider({ + providerId: sdk.ProjectOAuthProviderId.Amazon, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/get-platform.md b/examples/2.0.x/server-nodejs/examples/project/get-platform.md new file mode 100644 index 000000000..bfebc6b5e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/get-platform.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getPlatform({ + platformId: '<PLATFORM_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/get-policy.md b/examples/2.0.x/server-nodejs/examples/project/get-policy.md new file mode 100644 index 000000000..03e43274c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/get-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getPolicy({ + policyId: sdk.ProjectPolicyId.PasswordDictionary, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/get-variable.md b/examples/2.0.x/server-nodejs/examples/project/get-variable.md new file mode 100644 index 000000000..951e5d44b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/get-variable.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getVariable({ + variableId: '<VARIABLE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/get.md b/examples/2.0.x/server-nodejs/examples/project/get.md new file mode 100644 index 000000000..5ee86b8a5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/get.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.get(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/list-email-templates.md b/examples/2.0.x/server-nodejs/examples/project/list-email-templates.md new file mode 100644 index 000000000..54c3cea21 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/list-email-templates.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listEmailTemplates({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/list-keys.md b/examples/2.0.x/server-nodejs/examples/project/list-keys.md new file mode 100644 index 000000000..e0890bd62 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/list-keys.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listKeys({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/list-mock-phones.md b/examples/2.0.x/server-nodejs/examples/project/list-mock-phones.md new file mode 100644 index 000000000..024b551b1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/list-mock-phones.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listMockPhones({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-nodejs/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..50adaa040 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listOAuth2Providers({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/list-platforms.md b/examples/2.0.x/server-nodejs/examples/project/list-platforms.md new file mode 100644 index 000000000..fc26d4e46 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/list-platforms.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listPlatforms({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/list-policies.md b/examples/2.0.x/server-nodejs/examples/project/list-policies.md new file mode 100644 index 000000000..971552b42 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/list-policies.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listPolicies({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/list-variables.md b/examples/2.0.x/server-nodejs/examples/project/list-variables.md new file mode 100644 index 000000000..6f5052503 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/list-variables.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listVariables({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-android-platform.md b/examples/2.0.x/server-nodejs/examples/project/update-android-platform.md new file mode 100644 index 000000000..ad0d3d28c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-android-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateAndroidPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + applicationId: '<APPLICATION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-apple-platform.md b/examples/2.0.x/server-nodejs/examples/project/update-apple-platform.md new file mode 100644 index 000000000..7170be871 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-apple-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateApplePlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + bundleIdentifier: '<BUNDLE_IDENTIFIER>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-auth-method.md b/examples/2.0.x/server-nodejs/examples/project/update-auth-method.md new file mode 100644 index 000000000..1994e2cb7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-auth-method.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateAuthMethod({ + methodId: sdk.ProjectAuthMethodId.EmailPassword, + enabled: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-email-template.md b/examples/2.0.x/server-nodejs/examples/project/update-email-template.md new file mode 100644 index 000000000..ae1450414 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-email-template.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateEmailTemplate({ + templateId: sdk.ProjectEmailTemplateId.Verification, + locale: sdk.ProjectEmailTemplateLocale.Af, // optional + subject: '<SUBJECT>', // optional + message: '<MESSAGE>', // optional + senderName: '<SENDER_NAME>', // optional + senderEmail: 'email@example.com', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-key.md b/examples/2.0.x/server-nodejs/examples/project/update-key.md new file mode 100644 index 000000000..0505a54f9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-key.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateKey({ + keyId: '<KEY_ID>', + name: '<NAME>', + scopes: [sdk.ProjectKeyScopes.ProjectRead], + expire: '2020-10-15T06:38:00.000+00:00', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-labels.md b/examples/2.0.x/server-nodejs/examples/project/update-labels.md new file mode 100644 index 000000000..1d58ef1c8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-labels.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateLabels({ + labels: [], +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-linux-platform.md b/examples/2.0.x/server-nodejs/examples/project/update-linux-platform.md new file mode 100644 index 000000000..b1459527f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-linux-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateLinuxPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageName: '<PACKAGE_NAME>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..9f23b9a6f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateMembershipPrivacyPolicy({ + userId: false, // optional + userEmail: false, // optional + userPhone: false, // optional + userName: false, // optional + userMFA: false, // optional + userAccessedAt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..1d9be8f2f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateMFAFactorsPolicy({ + totp: false, // optional + email: false, // optional + phone: false, // optional + custom: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-mock-phone.md b/examples/2.0.x/server-nodejs/examples/project/update-mock-phone.md new file mode 100644 index 000000000..1beb26834 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-mock-phone.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateMockPhone({ + number: '+12065550100', + otp: '<OTP>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..a6ddbdb3a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Amazon({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..7c6f5590f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Apple({ + serviceId: '<SERVICE_ID>', // optional + keyId: '<KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + p8File: '<P8_FILE>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..b48ccbba1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Appwrite({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..d23fb2c5a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Auth0({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..ab18b29d8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Authentik({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..e3be00818 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Autodesk({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..d521d53c5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Bitbucket({ + key: '<KEY>', // optional + secret: '<SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..2c1471742 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Bitly({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..87a23c1cd --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-box.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Box({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..ae26fc9a0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Cloudflare({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..16942aa21 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Dailymotion({ + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..151b93c1a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Discord({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..296d1e99e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Disqus({ + publicKey: '<PUBLIC_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..913b3cf05 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Dropbox({ + appKey: '<APP_KEY>', // optional + appSecret: '<APP_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..a0002893e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Etsy({ + keyString: '<KEY_STRING>', // optional + sharedSecret: '<SHARED_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..ed0b5316a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Facebook({ + appId: '<APP_ID>', // optional + appSecret: '<APP_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..a81d5b1dd --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Figma({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..fc33b5fd6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2FusionAuth({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..0a7a757d1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2GitHub({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..273c1bc8e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Gitlab({ + applicationId: '<APPLICATION_ID>', // optional + secret: '<SECRET>', // optional + endpoint: 'https://example.com', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..17696bf75 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-google.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Google({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + prompt: [sdk.ProjectOAuth2GooglePrompt.None], // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..ca0acbe64 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2HuggingFace({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..542675b82 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Keycloak({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + realmName: '<REALM_NAME>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..88bebd748 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Kick({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..4e08e846e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Linkedin({ + clientId: '<CLIENT_ID>', // optional + primaryClientSecret: '<PRIMARY_CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..29e186977 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Microsoft({ + applicationId: '<APPLICATION_ID>', // optional + applicationSecret: '<APPLICATION_SECRET>', // optional + tenant: '<TENANT>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..84ccf7b5b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Notion({ + oauthClientId: '<OAUTH_CLIENT_ID>', // optional + oauthClientSecret: '<OAUTH_CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..6f345b232 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,22 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Oidc({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + wellKnownURL: 'https://example.com', // optional + authorizationURL: 'https://example.com', // optional + tokenURL: 'https://example.com', // optional + userInfoURL: 'https://example.com', // optional + prompt: [sdk.ProjectOAuth2OidcPrompt.None], // optional + maxAge: 0, // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..519f02654 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Okta({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + domain: 'example.com', // optional + authorizationServerId: '<AUTHORIZATION_SERVER_ID>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..0abb7d7ed --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2PaypalSandbox({ + clientId: '<CLIENT_ID>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..1b989c82f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Paypal({ + clientId: '<CLIENT_ID>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..2da41643c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Podio({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..d6c706891 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Resend({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..642249f1d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Salesforce({ + customerKey: '<CUSTOMER_KEY>', // optional + customerSecret: '<CUSTOMER_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..dd9b69689 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Slack({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..9144b697f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Spotify({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..4621803ac --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Stripe({ + clientId: '<CLIENT_ID>', // optional + apiSecretKey: '<API_SECRET_KEY>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..1be4443f4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2TradeshiftSandbox({ + oauth2ClientId: '<OAUTH2_CLIENT_ID>', // optional + oauth2ClientSecret: '<OAUTH2_CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..0fe5c0fb1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Tradeshift({ + oauth2ClientId: '<OAUTH2_CLIENT_ID>', // optional + oauth2ClientSecret: '<OAUTH2_CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..0cc817caf --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Twitch({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..262989f1d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2WordPress({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..28534ef44 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Yahoo({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..2618e1781 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Yandex({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..8b623cd8e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Zoho({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..76d432626 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Zoom({ + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..4e37f1346 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-o-auth-2x.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2X({ + customerKey: '<CUSTOMER_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..859aa6eab --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updatePasswordDictionaryPolicy({ + enabled: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-password-history-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..e7c018538 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-password-history-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updatePasswordHistoryPolicy({ + total: 1, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..b0669c53c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updatePasswordPersonalDataPolicy({ + enabled: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..9fc9359f3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-password-strength-policy.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updatePasswordStrengthPolicy({ + min: 8, // optional + uppercase: false, // optional + lowercase: false, // optional + number: false, // optional + symbols: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-protocol.md b/examples/2.0.x/server-nodejs/examples/project/update-protocol.md new file mode 100644 index 000000000..89d117e04 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-protocol.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateProtocol({ + protocolId: sdk.ProjectProtocolId.Rest, + enabled: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-service.md b/examples/2.0.x/server-nodejs/examples/project/update-service.md new file mode 100644 index 000000000..2140085c1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-service.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateService({ + serviceId: sdk.ProjectServiceId.Account, + enabled: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..5a713438d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-session-alert-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSessionAlertPolicy({ + enabled: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..12544efe2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-session-duration-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSessionDurationPolicy({ + duration: 60, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..c4234ff8c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSessionInvalidationPolicy({ + enabled: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..0c4c8a397 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-session-limit-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSessionLimitPolicy({ + total: 1, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-smtp.md b/examples/2.0.x/server-nodejs/examples/project/update-smtp.md new file mode 100644 index 000000000..869ab6073 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-smtp.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateSMTP({ + host: 'example.com', // optional + port: 587, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + senderEmail: 'email@example.com', // optional + senderName: '<SENDER_NAME>', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + secure: sdk.ProjectSMTPSecure.Tls, // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-nodejs/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..44451f8bf --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-user-limit-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateUserLimitPolicy({ + total: 0, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-variable.md b/examples/2.0.x/server-nodejs/examples/project/update-variable.md new file mode 100644 index 000000000..b53da55d4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-variable.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateVariable({ + variableId: '<VARIABLE_ID>', + key: '<KEY>', // optional + value: '<VALUE>', // optional + secret: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-web-platform.md b/examples/2.0.x/server-nodejs/examples/project/update-web-platform.md new file mode 100644 index 000000000..8dcdca76a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-web-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateWebPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/project/update-windows-platform.md b/examples/2.0.x/server-nodejs/examples/project/update-windows-platform.md new file mode 100644 index 000000000..0fc1f5372 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/project/update-windows-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateWindowsPlatform({ + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageIdentifierName: '<PACKAGE_IDENTIFIER_NAME>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/proxy/create-api-rule.md b/examples/2.0.x/server-nodejs/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..2d615fe99 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/proxy/create-api-rule.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.createAPIRule({ + domain: 'example.com', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/proxy/create-function-rule.md b/examples/2.0.x/server-nodejs/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..67203df7a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/proxy/create-function-rule.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.createFunctionRule({ + domain: 'example.com', + functionId: '<FUNCTION_ID>', + branch: '<BRANCH>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-nodejs/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..28370b5e0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/proxy/create-redirect-rule.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.createRedirectRule({ + domain: 'example.com', + url: 'https://example.com', + statusCode: sdk.StatusCode.MovedPermanently, + resourceId: '<RESOURCE_ID>', + resourceType: sdk.ProxyResourceType.Site, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/proxy/create-site-rule.md b/examples/2.0.x/server-nodejs/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..74b033f3d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/proxy/create-site-rule.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.createSiteRule({ + domain: 'example.com', + siteId: '<SITE_ID>', + branch: '<BRANCH>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/proxy/delete-rule.md b/examples/2.0.x/server-nodejs/examples/proxy/delete-rule.md new file mode 100644 index 000000000..b4c2c901c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/proxy/delete-rule.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.deleteRule({ + ruleId: '<RULE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/proxy/get-rule.md b/examples/2.0.x/server-nodejs/examples/proxy/get-rule.md new file mode 100644 index 000000000..26d05426e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/proxy/get-rule.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.getRule({ + ruleId: '<RULE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/proxy/list-rules.md b/examples/2.0.x/server-nodejs/examples/proxy/list-rules.md new file mode 100644 index 000000000..50e4adefc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/proxy/list-rules.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.listRules({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/proxy/update-rule-status.md b/examples/2.0.x/server-nodejs/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..62bc0dac7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/proxy/update-rule-status.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const proxy = new sdk.Proxy(client); + +const result = await proxy.updateRuleStatus({ + ruleId: '<RULE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/create-deployment.md b/examples/2.0.x/server-nodejs/examples/sites/create-deployment.md new file mode 100644 index 000000000..a07dedee6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/create-deployment.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); +const fs = require('fs'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createDeployment({ + siteId: '<SITE_ID>', + code: InputFile.fromPath('/path/to/file', 'filename'), + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + activate: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-nodejs/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..84e57866e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createDuplicateDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/create-template-deployment.md b/examples/2.0.x/server-nodejs/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..f78ae972f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/create-template-deployment.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createTemplateDeployment({ + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + type: sdk.TemplateReferenceType.Branch, + reference: '<REFERENCE>', + activate: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/create-variable.md b/examples/2.0.x/server-nodejs/examples/sites/create-variable.md new file mode 100644 index 000000000..b6acc61ed --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/create-variable.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-nodejs/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..5e0b68aac --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/create-vcs-deployment.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createVcsDeployment({ + siteId: '<SITE_ID>', + type: sdk.VCSReferenceType.Branch, + reference: '<REFERENCE>', + activate: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/create.md b/examples/2.0.x/server-nodejs/examples/sites/create.md new file mode 100644 index 000000000..686e7377e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/create.md @@ -0,0 +1,37 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.create({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: sdk.Framework.Analog, + buildRuntime: sdk.BuildRuntime.Node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + startCommand: '<START_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + adapter: sdk.Adapter.Static, // optional + installationId: '<INSTALLATION_ID>', // optional + fallbackFile: '<FALLBACK_FILE>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional + scopes: [sdk.ProjectKeyScopes.ProjectRead], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/delete-deployment.md b/examples/2.0.x/server-nodejs/examples/sites/delete-deployment.md new file mode 100644 index 000000000..cf508cc8d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/delete-deployment.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/delete-log.md b/examples/2.0.x/server-nodejs/examples/sites/delete-log.md new file mode 100644 index 000000000..e198a5aa1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/delete-log.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/delete-variable.md b/examples/2.0.x/server-nodejs/examples/sites/delete-variable.md new file mode 100644 index 000000000..b47b7acdb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/delete-variable.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/delete.md b/examples/2.0.x/server-nodejs/examples/sites/delete.md new file mode 100644 index 000000000..45fdb0df6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.delete({ + siteId: '<SITE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/get-deployment-download.md b/examples/2.0.x/server-nodejs/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..0cd6d782b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/get-deployment-download.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getDeploymentDownload({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: sdk.DeploymentDownloadType.Source, // optional + token: '<TOKEN>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/get-deployment.md b/examples/2.0.x/server-nodejs/examples/sites/get-deployment.md new file mode 100644 index 000000000..b12fa8d10 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/get-deployment.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/get-log.md b/examples/2.0.x/server-nodejs/examples/sites/get-log.md new file mode 100644 index 000000000..74233128a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/get-log.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/get-variable.md b/examples/2.0.x/server-nodejs/examples/sites/get-variable.md new file mode 100644 index 000000000..1403faeae --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/get-variable.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/get.md b/examples/2.0.x/server-nodejs/examples/sites/get.md new file mode 100644 index 000000000..e5a6ef690 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.get({ + siteId: '<SITE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/list-deployments.md b/examples/2.0.x/server-nodejs/examples/sites/list-deployments.md new file mode 100644 index 000000000..dec9ad4b9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/list-deployments.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listDeployments({ + siteId: '<SITE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/list-frameworks.md b/examples/2.0.x/server-nodejs/examples/sites/list-frameworks.md new file mode 100644 index 000000000..9a417bfd0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/list-frameworks.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listFrameworks(); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/list-logs.md b/examples/2.0.x/server-nodejs/examples/sites/list-logs.md new file mode 100644 index 000000000..967b3fe49 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/list-logs.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listLogs({ + siteId: '<SITE_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/list-specifications.md b/examples/2.0.x/server-nodejs/examples/sites/list-specifications.md new file mode 100644 index 000000000..85a1a84fb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/list-specifications.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listSpecifications({ + type: 'runtimes', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/list-variables.md b/examples/2.0.x/server-nodejs/examples/sites/list-variables.md new file mode 100644 index 000000000..413399623 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/list-variables.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listVariables({ + siteId: '<SITE_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/list.md b/examples/2.0.x/server-nodejs/examples/sites/list.md new file mode 100644 index 000000000..4b00cd023 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/update-deployment-status.md b/examples/2.0.x/server-nodejs/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..6a4680128 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/update-deployment-status.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateDeploymentStatus({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/update-site-deployment.md b/examples/2.0.x/server-nodejs/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..5b23fbe6c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/update-site-deployment.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateSiteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/update-variable.md b/examples/2.0.x/server-nodejs/examples/sites/update-variable.md new file mode 100644 index 000000000..d489347c1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/update-variable.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', // optional + value: '<VALUE>', // optional + secret: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/sites/update.md b/examples/2.0.x/server-nodejs/examples/sites/update.md new file mode 100644 index 000000000..932cf0026 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/sites/update.md @@ -0,0 +1,37 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.update({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: sdk.Framework.Analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + startCommand: '<START_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + buildRuntime: sdk.BuildRuntime.Node145, // optional + adapter: sdk.Adapter.Static, // optional + fallbackFile: '<FALLBACK_FILE>', // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional + scopes: [sdk.ProjectKeyScopes.ProjectRead], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/create-bucket.md b/examples/2.0.x/server-nodejs/examples/storage/create-bucket.md new file mode 100644 index 000000000..fe16a23bc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/create-bucket.md @@ -0,0 +1,24 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.createBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: sdk.Compression.None, // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/create-file.md b/examples/2.0.x/server-nodejs/examples/storage/create-file.md new file mode 100644 index 000000000..d69727e16 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/create-file.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); +const fs = require('fs'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.createFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile.fromPath('/path/to/file', 'filename'), + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + folder: 'photos/2026', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/delete-bucket.md b/examples/2.0.x/server-nodejs/examples/storage/delete-bucket.md new file mode 100644 index 000000000..50fb31977 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/delete-bucket.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.deleteBucket({ + bucketId: '<BUCKET_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/delete-file.md b/examples/2.0.x/server-nodejs/examples/storage/delete-file.md new file mode 100644 index 000000000..da2765333 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/delete-file.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.deleteFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/get-bucket.md b/examples/2.0.x/server-nodejs/examples/storage/get-bucket.md new file mode 100644 index 000000000..6608f90a5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/get-bucket.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.getBucket({ + bucketId: '<BUCKET_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/get-file-download.md b/examples/2.0.x/server-nodejs/examples/storage/get-file-download.md new file mode 100644 index 000000000..6282691af --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/get-file-download.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.getFileDownload({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/get-file-preview.md b/examples/2.0.x/server-nodejs/examples/storage/get-file-preview.md new file mode 100644 index 000000000..5e13a0ba9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/get-file-preview.md @@ -0,0 +1,27 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.getFilePreview({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: sdk.ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: 'FFFFFF', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: 'FFFFFF', // optional + output: sdk.ImageFormat.Jpg, // optional + token: '<TOKEN>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/get-file-view.md b/examples/2.0.x/server-nodejs/examples/storage/get-file-view.md new file mode 100644 index 000000000..ad9a9d1ec --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/get-file-view.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.getFileView({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/get-file.md b/examples/2.0.x/server-nodejs/examples/storage/get-file.md new file mode 100644 index 000000000..f1aca864b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/get-file.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.getFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/list-buckets.md b/examples/2.0.x/server-nodejs/examples/storage/list-buckets.md new file mode 100644 index 000000000..109ff9030 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/list-buckets.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.listBuckets({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/list-files.md b/examples/2.0.x/server-nodejs/examples/storage/list-files.md new file mode 100644 index 000000000..476da76c1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/list-files.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.listFiles({ + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/update-bucket.md b/examples/2.0.x/server-nodejs/examples/storage/update-bucket.md new file mode 100644 index 000000000..baddf9cf7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/update-bucket.md @@ -0,0 +1,24 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.updateBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: sdk.Compression.None, // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/storage/update-file.md b/examples/2.0.x/server-nodejs/examples/storage/update-file.md new file mode 100644 index 000000000..e178b0875 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/storage/update-file.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.updateFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..914c27a3b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createBigIntColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 1000000, // optional + xdefault: 0, // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..c8c89558f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: false, // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..7c0d259bb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: '2020-10-15T06:38:00.000+00:00', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..957759870 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-email-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'email@example.com', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..d3b878a5c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-enum-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + elements: ['active', 'inactive'], + required: false, + xdefault: 'active', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..5a284bea1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-float-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + xdefault: 10.5, // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-index.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-index.md new file mode 100644 index 000000000..2bd4818e2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-index.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + type: sdk.TablesDBIndexType.Key, + columns: [], + orders: [sdk.OrderBy.Asc], // optional + lengths: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..a7d37f771 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-integer-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + xdefault: 10, // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..b6be4f142 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-ip-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: '192.0.2.0', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..f23523ea1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-line-column.md @@ -0,0 +1,22 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [1, 2], + [3, 4], + [5, 6], + ], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..04dde8ed9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createLongtextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..5c9ec6df7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createMediumtextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-operations.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..80ae63596 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-operations.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createOperations({ + transactionId: '<TRANSACTION_ID>', + operations: [ + { + action: 'create', + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..9783951d2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-point-column.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createPointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [1, 2], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..71f14061b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createPolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [ + [1, 2], + [3, 4], + [5, 6], + [1, 2], + ], + ], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..0f40996e8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: sdk.RelationshipType.OneToOne, + twoWay: false, // optional + key: '<KEY>', // optional + twoWayKey: '<TWO_WAY_KEY>', // optional + onDelete: sdk.RelationMutate.Cascade, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-row.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-row.md new file mode 100644 index 000000000..c1181b1a7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-row.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-rows.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..af17e879d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-rows.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..217c050b8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-string-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + size: 1, + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-table.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-table.md new file mode 100644 index 000000000..cd898df0b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-table.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + rowSecurity: false, // optional + enabled: false, // optional + columns: [], // optional + indexes: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..4ac2fe7db --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-text-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createTextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..467ae167b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createTransaction({ + ttl: 60, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..ba037a62a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-url-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'https://example.com', // optional + array: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..3c3ae8abf --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createVarcharColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + size: 1, + required: false, + xdefault: 'Hello World', // optional + array: false, // optional + encrypt: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/create.md b/examples/2.0.x/server-nodejs/examples/tablesdb/create.md new file mode 100644 index 000000000..9cdb963ea --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/create.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..86e3bec40 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.decrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '<COLUMN>', + value: 1, // optional + min: 0, // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/delete-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..abe3d7644 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-column.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/delete-index.md b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..88252ddc2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-index.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/delete-row.md b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..7bf02f6b3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-row.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..ccc97155d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-rows.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/delete-table.md b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..519c16229 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-table.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..2b91f54c1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/delete-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteTransaction({ + transactionId: '<TRANSACTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/delete.md b/examples/2.0.x/server-nodejs/examples/tablesdb/delete.md new file mode 100644 index 000000000..f31f624d9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.delete({ + databaseId: '<DATABASE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/get-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/get-column.md new file mode 100644 index 000000000..36159efe5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/get-column.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/get-index.md b/examples/2.0.x/server-nodejs/examples/tablesdb/get-index.md new file mode 100644 index 000000000..8a47a395a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/get-index.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/get-row.md b/examples/2.0.x/server-nodejs/examples/tablesdb/get-row.md new file mode 100644 index 000000000..5847c699f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/get-row.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/get-table.md b/examples/2.0.x/server-nodejs/examples/tablesdb/get-table.md new file mode 100644 index 000000000..74c793855 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/get-table.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-nodejs/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..e14fe0407 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/get-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getTransaction({ + transactionId: '<TRANSACTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/get.md b/examples/2.0.x/server-nodejs/examples/tablesdb/get.md new file mode 100644 index 000000000..18187de8e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.get({ + databaseId: '<DATABASE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..626b84f57 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/increment-row-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.incrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '<COLUMN>', + value: 1, // optional + max: 100, // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/list-columns.md b/examples/2.0.x/server-nodejs/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..f14d02b7a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/list-columns.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listColumns({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-nodejs/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..4d5f71bad --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/list-indexes.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listIndexes({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/list-rows.md b/examples/2.0.x/server-nodejs/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..4a8c1b5e4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/list-rows.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/list-tables.md b/examples/2.0.x/server-nodejs/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..f59133f3f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/list-tables.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listTables({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-nodejs/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..51a3fc45e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/list-transactions.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listTransactions({ + queries: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/list.md b/examples/2.0.x/server-nodejs/examples/tablesdb/list.md new file mode 100644 index 000000000..48e0e0187 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..51ba71ab9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateBigIntColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 0, + min: 0, // optional + max: 1000000, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..0f292d000 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: false, + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..162f2f72e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: '2020-10-15T06:38:00.000+00:00', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..4c4f1e8e8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-email-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'email@example.com', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..0b1bf8d64 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-enum-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + elements: ['active', 'inactive'], + required: false, + xdefault: 'active', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..ee1f80a80 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-float-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 10.5, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..16284f3e5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-integer-column.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 10, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..99b0a3c81 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-ip-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: '192.0.2.0', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..f1d3573db --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-line-column.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [1, 2], + [3, 4], + [5, 6], + ], // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..e10359343 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateLongtextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..329215192 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateMediumtextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..d5ec47256 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-point-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updatePointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [1, 2], // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..41b65bf34 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,26 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updatePolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: [ + [ + [1, 2], + [3, 4], + [5, 6], + [1, 2], + ], + ], // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..88b17f10d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + onDelete: sdk.RelationMutate.Cascade, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-row.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-row.md new file mode 100644 index 000000000..c88e3ea77 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-row.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-rows.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..c8bb76aed --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-rows.md @@ -0,0 +1,24 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..368d97c1e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-string-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-table.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-table.md new file mode 100644 index 000000000..dd37e42d9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-table.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + rowSecurity: false, // optional + enabled: false, // optional + purge: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..4a132e667 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-text-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateTextColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..a955d48b3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-transaction.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateTransaction({ + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..72f285cfc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-url-column.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'https://example.com', + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..e2e7714e8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateVarcharColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + xdefault: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/update.md b/examples/2.0.x/server-nodejs/examples/tablesdb/update.md new file mode 100644 index 000000000..6e1db252f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/update.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-nodejs/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..38257ec6f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/upsert-row.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, + }, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-nodejs/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..fea4cbcbb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tablesdb/upsert-rows.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.upsertRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/create-membership.md b/examples/2.0.x/server-nodejs/examples/teams/create-membership.md new file mode 100644 index 000000000..3aa45e3b1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/create-membership.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.createMembership({ + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/create.md b/examples/2.0.x/server-nodejs/examples/teams/create.md new file mode 100644 index 000000000..a26fdd0ff --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/create.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.create({ + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/delete-membership.md b/examples/2.0.x/server-nodejs/examples/teams/delete-membership.md new file mode 100644 index 000000000..018a8da4c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/delete-membership.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.deleteMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/delete.md b/examples/2.0.x/server-nodejs/examples/teams/delete.md new file mode 100644 index 000000000..eb1c1dacc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.delete({ + teamId: '<TEAM_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/get-membership.md b/examples/2.0.x/server-nodejs/examples/teams/get-membership.md new file mode 100644 index 000000000..d0e27b6c1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/get-membership.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.getMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/get-prefs.md b/examples/2.0.x/server-nodejs/examples/teams/get-prefs.md new file mode 100644 index 000000000..fc121f7c1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/get-prefs.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.getPrefs({ + teamId: '<TEAM_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/get.md b/examples/2.0.x/server-nodejs/examples/teams/get.md new file mode 100644 index 000000000..bc6134448 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.get({ + teamId: '<TEAM_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/list-memberships.md b/examples/2.0.x/server-nodejs/examples/teams/list-memberships.md new file mode 100644 index 000000000..802695053 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/list-memberships.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.listMemberships({ + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/list.md b/examples/2.0.x/server-nodejs/examples/teams/list.md new file mode 100644 index 000000000..3484c2957 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/update-membership-status.md b/examples/2.0.x/server-nodejs/examples/teams/update-membership-status.md new file mode 100644 index 000000000..51d222269 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/update-membership-status.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updateMembershipStatus({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/update-membership.md b/examples/2.0.x/server-nodejs/examples/teams/update-membership.md new file mode 100644 index 000000000..7b6fe57f7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/update-membership.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updateMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [], +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/update-name.md b/examples/2.0.x/server-nodejs/examples/teams/update-name.md new file mode 100644 index 000000000..e92a921cd --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/update-name.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updateName({ + teamId: '<TEAM_ID>', + name: '<NAME>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/teams/update-prefs.md b/examples/2.0.x/server-nodejs/examples/teams/update-prefs.md new file mode 100644 index 000000000..3f3e90d70 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/teams/update-prefs.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updatePrefs({ + teamId: '<TEAM_ID>', + prefs: {}, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tokens/create-file-token.md b/examples/2.0.x/server-nodejs/examples/tokens/create-file-token.md new file mode 100644 index 000000000..9161ed910 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tokens/create-file-token.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.createFileToken({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '2020-10-15T06:38:00.000+00:00', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tokens/delete.md b/examples/2.0.x/server-nodejs/examples/tokens/delete.md new file mode 100644 index 000000000..01d424b6b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tokens/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.delete({ + tokenId: '<TOKEN_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tokens/get.md b/examples/2.0.x/server-nodejs/examples/tokens/get.md new file mode 100644 index 000000000..bd06de120 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tokens/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.get({ + tokenId: '<TOKEN_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tokens/list.md b/examples/2.0.x/server-nodejs/examples/tokens/list.md new file mode 100644 index 000000000..cd8bd9ead --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tokens/list.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.list({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/tokens/update.md b/examples/2.0.x/server-nodejs/examples/tokens/update.md new file mode 100644 index 000000000..3f3ddde78 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/tokens/update.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.update({ + tokenId: '<TOKEN_ID>', + expire: '2020-10-15T06:38:00.000+00:00', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-argon-2-user.md b/examples/2.0.x/server-nodejs/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..7035e6d50 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-argon-2-user.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createArgon2User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-nodejs/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..bbe9a74c7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-bcrypt-user.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createBcryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-jwt.md b/examples/2.0.x/server-nodejs/examples/users/create-jwt.md new file mode 100644 index 000000000..cd0c49f0a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-jwt.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createJWT({ + userId: '<USER_ID>', + sessionId: 'recent()', // optional + duration: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-md-5-user.md b/examples/2.0.x/server-nodejs/examples/users/create-md-5-user.md new file mode 100644 index 000000000..578ba7bcb --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-md-5-user.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createMD5User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-nodejs/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..e16cd6454 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createMFARecoveryCodes({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-nodejs/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..b55fa4285 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-ph-pass-user.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createPHPassUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-nodejs/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..f574a9ede --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createScryptModifiedUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-scrypt-user.md b/examples/2.0.x/server-nodejs/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..e0d72dd57 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-scrypt-user.md @@ -0,0 +1,22 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createScryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-session.md b/examples/2.0.x/server-nodejs/examples/users/create-session.md new file mode 100644 index 000000000..2a06e1fa2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-session.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createSession({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-sha-user.md b/examples/2.0.x/server-nodejs/examples/users/create-sha-user.md new file mode 100644 index 000000000..97a0e4b80 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-sha-user.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createSHAUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: sdk.PasswordHash.Sha1, // optional + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-target.md b/examples/2.0.x/server-nodejs/examples/users/create-target.md new file mode 100644 index 000000000..e8e1053d9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-target.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: sdk.MessagingProviderType.Email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create-token.md b/examples/2.0.x/server-nodejs/examples/users/create-token.md new file mode 100644 index 000000000..6bfe51475 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create-token.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createToken({ + userId: '<USER_ID>', + length: 4, // optional + expire: 60, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/create.md b/examples/2.0.x/server-nodejs/examples/users/create.md new file mode 100644 index 000000000..d552ca3c9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/create.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.create({ + userId: '<USER_ID>', + email: 'email@example.com', // optional + phone: '+12065550100', // optional + password: 'password', // optional + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/delete-identity.md b/examples/2.0.x/server-nodejs/examples/users/delete-identity.md new file mode 100644 index 000000000..2cd96a13b --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/delete-identity.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteIdentity({ + identityId: '<IDENTITY_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-nodejs/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..5edacd777 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteMFAAuthenticator({ + userId: '<USER_ID>', + type: sdk.AuthenticatorType.Totp, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/delete-session.md b/examples/2.0.x/server-nodejs/examples/users/delete-session.md new file mode 100644 index 000000000..dbc81ca9e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/delete-session.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteSession({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/delete-sessions.md b/examples/2.0.x/server-nodejs/examples/users/delete-sessions.md new file mode 100644 index 000000000..abde055fd --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/delete-sessions.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteSessions({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/delete-target.md b/examples/2.0.x/server-nodejs/examples/users/delete-target.md new file mode 100644 index 000000000..1136fad55 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/delete-target.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/delete.md b/examples/2.0.x/server-nodejs/examples/users/delete.md new file mode 100644 index 000000000..326ac2a55 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.delete({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-nodejs/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..a782f3494 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/get-mfa-challenge.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.getMFAChallenge({ + userId: '<USER_ID>', + challengeId: '<CHALLENGE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-nodejs/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..45bd7a969 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.getMFARecoveryCodes({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/get-prefs.md b/examples/2.0.x/server-nodejs/examples/users/get-prefs.md new file mode 100644 index 000000000..ce4fa9e28 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/get-prefs.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.getPrefs({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/get-target.md b/examples/2.0.x/server-nodejs/examples/users/get-target.md new file mode 100644 index 000000000..33a86401e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/get-target.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.getTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/get.md b/examples/2.0.x/server-nodejs/examples/users/get.md new file mode 100644 index 000000000..fa2bd0e9a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.get({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/list-identities.md b/examples/2.0.x/server-nodejs/examples/users/list-identities.md new file mode 100644 index 000000000..f2ecf2871 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/list-identities.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listIdentities({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/list-memberships.md b/examples/2.0.x/server-nodejs/examples/users/list-memberships.md new file mode 100644 index 000000000..b8cdcdae6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/list-memberships.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listMemberships({ + userId: '<USER_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/list-mfa-factors.md b/examples/2.0.x/server-nodejs/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..9685721f4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/list-mfa-factors.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listMFAFactors({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/list-sessions.md b/examples/2.0.x/server-nodejs/examples/users/list-sessions.md new file mode 100644 index 000000000..fb163e250 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/list-sessions.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listSessions({ + userId: '<USER_ID>', + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/list-targets.md b/examples/2.0.x/server-nodejs/examples/users/list-targets.md new file mode 100644 index 000000000..9ec0bb0f3 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/list-targets.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listTargets({ + userId: '<USER_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/list.md b/examples/2.0.x/server-nodejs/examples/users/list.md new file mode 100644 index 000000000..04b3ead4e --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-email-verification.md b/examples/2.0.x/server-nodejs/examples/users/update-email-verification.md new file mode 100644 index 000000000..2fcca5df2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-email-verification.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateEmailVerification({ + userId: '<USER_ID>', + emailVerification: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-email.md b/examples/2.0.x/server-nodejs/examples/users/update-email.md new file mode 100644 index 000000000..f465f32da --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-email.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateEmail({ + userId: '<USER_ID>', + email: 'email@example.com', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-impersonator.md b/examples/2.0.x/server-nodejs/examples/users/update-impersonator.md new file mode 100644 index 000000000..7fe71a37a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-impersonator.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateImpersonator({ + userId: '<USER_ID>', + impersonator: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-labels.md b/examples/2.0.x/server-nodejs/examples/users/update-labels.md new file mode 100644 index 000000000..e74ec102d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-labels.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateLabels({ + userId: '<USER_ID>', + labels: [], +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-nodejs/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..5f5f3c408 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateMFARecoveryCodes({ + userId: '<USER_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-mfa.md b/examples/2.0.x/server-nodejs/examples/users/update-mfa.md new file mode 100644 index 000000000..e6dc0ec20 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-mfa.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateMFA({ + userId: '<USER_ID>', + mfa: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-name.md b/examples/2.0.x/server-nodejs/examples/users/update-name.md new file mode 100644 index 000000000..16816e3a7 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-name.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateName({ + userId: '<USER_ID>', + name: '<NAME>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-password.md b/examples/2.0.x/server-nodejs/examples/users/update-password.md new file mode 100644 index 000000000..fe8f33aa6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-password.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updatePassword({ + userId: '<USER_ID>', + password: 'password', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-phone-verification.md b/examples/2.0.x/server-nodejs/examples/users/update-phone-verification.md new file mode 100644 index 000000000..b850d97fe --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-phone-verification.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updatePhoneVerification({ + userId: '<USER_ID>', + phoneVerification: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-phone.md b/examples/2.0.x/server-nodejs/examples/users/update-phone.md new file mode 100644 index 000000000..e29f79604 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-phone.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updatePhone({ + userId: '<USER_ID>', + number: '+12065550100', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-prefs.md b/examples/2.0.x/server-nodejs/examples/users/update-prefs.md new file mode 100644 index 000000000..c041e37c4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-prefs.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updatePrefs({ + userId: '<USER_ID>', + prefs: {}, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-status.md b/examples/2.0.x/server-nodejs/examples/users/update-status.md new file mode 100644 index 000000000..87c273c80 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-status.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateStatus({ + userId: '<USER_ID>', + status: false, +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/users/update-target.md b/examples/2.0.x/server-nodejs/examples/users/update-target.md new file mode 100644 index 000000000..f6ab16246 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/users/update-target.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // optional + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..d7ccf5359 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-collection.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.createCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/create-document.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..35778def1 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-document.md @@ -0,0 +1,24 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + embeddings: [0.12, -0.55, 0.88, 1.02], + metadata: { + key: 'value', + }, + }, + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..bcaedd48c --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.createDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/create-index.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..4b092220a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-index.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.createIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: sdk.VectorsDBIndexType.HnswEuclidean, + attributes: [], + orders: [sdk.OrderBy.Asc], // optional + lengths: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..3804aeed9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-operations.md @@ -0,0 +1,25 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.createOperations({ + transactionId: '<TRANSACTION_ID>', + operations: [ + { + action: 'create', + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/create-query.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..cf98dd23f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-query.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.createQuery({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..1e4fd6d41 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/create-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.createTransaction({ + ttl: 60, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/create.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/create.md new file mode 100644 index 000000000..ab70e3386 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/create.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..21aa353d6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-collection.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.deleteCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..c2f27c3b4 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-document.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..a3905b374 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.deleteDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..2362e3fce --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-index.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.deleteIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..4871cf84a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.deleteTransaction({ + transactionId: '<TRANSACTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/delete.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete.md new file mode 100644 index 000000000..486889a51 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.delete({ + databaseId: '<DATABASE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..147cfa8b5 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/get-collection.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.getCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/get-document.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..a414c9cd8 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/get-document.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/get-index.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..9b7abb040 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/get-index.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.getIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..68437bc00 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/get-transaction.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.getTransaction({ + transactionId: '<TRANSACTION_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/get.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/get.md new file mode 100644 index 000000000..3ea49d65a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.get({ + databaseId: '<DATABASE_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..e3a509eb0 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/list-collections.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.listCollections({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..c2b4b6edf --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/list-documents.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..b0c5b8e22 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/list-indexes.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.listIndexes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..3dfb27329 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/list-transactions.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.listTransactions({ + queries: [], // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/list.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/list.md new file mode 100644 index 000000000..692aa90d9 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/list.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.list({ + queries: [], // optional + search: '<SEARCH>', // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..4f5465429 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/update-collection.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.updateCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/update-document.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..2c9fe6508 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/update-document.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..70278246d --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/update-documents.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.updateDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..5543dfce6 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/update-transaction.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.updateTransaction({ + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/update.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/update.md new file mode 100644 index 000000000..729736b71 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/update.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..26ec74e61 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/upsert-document.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-nodejs/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..38079b970 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const vectorsDB = new sdk.VectorsDB(client); + +const result = await vectorsDB.upsertDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/webhooks/create.md b/examples/2.0.x/server-nodejs/examples/webhooks/create.md new file mode 100644 index 000000000..21ecaccc2 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/webhooks/create.md @@ -0,0 +1,22 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const webhooks = new sdk.Webhooks(client); + +const result = await webhooks.create({ + webhookId: '<WEBHOOK_ID>', + url: 'https://example.com/webhook', + name: '<NAME>', + events: [], + enabled: false, // optional + tls: false, // optional + authUsername: '<AUTH_USERNAME>', // optional + authPassword: 'password', // optional + secret: '<SECRET>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/webhooks/delete.md b/examples/2.0.x/server-nodejs/examples/webhooks/delete.md new file mode 100644 index 000000000..ecdfcd080 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/webhooks/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const webhooks = new sdk.Webhooks(client); + +const result = await webhooks.delete({ + webhookId: '<WEBHOOK_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/webhooks/get.md b/examples/2.0.x/server-nodejs/examples/webhooks/get.md new file mode 100644 index 000000000..02c4eac3a --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/webhooks/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const webhooks = new sdk.Webhooks(client); + +const result = await webhooks.get({ + webhookId: '<WEBHOOK_ID>', +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/webhooks/list.md b/examples/2.0.x/server-nodejs/examples/webhooks/list.md new file mode 100644 index 000000000..cab8f126f --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/webhooks/list.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const webhooks = new sdk.Webhooks(client); + +const result = await webhooks.list({ + queries: [], // optional + total: false, // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/webhooks/update-secret.md b/examples/2.0.x/server-nodejs/examples/webhooks/update-secret.md new file mode 100644 index 000000000..73a41aabc --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/webhooks/update-secret.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const webhooks = new sdk.Webhooks(client); + +const result = await webhooks.updateSecret({ + webhookId: '<WEBHOOK_ID>', + secret: '<SECRET>', // optional +}); +``` diff --git a/examples/2.0.x/server-nodejs/examples/webhooks/update.md b/examples/2.0.x/server-nodejs/examples/webhooks/update.md new file mode 100644 index 000000000..25362bf14 --- /dev/null +++ b/examples/2.0.x/server-nodejs/examples/webhooks/update.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const webhooks = new sdk.Webhooks(client); + +const result = await webhooks.update({ + webhookId: '<WEBHOOK_ID>', + name: '<NAME>', + url: 'https://example.com/webhook', + events: [], + enabled: false, // optional + tls: false, // optional + authUsername: '<AUTH_USERNAME>', // optional + authPassword: 'password', // optional +}); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-anonymous-session.md b/examples/2.0.x/server-php/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..90283cf33 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-anonymous-session.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createAnonymousSession(); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-email-password-session.md b/examples/2.0.x/server-php/examples/account/create-email-password-session.md new file mode 100644 index 000000000..b462ef807 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-email-password-session.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createEmailPasswordSession( + email: 'email@example.com', + password: 'password' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-email-token.md b/examples/2.0.x/server-php/examples/account/create-email-token.md new file mode 100644 index 000000000..1494943f2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-email-token.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createEmailToken( + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-email-verification.md b/examples/2.0.x/server-php/examples/account/create-email-verification.md new file mode 100644 index 000000000..de0eab932 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-email-verification.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createEmailVerification( + url: 'https://example.com' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-magic-url-token.md b/examples/2.0.x/server-php/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..9c31a5138 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-magic-url-token.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createMagicURLToken( + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-php/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..75d848d0d --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-mfa-authenticator.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\AuthenticatorType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createMFAAuthenticator( + type: AuthenticatorType::TOTP() +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-php/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..3b3700309 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-mfa-challenge.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\AuthenticationFactor; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createMFAChallenge( + factor: AuthenticationFactor::EMAIL() +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-php/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..655663f7f --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-php/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..db4dc650a --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-o-auth-2-token.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\OAuthProvider; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createOAuth2Token( + provider: OAuthProvider::AMAZON(), + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-phone-token.md b/examples/2.0.x/server-php/examples/account/create-phone-token.md new file mode 100644 index 000000000..bf56212ef --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-phone-token.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createPhoneToken( + userId: '<USER_ID>', + phone: '+12065550100' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-phone-verification.md b/examples/2.0.x/server-php/examples/account/create-phone-verification.md new file mode 100644 index 000000000..4cedfba48 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-phone-verification.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createPhoneVerification(); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-recovery.md b/examples/2.0.x/server-php/examples/account/create-recovery.md new file mode 100644 index 000000000..24d308c2c --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-recovery.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createRecovery( + email: 'email@example.com', + url: 'https://example.com' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-session.md b/examples/2.0.x/server-php/examples/account/create-session.md new file mode 100644 index 000000000..d40041f74 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-session.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createSession( + userId: '<USER_ID>', + secret: '<SECRET>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create-verification.md b/examples/2.0.x/server-php/examples/account/create-verification.md new file mode 100644 index 000000000..72fa5a9a5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create-verification.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createVerification( + url: 'https://example.com' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/create.md b/examples/2.0.x/server-php/examples/account/create.md new file mode 100644 index 000000000..b4f8c1c69 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/create.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->create( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/account/delete-identity.md b/examples/2.0.x/server-php/examples/account/delete-identity.md new file mode 100644 index 000000000..15f7fa5fc --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/delete-identity.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->deleteIdentity( + identityId: '<IDENTITY_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-php/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..dd434416d --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\AuthenticatorType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->deleteMFAAuthenticator( + type: AuthenticatorType::TOTP() +); +``` diff --git a/examples/2.0.x/server-php/examples/account/delete-session.md b/examples/2.0.x/server-php/examples/account/delete-session.md new file mode 100644 index 000000000..498b0c47c --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/delete-session.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->deleteSession( + sessionId: '<SESSION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/delete-sessions.md b/examples/2.0.x/server-php/examples/account/delete-sessions.md new file mode 100644 index 000000000..7886fabf7 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/delete-sessions.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->deleteSessions(); +``` diff --git a/examples/2.0.x/server-php/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-php/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..9a99dac2c --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->getMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-php/examples/account/get-prefs.md b/examples/2.0.x/server-php/examples/account/get-prefs.md new file mode 100644 index 000000000..e1259176d --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/get-prefs.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->getPrefs(); +``` diff --git a/examples/2.0.x/server-php/examples/account/get-session.md b/examples/2.0.x/server-php/examples/account/get-session.md new file mode 100644 index 000000000..15a99f2b9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/get-session.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->getSession( + sessionId: '<SESSION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/get.md b/examples/2.0.x/server-php/examples/account/get.md new file mode 100644 index 000000000..d1fb255bc --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/get.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->get(); +``` diff --git a/examples/2.0.x/server-php/examples/account/list-identities.md b/examples/2.0.x/server-php/examples/account/list-identities.md new file mode 100644 index 000000000..69c8bbbb4 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/list-identities.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listIdentities( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/account/list-mfa-factors.md b/examples/2.0.x/server-php/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..96b6021bf --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/list-mfa-factors.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listMFAFactors(); +``` diff --git a/examples/2.0.x/server-php/examples/account/list-sessions.md b/examples/2.0.x/server-php/examples/account/list-sessions.md new file mode 100644 index 000000000..9c42f8ca8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/list-sessions.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listSessions(); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-email-verification.md b/examples/2.0.x/server-php/examples/account/update-email-verification.md new file mode 100644 index 000000000..1c363e978 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-email-verification.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateEmailVerification( + userId: '<USER_ID>', + secret: '<SECRET>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-email.md b/examples/2.0.x/server-php/examples/account/update-email.md new file mode 100644 index 000000000..fb2079130 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-email.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateEmail( + email: 'email@example.com', + password: 'password' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-magic-url-session.md b/examples/2.0.x/server-php/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..3fd0179fa --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-magic-url-session.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMagicURLSession( + userId: '<USER_ID>', + secret: '<SECRET>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-php/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..d02e79ce3 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-mfa-authenticator.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\AuthenticatorType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMFAAuthenticator( + type: AuthenticatorType::TOTP(), + otp: '<OTP>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-php/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..bc829a6ed --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-mfa-challenge.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMFAChallenge( + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-php/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..ee16a9c9d --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMFARecoveryCodes(); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-mfa.md b/examples/2.0.x/server-php/examples/account/update-mfa.md new file mode 100644 index 000000000..2d1f35afd --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-mfa.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMFA( + mfa: false +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-name.md b/examples/2.0.x/server-php/examples/account/update-name.md new file mode 100644 index 000000000..9ebb43814 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-name.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateName( + name: '<NAME>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-password.md b/examples/2.0.x/server-php/examples/account/update-password.md new file mode 100644 index 000000000..c9e0fc553 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-password.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePassword( + password: 'password', + oldPassword: 'password' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-phone-session.md b/examples/2.0.x/server-php/examples/account/update-phone-session.md new file mode 100644 index 000000000..f547ca978 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-phone-session.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePhoneSession( + userId: '<USER_ID>', + secret: '<SECRET>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-phone-verification.md b/examples/2.0.x/server-php/examples/account/update-phone-verification.md new file mode 100644 index 000000000..cbc6790c7 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-phone-verification.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePhoneVerification( + userId: '<USER_ID>', + secret: '<SECRET>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-phone.md b/examples/2.0.x/server-php/examples/account/update-phone.md new file mode 100644 index 000000000..b9fe2bd3c --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-phone.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePhone( + phone: '+12065550100', + password: 'password' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-prefs.md b/examples/2.0.x/server-php/examples/account/update-prefs.md new file mode 100644 index 000000000..9176756be --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-prefs.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePrefs( + prefs: [ + 'language' => 'en', + 'timezone' => 'UTC', + 'darkTheme' => true + ] +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-recovery.md b/examples/2.0.x/server-php/examples/account/update-recovery.md new file mode 100644 index 000000000..eb540c39a --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-recovery.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateRecovery( + userId: '<USER_ID>', + secret: '<SECRET>', + password: 'password' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-session.md b/examples/2.0.x/server-php/examples/account/update-session.md new file mode 100644 index 000000000..b98cb3bd1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-session.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateSession( + sessionId: '<SESSION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-status.md b/examples/2.0.x/server-php/examples/account/update-status.md new file mode 100644 index 000000000..7f0088a63 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-status.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateStatus(); +``` diff --git a/examples/2.0.x/server-php/examples/account/update-verification.md b/examples/2.0.x/server-php/examples/account/update-verification.md new file mode 100644 index 000000000..a84126d41 --- /dev/null +++ b/examples/2.0.x/server-php/examples/account/update-verification.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateVerification( + userId: '<USER_ID>', + secret: '<SECRET>' +); +``` diff --git a/examples/2.0.x/server-php/examples/advisor/delete-report.md b/examples/2.0.x/server-php/examples/advisor/delete-report.md new file mode 100644 index 000000000..41d2e336c --- /dev/null +++ b/examples/2.0.x/server-php/examples/advisor/delete-report.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Advisor; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$advisor = new Advisor($client); + +$result = $advisor->deleteReport( + reportId: '<REPORT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/advisor/get-insight.md b/examples/2.0.x/server-php/examples/advisor/get-insight.md new file mode 100644 index 000000000..812ee9bcf --- /dev/null +++ b/examples/2.0.x/server-php/examples/advisor/get-insight.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Advisor; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$advisor = new Advisor($client); + +$result = $advisor->getInsight( + reportId: '<REPORT_ID>', + insightId: '<INSIGHT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/advisor/get-report.md b/examples/2.0.x/server-php/examples/advisor/get-report.md new file mode 100644 index 000000000..1379419c2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/advisor/get-report.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Advisor; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$advisor = new Advisor($client); + +$result = $advisor->getReport( + reportId: '<REPORT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/advisor/list-insights.md b/examples/2.0.x/server-php/examples/advisor/list-insights.md new file mode 100644 index 000000000..d475153cb --- /dev/null +++ b/examples/2.0.x/server-php/examples/advisor/list-insights.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Advisor; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$advisor = new Advisor($client); + +$result = $advisor->listInsights( + reportId: '<REPORT_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/advisor/list-reports.md b/examples/2.0.x/server-php/examples/advisor/list-reports.md new file mode 100644 index 000000000..9dc55caeb --- /dev/null +++ b/examples/2.0.x/server-php/examples/advisor/list-reports.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Advisor; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$advisor = new Advisor($client); + +$result = $advisor->listReports( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-browser.md b/examples/2.0.x/server-php/examples/avatars/get-browser.md new file mode 100644 index 000000000..ccf98858c --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-browser.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; +use Appwrite\Enums\Browser; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getBrowser( + code: Browser::AVANTBROWSER(), + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-credit-card.md b/examples/2.0.x/server-php/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..ff4fd2b30 --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-credit-card.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; +use Appwrite\Enums\CreditCard; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getCreditCard( + code: CreditCard::AMERICANEXPRESS(), + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-favicon.md b/examples/2.0.x/server-php/examples/avatars/get-favicon.md new file mode 100644 index 000000000..346f46d1f --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-favicon.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getFavicon( + url: 'https://example.com' +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-flag.md b/examples/2.0.x/server-php/examples/avatars/get-flag.md new file mode 100644 index 000000000..e2b455b33 --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-flag.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; +use Appwrite\Enums\Flag; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getFlag( + code: Flag::AFGHANISTAN(), + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-image.md b/examples/2.0.x/server-php/examples/avatars/get-image.md new file mode 100644 index 000000000..2ca260193 --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-image.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getImage( + url: 'https://example.com', + width: 0, // optional + height: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-initials.md b/examples/2.0.x/server-php/examples/avatars/get-initials.md new file mode 100644 index 000000000..67681d074 --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-initials.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getInitials( + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: 'FFFFFF' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-photo.md b/examples/2.0.x/server-php/examples/avatars/get-photo.md new file mode 100644 index 000000000..5f5899d64 --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-photo.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '<EMAIL_HASH>', // optional + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-qr.md b/examples/2.0.x/server-php/examples/avatars/get-qr.md new file mode 100644 index 000000000..ec6e3441a --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-qr.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getQR( + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/avatars/get-screenshot.md b/examples/2.0.x/server-php/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..59fbd663d --- /dev/null +++ b/examples/2.0.x/server-php/examples/avatars/get-screenshot.md @@ -0,0 +1,43 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; +use Appwrite\Enums\BrowserTheme; +use Appwrite\Enums\Timezone; +use Appwrite\Enums\BrowserPermission; +use Appwrite\Enums\ImageFormat; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getScreenshot( + url: 'https://example.com', + headers: [ + 'Authorization' => 'Bearer token123', + 'X-Custom-Header' => 'value' + ], // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: BrowserTheme::DARK(), // optional + userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + fullpage: true, // optional + locale: 'en-US', // optional + timezone: Timezone::AFRICAABIDJAN(), // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [BrowserPermission::GEOLOCATION(), BrowserPermission::NOTIFICATIONS()], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: ImageFormat::JPEG() // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-php/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..1384fb18b --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-big-int-attribute.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createBigIntAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 1000000, // optional + default: 0, // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-php/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..2004cf687 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-boolean-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createBooleanAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: false, // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-collection.md b/examples/2.0.x/server-php/examples/databases/create-collection.md new file mode 100644 index 000000000..5adf6f565 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-collection.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission::read(Role::any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-php/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..9ff49a89a --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-datetime-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createDatetimeAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: '2020-10-15T06:38:00.000+00:00', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-document.md b/examples/2.0.x/server-php/examples/databases/create-document.md new file mode 100644 index 000000000..efd3083f9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-document.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 30, + 'isAdmin' => false + ], + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-documents.md b/examples/2.0.x/server-php/examples/databases/create-documents.md new file mode 100644 index 000000000..1f64387b5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-email-attribute.md b/examples/2.0.x/server-php/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..0a104de3c --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-email-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createEmailAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'email@example.com', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-php/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..962b5a793 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-enum-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createEnumAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + required: false, + default: 'active', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-float-attribute.md b/examples/2.0.x/server-php/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..5df36f2d9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-float-attribute.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createFloatAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + default: 10.5, // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-index.md b/examples/2.0.x/server-php/examples/databases/create-index.md new file mode 100644 index 000000000..1005239ed --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-index.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Enums\DatabasesIndexType; +use Appwrite\Enums\OrderBy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: DatabasesIndexType::KEY(), + attributes: [], + orders: [OrderBy::ASC()], // optional + lengths: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-php/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..1b9c453d2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-integer-attribute.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createIntegerAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + default: 10, // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-php/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..afb0ed338 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-ip-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createIpAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: '192.0.2.0', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-line-attribute.md b/examples/2.0.x/server-php/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..c892610af --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-line-attribute.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createLineAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-php/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..376288bbc --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-longtext-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createLongtextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-php/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..67e3da160 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createMediumtextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-operations.md b/examples/2.0.x/server-php/examples/databases/create-operations.md new file mode 100644 index 000000000..82172a3f6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-operations.md @@ -0,0 +1,28 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createOperations( + transactionId: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-point-attribute.md b/examples/2.0.x/server-php/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..385415454 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-point-attribute.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createPointAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [1, 2] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-php/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..5a37c3535 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-polygon-attribute.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createPolygonAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-php/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..6be348856 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-relationship-attribute.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Enums\RelationshipType; +use Appwrite\Enums\RelationMutate; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createRelationshipAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + relatedCollectionId: '<RELATED_COLLECTION_ID>', + type: RelationshipType::ONETOONE(), + twoWay: false, // optional + key: '<KEY>', // optional + twoWayKey: '<TWO_WAY_KEY>', // optional + onDelete: RelationMutate::CASCADE() // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-string-attribute.md b/examples/2.0.x/server-php/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..c0d932106 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-string-attribute.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createStringAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + size: 1, + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-text-attribute.md b/examples/2.0.x/server-php/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..4ad0643d4 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-text-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createTextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-transaction.md b/examples/2.0.x/server-php/examples/databases/create-transaction.md new file mode 100644 index 000000000..600cda585 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createTransaction( + ttl: 60 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-url-attribute.md b/examples/2.0.x/server-php/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..a5e837bba --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-url-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createUrlAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'https://example.com', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-php/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..2bd55824a --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create-varchar-attribute.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createVarcharAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + size: 1, + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/create.md b/examples/2.0.x/server-php/examples/databases/create.md new file mode 100644 index 000000000..95f3cf404 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/create.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-php/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..ca4a5e3d5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/decrement-document-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->decrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // optional + min: 0, // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/delete-attribute.md b/examples/2.0.x/server-php/examples/databases/delete-attribute.md new file mode 100644 index 000000000..4d8b12be1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/delete-attribute.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/delete-collection.md b/examples/2.0.x/server-php/examples/databases/delete-collection.md new file mode 100644 index 000000000..486b9f36d --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/delete-collection.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/delete-document.md b/examples/2.0.x/server-php/examples/databases/delete-document.md new file mode 100644 index 000000000..33f9e1791 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/delete-document.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/delete-documents.md b/examples/2.0.x/server-php/examples/databases/delete-documents.md new file mode 100644 index 000000000..f39cbfe0a --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/delete-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/delete-index.md b/examples/2.0.x/server-php/examples/databases/delete-index.md new file mode 100644 index 000000000..ffbc6c29a --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/delete-index.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/delete-transaction.md b/examples/2.0.x/server-php/examples/databases/delete-transaction.md new file mode 100644 index 000000000..09634f298 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/delete-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteTransaction( + transactionId: '<TRANSACTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/delete.md b/examples/2.0.x/server-php/examples/databases/delete.md new file mode 100644 index 000000000..6f25053af --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->delete( + databaseId: '<DATABASE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/get-attribute.md b/examples/2.0.x/server-php/examples/databases/get-attribute.md new file mode 100644 index 000000000..bf6db3cc1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/get-attribute.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->getAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/get-collection.md b/examples/2.0.x/server-php/examples/databases/get-collection.md new file mode 100644 index 000000000..e8cdada67 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/get-collection.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->getCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/get-document.md b/examples/2.0.x/server-php/examples/databases/get-document.md new file mode 100644 index 000000000..f0827f6e9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/get-document.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/get-index.md b/examples/2.0.x/server-php/examples/databases/get-index.md new file mode 100644 index 000000000..f0d58b284 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/get-index.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->getIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/get-transaction.md b/examples/2.0.x/server-php/examples/databases/get-transaction.md new file mode 100644 index 000000000..235816852 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/get-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->getTransaction( + transactionId: '<TRANSACTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/get.md b/examples/2.0.x/server-php/examples/databases/get.md new file mode 100644 index 000000000..8eb28cbee --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->get( + databaseId: '<DATABASE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-php/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..5eec9fb12 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/increment-document-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->incrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // optional + max: 100, // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/list-attributes.md b/examples/2.0.x/server-php/examples/databases/list-attributes.md new file mode 100644 index 000000000..1867283b2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/list-attributes.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->listAttributes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/list-collections.md b/examples/2.0.x/server-php/examples/databases/list-collections.md new file mode 100644 index 000000000..29dd5ec27 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/list-collections.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->listCollections( + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/list-documents.md b/examples/2.0.x/server-php/examples/databases/list-documents.md new file mode 100644 index 000000000..9e4d143fd --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/list-documents.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/list-indexes.md b/examples/2.0.x/server-php/examples/databases/list-indexes.md new file mode 100644 index 000000000..40b21bbd5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/list-indexes.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->listIndexes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/list-transactions.md b/examples/2.0.x/server-php/examples/databases/list-transactions.md new file mode 100644 index 000000000..97cb6abd9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/list-transactions.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->listTransactions( + queries: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/list.md b/examples/2.0.x/server-php/examples/databases/list.md new file mode 100644 index 000000000..f48d27ff0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->list( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-php/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..41a27b10f --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-big-int-attribute.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateBigIntAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 0, + min: 0, // optional + max: 1000000, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-php/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..ed2ff661e --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-boolean-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateBooleanAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: false, + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-collection.md b/examples/2.0.x/server-php/examples/databases/update-collection.md new file mode 100644 index 000000000..dc8e35221 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-collection.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', // optional + permissions: [Permission::read(Role::any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-php/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..83e704801 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-datetime-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateDatetimeAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: '2020-10-15T06:38:00.000+00:00', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-document.md b/examples/2.0.x/server-php/examples/databases/update-document.md new file mode 100644 index 000000000..1f3b6359e --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-document.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 33, + 'isAdmin' => false + ], // optional + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-documents.md b/examples/2.0.x/server-php/examples/databases/update-documents.md new file mode 100644 index 000000000..68c122177 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-documents.md @@ -0,0 +1,27 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 33, + 'isAdmin' => false + ], // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-email-attribute.md b/examples/2.0.x/server-php/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..44a4da009 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-email-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateEmailAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'email@example.com', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-php/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..8a736bebc --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-enum-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateEnumAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + required: false, + default: 'active', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-float-attribute.md b/examples/2.0.x/server-php/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..d5ad4a166 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-float-attribute.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateFloatAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 10.5, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-php/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..7a51383ff --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-integer-attribute.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateIntegerAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 10, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-php/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..1daf50014 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-ip-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateIpAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: '192.0.2.0', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-line-attribute.md b/examples/2.0.x/server-php/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..a18dbb71a --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-line-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateLineAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-php/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..06e0ef987 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-longtext-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateLongtextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-php/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..e08925a75 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateMediumtextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-point-attribute.md b/examples/2.0.x/server-php/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..54577171a --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-point-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updatePointAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [1, 2], // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-php/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..448b4ef96 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-polygon-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updatePolygonAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-php/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..d1264dfb5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-relationship-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Enums\RelationMutate; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateRelationshipAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + onDelete: RelationMutate::CASCADE(), // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-string-attribute.md b/examples/2.0.x/server-php/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..656401df9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-string-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateStringAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-text-attribute.md b/examples/2.0.x/server-php/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..61bf96f0f --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-text-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateTextAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-transaction.md b/examples/2.0.x/server-php/examples/databases/update-transaction.md new file mode 100644 index 000000000..354d01bb0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-transaction.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateTransaction( + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-url-attribute.md b/examples/2.0.x/server-php/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..9ab77063a --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-url-attribute.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateUrlAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'https://example.com', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-php/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..73b2b7d5c --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update-varchar-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateVarcharAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/update.md b/examples/2.0.x/server-php/examples/databases/update.md new file mode 100644 index 000000000..bd56abc6b --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/update.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/upsert-document.md b/examples/2.0.x/server-php/examples/databases/upsert-document.md new file mode 100644 index 000000000..94aad5829 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/upsert-document.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 30, + 'isAdmin' => false + ], // optional + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/databases/upsert-documents.md b/examples/2.0.x/server-php/examples/databases/upsert-documents.md new file mode 100644 index 000000000..0049fdc69 --- /dev/null +++ b/examples/2.0.x/server-php/examples/databases/upsert-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->upsertDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/create-collection.md b/examples/2.0.x/server-php/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..b149a152b --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/create-collection.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->createCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission::read(Role::any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/create-document.md b/examples/2.0.x/server-php/examples/documentsdb/create-document.md new file mode 100644 index 000000000..4b894f418 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/create-document.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 30, + 'isAdmin' => false + ], + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/create-documents.md b/examples/2.0.x/server-php/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..ec6a43552 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/create-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->createDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/create-index.md b/examples/2.0.x/server-php/examples/documentsdb/create-index.md new file mode 100644 index 000000000..b64d1f8af --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/create-index.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; +use Appwrite\Enums\DocumentsDBIndexType; +use Appwrite\Enums\OrderBy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->createIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: DocumentsDBIndexType::KEY(), + attributes: [], + orders: [OrderBy::ASC()], // optional + lengths: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/create-operations.md b/examples/2.0.x/server-php/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..83d3bab24 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/create-operations.md @@ -0,0 +1,28 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->createOperations( + transactionId: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-php/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..bcf4ad3a4 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/create-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->createTransaction( + ttl: 60 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/create.md b/examples/2.0.x/server-php/examples/documentsdb/create.md new file mode 100644 index 000000000..99204a879 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/create.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-php/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..3c7224e2c --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->decrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // optional + min: 0, // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-php/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..2b11da4d0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/delete-collection.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->deleteCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/delete-document.md b/examples/2.0.x/server-php/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..1e01f3e47 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/delete-document.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-php/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..b77b3756f --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/delete-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->deleteDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/delete-index.md b/examples/2.0.x/server-php/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..a58794821 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/delete-index.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->deleteIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-php/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..6e1f20c9c --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/delete-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->deleteTransaction( + transactionId: '<TRANSACTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/delete.md b/examples/2.0.x/server-php/examples/documentsdb/delete.md new file mode 100644 index 000000000..48d8885b7 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->delete( + databaseId: '<DATABASE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/get-collection.md b/examples/2.0.x/server-php/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..4aa50f2e3 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/get-collection.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->getCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/get-document.md b/examples/2.0.x/server-php/examples/documentsdb/get-document.md new file mode 100644 index 000000000..f82d09a51 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/get-document.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/get-index.md b/examples/2.0.x/server-php/examples/documentsdb/get-index.md new file mode 100644 index 000000000..2f4c28ee3 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/get-index.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->getIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-php/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..44ddeaca2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/get-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->getTransaction( + transactionId: '<TRANSACTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/get.md b/examples/2.0.x/server-php/examples/documentsdb/get.md new file mode 100644 index 000000000..c69054b1b --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->get( + databaseId: '<DATABASE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-php/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..5be35f331 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->incrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, // optional + max: 100, // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/list-collections.md b/examples/2.0.x/server-php/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..a4a3c9942 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/list-collections.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->listCollections( + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/list-documents.md b/examples/2.0.x/server-php/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..57c24c2f6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/list-documents.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-php/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..a229e1109 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/list-indexes.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->listIndexes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-php/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..f154df8e1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/list-transactions.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->listTransactions( + queries: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/list.md b/examples/2.0.x/server-php/examples/documentsdb/list.md new file mode 100644 index 000000000..996d4627e --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->list( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/update-collection.md b/examples/2.0.x/server-php/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..a160bac08 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/update-collection.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->updateCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission::read(Role::any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/update-document.md b/examples/2.0.x/server-php/examples/documentsdb/update-document.md new file mode 100644 index 000000000..0bd209531 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/update-document.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [], // optional + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/update-documents.md b/examples/2.0.x/server-php/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..3daf9039f --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/update-documents.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->updateDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: [], // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-php/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..30b0b7bb7 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/update-transaction.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->updateTransaction( + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/update.md b/examples/2.0.x/server-php/examples/documentsdb/update.md new file mode 100644 index 000000000..4cbeae369 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/update.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-php/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..c35cb3b58 --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/upsert-document.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [], // optional + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-php/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..09021e0af --- /dev/null +++ b/examples/2.0.x/server-php/examples/documentsdb/upsert-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\DocumentsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$documentsDB = new DocumentsDB($client); + +$result = $documentsDB->upsertDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-php/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..70f0f7e1d --- /dev/null +++ b/examples/2.0.x/server-php/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Embeddings; +use Appwrite\Enums\EmbeddingModel; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$embeddings = new Embeddings($client); + +$result = $embeddings->createTextEmbeddings( + texts: [], + model: EmbeddingModel::NOMICEMBEDTEXT() // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/create-deployment.md b/examples/2.0.x/server-php/examples/functions/create-deployment.md new file mode 100644 index 000000000..673d21b42 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/create-deployment.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\InputFile; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createDeployment( + functionId: '<FUNCTION_ID>', + code: InputFile::withPath('file.png'), + activate: false, + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-php/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..75cfedfc6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createDuplicateDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + buildId: '<BUILD_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/create-execution.md b/examples/2.0.x/server-php/examples/functions/create-execution.md new file mode 100644 index 000000000..94427dea9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/create-execution.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; +use Appwrite\Enums\ExecutionMethod; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$functions = new Functions($client); + +$result = $functions->createExecution( + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + async: false, // optional + path: '<PATH>', // optional + method: ExecutionMethod::GET(), // optional + headers: [], // optional + scheduledAt: '<SCHEDULED_AT>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/create-template-deployment.md b/examples/2.0.x/server-php/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..14ec5a732 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/create-template-deployment.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; +use Appwrite\Enums\TemplateReferenceType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createTemplateDeployment( + functionId: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + type: TemplateReferenceType::COMMIT(), + reference: '<REFERENCE>', + activate: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/create-variable.md b/examples/2.0.x/server-php/examples/functions/create-variable.md new file mode 100644 index 000000000..206ac80b3 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/create-variable.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-php/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..ab9d0572e --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/create-vcs-deployment.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; +use Appwrite\Enums\VCSReferenceType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createVcsDeployment( + functionId: '<FUNCTION_ID>', + type: VCSReferenceType::BRANCH(), + reference: '<REFERENCE>', + activate: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/create.md b/examples/2.0.x/server-php/examples/functions/create.md new file mode 100644 index 000000000..0fcac5814 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/create.md @@ -0,0 +1,40 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; +use Appwrite\Enums\Runtime; +use Appwrite\Enums\ProjectKeyScopes; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->create( + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: Runtime::NODE145(), + execute: ["any"], // optional + events: [], // optional + schedule: '0 0 * * *', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [ProjectKeyScopes::PROJECTREAD()], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/delete-deployment.md b/examples/2.0.x/server-php/examples/functions/delete-deployment.md new file mode 100644 index 000000000..60e9cff78 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/delete-deployment.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->deleteDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/delete-execution.md b/examples/2.0.x/server-php/examples/functions/delete-execution.md new file mode 100644 index 000000000..9bf9e5d63 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/delete-execution.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->deleteExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/delete-variable.md b/examples/2.0.x/server-php/examples/functions/delete-variable.md new file mode 100644 index 000000000..25f41540d --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/delete-variable.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->deleteVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/delete.md b/examples/2.0.x/server-php/examples/functions/delete.md new file mode 100644 index 000000000..004319102 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->delete( + functionId: '<FUNCTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/get-deployment-download.md b/examples/2.0.x/server-php/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..fb6d3d01d --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/get-deployment-download.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; +use Appwrite\Enums\DeploymentDownloadType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->getDeploymentDownload( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType::SOURCE(), // optional + token: '<TOKEN>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/get-deployment.md b/examples/2.0.x/server-php/examples/functions/get-deployment.md new file mode 100644 index 000000000..1e264d85c --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/get-deployment.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->getDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/get-execution.md b/examples/2.0.x/server-php/examples/functions/get-execution.md new file mode 100644 index 000000000..b1be6b232 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/get-execution.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$functions = new Functions($client); + +$result = $functions->getExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/get-variable.md b/examples/2.0.x/server-php/examples/functions/get-variable.md new file mode 100644 index 000000000..6b9a802e7 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/get-variable.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->getVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/get.md b/examples/2.0.x/server-php/examples/functions/get.md new file mode 100644 index 000000000..8821156ab --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->get( + functionId: '<FUNCTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/list-deployments.md b/examples/2.0.x/server-php/examples/functions/list-deployments.md new file mode 100644 index 000000000..de89fe381 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/list-deployments.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->listDeployments( + functionId: '<FUNCTION_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/list-executions.md b/examples/2.0.x/server-php/examples/functions/list-executions.md new file mode 100644 index 000000000..9b1fc5b5f --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/list-executions.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$functions = new Functions($client); + +$result = $functions->listExecutions( + functionId: '<FUNCTION_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/list-runtimes.md b/examples/2.0.x/server-php/examples/functions/list-runtimes.md new file mode 100644 index 000000000..320a9dc6c --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/list-runtimes.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->listRuntimes(); +``` diff --git a/examples/2.0.x/server-php/examples/functions/list-specifications.md b/examples/2.0.x/server-php/examples/functions/list-specifications.md new file mode 100644 index 000000000..da2bec2e6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/list-specifications.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->listSpecifications( + type: 'runtimes' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/list-variables.md b/examples/2.0.x/server-php/examples/functions/list-variables.md new file mode 100644 index 000000000..1cc854cc5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/list-variables.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->listVariables( + functionId: '<FUNCTION_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/list.md b/examples/2.0.x/server-php/examples/functions/list.md new file mode 100644 index 000000000..4775e062b --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->list( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/update-deployment-status.md b/examples/2.0.x/server-php/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..c8984428c --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/update-deployment-status.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->updateDeploymentStatus( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/update-function-deployment.md b/examples/2.0.x/server-php/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..5aa5a2669 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/update-function-deployment.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->updateFunctionDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/update-variable.md b/examples/2.0.x/server-php/examples/functions/update-variable.md new file mode 100644 index 000000000..a60cea5e9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/update-variable.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->updateVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', // optional + value: '<VALUE>', // optional + secret: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/functions/update.md b/examples/2.0.x/server-php/examples/functions/update.md new file mode 100644 index 000000000..e13ede1fc --- /dev/null +++ b/examples/2.0.x/server-php/examples/functions/update.md @@ -0,0 +1,40 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; +use Appwrite\Enums\Runtime; +use Appwrite\Enums\ProjectKeyScopes; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->update( + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: Runtime::NODE145(), // optional + execute: ["any"], // optional + events: [], // optional + schedule: '0 0 * * *', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [ProjectKeyScopes::PROJECTREAD()], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/graphql/mutation.md b/examples/2.0.x/server-php/examples/graphql/mutation.md new file mode 100644 index 000000000..c2f1b9890 --- /dev/null +++ b/examples/2.0.x/server-php/examples/graphql/mutation.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Graphql; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$graphql = new Graphql($client); + +$result = $graphql->mutation( + query: [] +); +``` diff --git a/examples/2.0.x/server-php/examples/graphql/query.md b/examples/2.0.x/server-php/examples/graphql/query.md new file mode 100644 index 000000000..9731e9988 --- /dev/null +++ b/examples/2.0.x/server-php/examples/graphql/query.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Graphql; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$graphql = new Graphql($client); + +$result = $graphql->query( + query: [] +); +``` diff --git a/examples/2.0.x/server-php/examples/locale/get.md b/examples/2.0.x/server-php/examples/locale/get.md new file mode 100644 index 000000000..8b204573d --- /dev/null +++ b/examples/2.0.x/server-php/examples/locale/get.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->get(); +``` diff --git a/examples/2.0.x/server-php/examples/locale/list-codes.md b/examples/2.0.x/server-php/examples/locale/list-codes.md new file mode 100644 index 000000000..5c99bbf2d --- /dev/null +++ b/examples/2.0.x/server-php/examples/locale/list-codes.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCodes(); +``` diff --git a/examples/2.0.x/server-php/examples/locale/list-continents.md b/examples/2.0.x/server-php/examples/locale/list-continents.md new file mode 100644 index 000000000..1245b2ecf --- /dev/null +++ b/examples/2.0.x/server-php/examples/locale/list-continents.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listContinents(); +``` diff --git a/examples/2.0.x/server-php/examples/locale/list-countries-eu.md b/examples/2.0.x/server-php/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..9744c8ea6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/locale/list-countries-eu.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCountriesEU(); +``` diff --git a/examples/2.0.x/server-php/examples/locale/list-countries-phones.md b/examples/2.0.x/server-php/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..df66061f6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/locale/list-countries-phones.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCountriesPhones(); +``` diff --git a/examples/2.0.x/server-php/examples/locale/list-countries.md b/examples/2.0.x/server-php/examples/locale/list-countries.md new file mode 100644 index 000000000..f4f962622 --- /dev/null +++ b/examples/2.0.x/server-php/examples/locale/list-countries.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCountries(); +``` diff --git a/examples/2.0.x/server-php/examples/locale/list-currencies.md b/examples/2.0.x/server-php/examples/locale/list-currencies.md new file mode 100644 index 000000000..f4f1125a9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/locale/list-currencies.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCurrencies(); +``` diff --git a/examples/2.0.x/server-php/examples/locale/list-languages.md b/examples/2.0.x/server-php/examples/locale/list-languages.md new file mode 100644 index 000000000..b25fab642 --- /dev/null +++ b/examples/2.0.x/server-php/examples/locale/list-languages.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listLanguages(); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-php/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..2464d9fa8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-apns-provider.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createAPNSProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-email.md b/examples/2.0.x/server-php/examples/messaging/create-email.md new file mode 100644 index 000000000..cd03c685a --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-email.md @@ -0,0 +1,28 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createEmail( + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-php/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..8ff6b217e --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-fcm-provider.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createFCMProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: [], // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-php/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..23eede55f --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createMailgunProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + domain: 'example.com', // optional + isEuRegion: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-php/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..212f6b236 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createMsg91Provider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-push.md b/examples/2.0.x/server-php/examples/messaging/create-push.md new file mode 100644 index 000000000..75734171e --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-push.md @@ -0,0 +1,36 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; +use Appwrite\Enums\MessagePriority; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createPush( + messageId: '<MESSAGE_ID>', + title: '<TITLE>', // optional + body: '<BODY>', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: [], // optional + action: '<ACTION>', // optional + image: '<ID1:ID2>', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority::NORMAL() // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-php/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..9892a9ce0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-resend-provider.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createResendProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-php/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..30c08aef0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createSendgridProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-php/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..183b37349 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-ses-provider.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createSesProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + accessKey: '<ACCESS_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + region: '<REGION>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-sms.md b/examples/2.0.x/server-php/examples/messaging/create-sms.md new file mode 100644 index 000000000..945775ba8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-sms.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createSMS( + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-php/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..4da37c045 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-smtp-provider.md @@ -0,0 +1,31 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; +use Appwrite\Enums\SmtpEncryption; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createSMTPProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 587, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + encryption: SmtpEncryption::NONE(), // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-subscriber.md b/examples/2.0.x/server-php/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..f016b862e --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-subscriber.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +$messaging = new Messaging($client); + +$result = $messaging->createSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-php/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..4f05f8985 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-telesign-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createTelesignProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-php/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..7c60a96fd --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createTextmagicProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-topic.md b/examples/2.0.x/server-php/examples/messaging/create-topic.md new file mode 100644 index 000000000..eca6d5413 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-topic.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createTopic( + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-php/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..568d28d94 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-twilio-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createTwilioProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-php/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..719835de7 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/create-vonage-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createVonageProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/delete-provider.md b/examples/2.0.x/server-php/examples/messaging/delete-provider.md new file mode 100644 index 000000000..c6849300e --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/delete-provider.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->deleteProvider( + providerId: '<PROVIDER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-php/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..bef4fad1b --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/delete-subscriber.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +$messaging = new Messaging($client); + +$result = $messaging->deleteSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/delete-topic.md b/examples/2.0.x/server-php/examples/messaging/delete-topic.md new file mode 100644 index 000000000..353ae213c --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/delete-topic.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->deleteTopic( + topicId: '<TOPIC_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/delete.md b/examples/2.0.x/server-php/examples/messaging/delete.md new file mode 100644 index 000000000..d1e07dd41 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->delete( + messageId: '<MESSAGE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/get-message.md b/examples/2.0.x/server-php/examples/messaging/get-message.md new file mode 100644 index 000000000..19e98cab8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/get-message.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->getMessage( + messageId: '<MESSAGE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/get-provider.md b/examples/2.0.x/server-php/examples/messaging/get-provider.md new file mode 100644 index 000000000..c0b834eee --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/get-provider.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->getProvider( + providerId: '<PROVIDER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/get-subscriber.md b/examples/2.0.x/server-php/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..9f6265bb1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/get-subscriber.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->getSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/get-topic.md b/examples/2.0.x/server-php/examples/messaging/get-topic.md new file mode 100644 index 000000000..d048acb40 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/get-topic.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->getTopic( + topicId: '<TOPIC_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/list-messages.md b/examples/2.0.x/server-php/examples/messaging/list-messages.md new file mode 100644 index 000000000..9bab16efb --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/list-messages.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listMessages( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/list-providers.md b/examples/2.0.x/server-php/examples/messaging/list-providers.md new file mode 100644 index 000000000..1a2640f6e --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/list-providers.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listProviders( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/list-subscribers.md b/examples/2.0.x/server-php/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..34e20a749 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/list-subscribers.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listSubscribers( + topicId: '<TOPIC_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/list-targets.md b/examples/2.0.x/server-php/examples/messaging/list-targets.md new file mode 100644 index 000000000..2fdcb93d9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/list-targets.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listTargets( + messageId: '<MESSAGE_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/list-topics.md b/examples/2.0.x/server-php/examples/messaging/list-topics.md new file mode 100644 index 000000000..d489bf44a --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/list-topics.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listTopics( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-php/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..71708a8bd --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-apns-provider.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateAPNSProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-email.md b/examples/2.0.x/server-php/examples/messaging/update-email.md new file mode 100644 index 000000000..01884f136 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-email.md @@ -0,0 +1,28 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateEmail( + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: '<SUBJECT>', // optional + content: '<CONTENT>', // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + attachments: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-php/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..0bac7199f --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-fcm-provider.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateFCMProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + serviceAccountJSON: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-php/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..9aaabcfb5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateMailgunProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + apiKey: '<API_KEY>', // optional + domain: 'example.com', // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-php/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..0dce50357 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateMsg91Provider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-push.md b/examples/2.0.x/server-php/examples/messaging/update-push.md new file mode 100644 index 000000000..a1b14b71b --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-push.md @@ -0,0 +1,36 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; +use Appwrite\Enums\MessagePriority; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updatePush( + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional + data: [], // optional + action: '<ACTION>', // optional + image: '<ID1:ID2>', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority::NORMAL() // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-php/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..50af4fd54 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-resend-provider.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateResendProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-php/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..f13f1ea5c --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateSendgridProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-php/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..970081383 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-ses-provider.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateSesProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accessKey: '<ACCESS_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + region: '<REGION>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-sms.md b/examples/2.0.x/server-php/examples/messaging/update-sms.md new file mode 100644 index 000000000..3cfd25800 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-sms.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateSMS( + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + content: '<CONTENT>', // optional + draft: false, // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-php/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..1c82f9214 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-smtp-provider.md @@ -0,0 +1,31 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; +use Appwrite\Enums\SmtpEncryption; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateSMTPProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + host: '<HOST>', // optional + port: 1, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + encryption: SmtpEncryption::NONE(), // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-php/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..d89267683 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-telesign-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateTelesignProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-php/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..16c4355b5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateTextmagicProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-topic.md b/examples/2.0.x/server-php/examples/messaging/update-topic.md new file mode 100644 index 000000000..14877cc99 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-topic.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateTopic( + topicId: '<TOPIC_ID>', + name: '<NAME>', // optional + subscribe: ["any"] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-php/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..35ec95d78 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-twilio-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateTwilioProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + from: '<FROM>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-php/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..a4d0f88a4 --- /dev/null +++ b/examples/2.0.x/server-php/examples/messaging/update-vonage-provider.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateVonageProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + from: '<FROM>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/organization/create-project.md b/examples/2.0.x/server-php/examples/organization/create-project.md new file mode 100644 index 000000000..daf43b53a --- /dev/null +++ b/examples/2.0.x/server-php/examples/organization/create-project.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Organization; +use Appwrite\Enums\Region; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$organization = new Organization($client); + +$result = $organization->createProject( + projectId: '<PROJECT_ID>', + name: '<NAME>', + region: Region::DEFAULT() // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/organization/delete-project.md b/examples/2.0.x/server-php/examples/organization/delete-project.md new file mode 100644 index 000000000..3456ab77c --- /dev/null +++ b/examples/2.0.x/server-php/examples/organization/delete-project.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Organization; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$organization = new Organization($client); + +$result = $organization->deleteProject( + projectId: '<PROJECT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/organization/get-project.md b/examples/2.0.x/server-php/examples/organization/get-project.md new file mode 100644 index 000000000..97fe8c37b --- /dev/null +++ b/examples/2.0.x/server-php/examples/organization/get-project.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Organization; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$organization = new Organization($client); + +$result = $organization->getProject( + projectId: '<PROJECT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/organization/list-projects.md b/examples/2.0.x/server-php/examples/organization/list-projects.md new file mode 100644 index 000000000..d44084b85 --- /dev/null +++ b/examples/2.0.x/server-php/examples/organization/list-projects.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Organization; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$organization = new Organization($client); + +$result = $organization->listProjects( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/organization/update-project.md b/examples/2.0.x/server-php/examples/organization/update-project.md new file mode 100644 index 000000000..577fe9f86 --- /dev/null +++ b/examples/2.0.x/server-php/examples/organization/update-project.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Organization; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$organization = new Organization($client); + +$result = $organization->updateProject( + projectId: '<PROJECT_ID>', + name: '<NAME>' +); +``` diff --git a/examples/2.0.x/server-php/examples/presences/delete.md b/examples/2.0.x/server-php/examples/presences/delete.md new file mode 100644 index 000000000..c303ca79a --- /dev/null +++ b/examples/2.0.x/server-php/examples/presences/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Presences; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$presences = new Presences($client); + +$result = $presences->delete( + presenceId: '<PRESENCE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/presences/get.md b/examples/2.0.x/server-php/examples/presences/get.md new file mode 100644 index 000000000..24619c6e0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/presences/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Presences; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$presences = new Presences($client); + +$result = $presences->get( + presenceId: '<PRESENCE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/presences/list.md b/examples/2.0.x/server-php/examples/presences/list.md new file mode 100644 index 000000000..5fb17b992 --- /dev/null +++ b/examples/2.0.x/server-php/examples/presences/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Presences; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$presences = new Presences($client); + +$result = $presences->list( + queries: [], // optional + total: false, // optional + ttl: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/presences/update.md b/examples/2.0.x/server-php/examples/presences/update.md new file mode 100644 index 000000000..dc05bcfe3 --- /dev/null +++ b/examples/2.0.x/server-php/examples/presences/update.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Presences; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$presences = new Presences($client); + +$result = $presences->update( + presenceId: '<PRESENCE_ID>', + userId: '<USER_ID>', + status: '<STATUS>', // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: [], // optional + permissions: [Permission::read(Role::any())], // optional + purge: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/presences/upsert.md b/examples/2.0.x/server-php/examples/presences/upsert.md new file mode 100644 index 000000000..df2e58dcf --- /dev/null +++ b/examples/2.0.x/server-php/examples/presences/upsert.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Presences; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$presences = new Presences($client); + +$result = $presences->upsert( + presenceId: '<PRESENCE_ID>', + userId: '<USER_ID>', + status: '<STATUS>', + permissions: [Permission::read(Role::any())], // optional + expiresAt: '2020-10-15T06:38:00.000+00:00', // optional + metadata: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-android-platform.md b/examples/2.0.x/server-php/examples/project/create-android-platform.md new file mode 100644 index 000000000..ae1df1971 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-android-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createAndroidPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + applicationId: '<APPLICATION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-apple-platform.md b/examples/2.0.x/server-php/examples/project/create-apple-platform.md new file mode 100644 index 000000000..6b2bbd24b --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-apple-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createApplePlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + bundleIdentifier: '<BUNDLE_IDENTIFIER>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-php/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..224dc841a --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-ephemeral-key.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectKeyScopes; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createEphemeralKey( + scopes: [ProjectKeyScopes::PROJECTREAD()], + duration: 600 +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-linux-platform.md b/examples/2.0.x/server-php/examples/project/create-linux-platform.md new file mode 100644 index 000000000..e7ea4295c --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-linux-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createLinuxPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageName: '<PACKAGE_NAME>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-mock-phone.md b/examples/2.0.x/server-php/examples/project/create-mock-phone.md new file mode 100644 index 000000000..87da696cc --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-mock-phone.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createMockPhone( + number: '+12065550100', + otp: '<OTP>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-smtp-test.md b/examples/2.0.x/server-php/examples/project/create-smtp-test.md new file mode 100644 index 000000000..a16026a82 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-smtp-test.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createSMTPTest( + emails: [] +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-variable.md b/examples/2.0.x/server-php/examples/project/create-variable.md new file mode 100644 index 000000000..1bf09c499 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-variable.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createVariable( + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-web-platform.md b/examples/2.0.x/server-php/examples/project/create-web-platform.md new file mode 100644 index 000000000..dc1f7e81f --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-web-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createWebPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/create-windows-platform.md b/examples/2.0.x/server-php/examples/project/create-windows-platform.md new file mode 100644 index 000000000..c9dd6500c --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/create-windows-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->createWindowsPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageIdentifierName: '<PACKAGE_IDENTIFIER_NAME>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/delete-key.md b/examples/2.0.x/server-php/examples/project/delete-key.md new file mode 100644 index 000000000..b964e9d17 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/delete-key.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->deleteKey( + keyId: '<KEY_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/delete-mock-phone.md b/examples/2.0.x/server-php/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..c800757f1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/delete-mock-phone.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->deleteMockPhone( + number: '+12065550100' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/delete-platform.md b/examples/2.0.x/server-php/examples/project/delete-platform.md new file mode 100644 index 000000000..9171a0bd4 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/delete-platform.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->deletePlatform( + platformId: '<PLATFORM_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/delete-variable.md b/examples/2.0.x/server-php/examples/project/delete-variable.md new file mode 100644 index 000000000..988ff801a --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/delete-variable.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->deleteVariable( + variableId: '<VARIABLE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/delete.md b/examples/2.0.x/server-php/examples/project/delete.md new file mode 100644 index 000000000..adb632418 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/delete.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->delete(); +``` diff --git a/examples/2.0.x/server-php/examples/project/get-email-template.md b/examples/2.0.x/server-php/examples/project/get-email-template.md new file mode 100644 index 000000000..87df1a1c0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/get-email-template.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectEmailTemplateId; +use Appwrite\Enums\ProjectEmailTemplateLocale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->getEmailTemplate( + templateId: ProjectEmailTemplateId::VERIFICATION(), + locale: ProjectEmailTemplateLocale::AF() // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/get-key.md b/examples/2.0.x/server-php/examples/project/get-key.md new file mode 100644 index 000000000..45a87d10e --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/get-key.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->getKey( + keyId: '<KEY_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/get-mock-phone.md b/examples/2.0.x/server-php/examples/project/get-mock-phone.md new file mode 100644 index 000000000..e9a69c289 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/get-mock-phone.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->getMockPhone( + number: '+12065550100' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-php/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..718e0e372 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectOAuthProviderId; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->getOAuth2Provider( + providerId: ProjectOAuthProviderId::AMAZON() +); +``` diff --git a/examples/2.0.x/server-php/examples/project/get-platform.md b/examples/2.0.x/server-php/examples/project/get-platform.md new file mode 100644 index 000000000..e99c8deaa --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/get-platform.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->getPlatform( + platformId: '<PLATFORM_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/get-policy.md b/examples/2.0.x/server-php/examples/project/get-policy.md new file mode 100644 index 000000000..d629ac722 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/get-policy.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectPolicyId; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->getPolicy( + policyId: ProjectPolicyId::PASSWORDDICTIONARY() +); +``` diff --git a/examples/2.0.x/server-php/examples/project/get-variable.md b/examples/2.0.x/server-php/examples/project/get-variable.md new file mode 100644 index 000000000..5d47cefee --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/get-variable.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->getVariable( + variableId: '<VARIABLE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/get.md b/examples/2.0.x/server-php/examples/project/get.md new file mode 100644 index 000000000..4e90450b2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/get.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->get(); +``` diff --git a/examples/2.0.x/server-php/examples/project/list-email-templates.md b/examples/2.0.x/server-php/examples/project/list-email-templates.md new file mode 100644 index 000000000..6887b8bda --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/list-email-templates.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->listEmailTemplates( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/list-keys.md b/examples/2.0.x/server-php/examples/project/list-keys.md new file mode 100644 index 000000000..1430acd75 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/list-keys.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->listKeys( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/list-mock-phones.md b/examples/2.0.x/server-php/examples/project/list-mock-phones.md new file mode 100644 index 000000000..7c49e8423 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/list-mock-phones.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->listMockPhones( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-php/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..2cfec075a --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->listOAuth2Providers( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/list-platforms.md b/examples/2.0.x/server-php/examples/project/list-platforms.md new file mode 100644 index 000000000..f5b1bbdde --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/list-platforms.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->listPlatforms( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/list-policies.md b/examples/2.0.x/server-php/examples/project/list-policies.md new file mode 100644 index 000000000..2b8ffd339 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/list-policies.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->listPolicies( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/list-variables.md b/examples/2.0.x/server-php/examples/project/list-variables.md new file mode 100644 index 000000000..8cce3662a --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/list-variables.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->listVariables( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-android-platform.md b/examples/2.0.x/server-php/examples/project/update-android-platform.md new file mode 100644 index 000000000..1898911d1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-android-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateAndroidPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + applicationId: '<APPLICATION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-apple-platform.md b/examples/2.0.x/server-php/examples/project/update-apple-platform.md new file mode 100644 index 000000000..ec7f32458 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-apple-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateApplePlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + bundleIdentifier: '<BUNDLE_IDENTIFIER>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-auth-method.md b/examples/2.0.x/server-php/examples/project/update-auth-method.md new file mode 100644 index 000000000..006f40f31 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-auth-method.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectAuthMethodId; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateAuthMethod( + methodId: ProjectAuthMethodId::EMAILPASSWORD(), + enabled: false +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-email-template.md b/examples/2.0.x/server-php/examples/project/update-email-template.md new file mode 100644 index 000000000..2659fb13b --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-email-template.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectEmailTemplateId; +use Appwrite\Enums\ProjectEmailTemplateLocale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateEmailTemplate( + templateId: ProjectEmailTemplateId::VERIFICATION(), + locale: ProjectEmailTemplateLocale::AF(), // optional + subject: '<SUBJECT>', // optional + message: '<MESSAGE>', // optional + senderName: '<SENDER_NAME>', // optional + senderEmail: 'email@example.com', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-key.md b/examples/2.0.x/server-php/examples/project/update-key.md new file mode 100644 index 000000000..db8839455 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-key.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectKeyScopes; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateKey( + keyId: '<KEY_ID>', + name: '<NAME>', + scopes: [ProjectKeyScopes::PROJECTREAD()], + expire: '2020-10-15T06:38:00.000+00:00' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-labels.md b/examples/2.0.x/server-php/examples/project/update-labels.md new file mode 100644 index 000000000..aace3165f --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-labels.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateLabels( + labels: [] +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-linux-platform.md b/examples/2.0.x/server-php/examples/project/update-linux-platform.md new file mode 100644 index 000000000..1e1cb5f9c --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-linux-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateLinuxPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageName: '<PACKAGE_NAME>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-php/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..145d31675 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateMembershipPrivacyPolicy( + userId: false, // optional + userEmail: false, // optional + userPhone: false, // optional + userName: false, // optional + userMFA: false, // optional + userAccessedAt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-php/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..c0eb035d7 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateMFAFactorsPolicy( + totp: false, // optional + email: false, // optional + phone: false, // optional + custom: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-mock-phone.md b/examples/2.0.x/server-php/examples/project/update-mock-phone.md new file mode 100644 index 000000000..7befe9a80 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-mock-phone.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateMockPhone( + number: '+12065550100', + otp: '<OTP>' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..f73c85e47 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Amazon( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..f742927c4 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Apple( + serviceId: '<SERVICE_ID>', // optional + keyId: '<KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + p8File: '<P8_FILE>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..bf5252d40 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Appwrite( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..b80b4b154 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Auth0( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..0a6c66ac0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Authentik( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..8c3eba870 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Autodesk( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..d33326ec2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Bitbucket( + key: '<KEY>', // optional + secret: '<SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..40de46672 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Bitly( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..551499877 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-box.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Box( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..95e98cbb0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Cloudflare( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..112a73019 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Dailymotion( + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..9a0b16162 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Discord( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..ffc8e7351 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Disqus( + publicKey: '<PUBLIC_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..982c6f3dd --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Dropbox( + appKey: '<APP_KEY>', // optional + appSecret: '<APP_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..01c45f245 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Etsy( + keyString: '<KEY_STRING>', // optional + sharedSecret: '<SHARED_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..0545945a6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Facebook( + appId: '<APP_ID>', // optional + appSecret: '<APP_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..420ebc066 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Figma( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..bc8e7205e --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2FusionAuth( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..92dc57265 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2GitHub( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..485d05f1a --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Gitlab( + applicationId: '<APPLICATION_ID>', // optional + secret: '<SECRET>', // optional + endpoint: 'https://example.com', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..28137e9aa --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-google.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectOAuth2GooglePrompt; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Google( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + prompt: [ProjectOAuth2GooglePrompt::NONE()], // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..c42599ab1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2HuggingFace( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..19d9b9b21 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Keycloak( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + endpoint: '<ENDPOINT>', // optional + realmName: '<REALM_NAME>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..39aba8916 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Kick( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..f80ea7a45 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Linkedin( + clientId: '<CLIENT_ID>', // optional + primaryClientSecret: '<PRIMARY_CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..349bf9329 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Microsoft( + applicationId: '<APPLICATION_ID>', // optional + applicationSecret: '<APPLICATION_SECRET>', // optional + tenant: '<TENANT>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..d4de282bd --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Notion( + oauthClientId: '<OAUTH_CLIENT_ID>', // optional + oauthClientSecret: '<OAUTH_CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..f3b1b8a0a --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectOAuth2OidcPrompt; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Oidc( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + wellKnownURL: 'https://example.com', // optional + authorizationURL: 'https://example.com', // optional + tokenURL: 'https://example.com', // optional + userInfoURL: 'https://example.com', // optional + prompt: [ProjectOAuth2OidcPrompt::NONE()], // optional + maxAge: 0, // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..e03c9b833 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Okta( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + domain: 'example.com', // optional + authorizationServerId: '<AUTHORIZATION_SERVER_ID>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..c6e4096f0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2PaypalSandbox( + clientId: '<CLIENT_ID>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..bab2e8c41 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Paypal( + clientId: '<CLIENT_ID>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..411269c6d --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Podio( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..89c0ba70c --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Resend( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..1247627ca --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Salesforce( + customerKey: '<CUSTOMER_KEY>', // optional + customerSecret: '<CUSTOMER_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..0f07f22a9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Slack( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..08e7e89db --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Spotify( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..975f39257 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Stripe( + clientId: '<CLIENT_ID>', // optional + apiSecretKey: '<API_SECRET_KEY>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..74e32d316 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2TradeshiftSandbox( + oauth2ClientId: '<OAUTH2_CLIENT_ID>', // optional + oauth2ClientSecret: '<OAUTH2_CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..a9431d32d --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Tradeshift( + oauth2ClientId: '<OAUTH2_CLIENT_ID>', // optional + oauth2ClientSecret: '<OAUTH2_CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..0e66fc0eb --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Twitch( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..77469fa1e --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2WordPress( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..379bb0553 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Yahoo( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..f756b1000 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Yandex( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..624b7f4fc --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Zoho( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..655a54820 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2Zoom( + clientId: '<CLIENT_ID>', // optional + clientSecret: '<CLIENT_SECRET>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-php/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..93f3ef31d --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-o-auth-2x.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2X( + customerKey: '<CUSTOMER_KEY>', // optional + secretKey: '<SECRET_KEY>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-php/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..5a8da06fa --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updatePasswordDictionaryPolicy( + enabled: false +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-password-history-policy.md b/examples/2.0.x/server-php/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..2d4c36ef6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-password-history-policy.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updatePasswordHistoryPolicy( + total: 1 +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-php/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..70cc79d11 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updatePasswordPersonalDataPolicy( + enabled: false +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-php/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..08ca290f5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-password-strength-policy.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updatePasswordStrengthPolicy( + min: 8, // optional + uppercase: false, // optional + lowercase: false, // optional + number: false, // optional + symbols: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-protocol.md b/examples/2.0.x/server-php/examples/project/update-protocol.md new file mode 100644 index 000000000..1b8a71f2b --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-protocol.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectProtocolId; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateProtocol( + protocolId: ProjectProtocolId::REST(), + enabled: false +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-service.md b/examples/2.0.x/server-php/examples/project/update-service.md new file mode 100644 index 000000000..606dcca0e --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-service.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectServiceId; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateService( + serviceId: ProjectServiceId::ACCOUNT(), + enabled: false +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-php/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..3973a5a9c --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-session-alert-policy.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateSessionAlertPolicy( + enabled: false +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-php/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..a6f29fc7e --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-session-duration-policy.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateSessionDurationPolicy( + duration: 60 +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-php/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..57b9b4fbb --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateSessionInvalidationPolicy( + enabled: false +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-php/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..5dbda4193 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-session-limit-policy.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateSessionLimitPolicy( + total: 1 +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-smtp.md b/examples/2.0.x/server-php/examples/project/update-smtp.md new file mode 100644 index 000000000..46c5569b1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-smtp.md @@ -0,0 +1,27 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; +use Appwrite\Enums\ProjectSMTPSecure; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateSMTP( + host: 'example.com', // optional + port: 587, // optional + username: '<USERNAME>', // optional + password: 'password', // optional + senderEmail: 'email@example.com', // optional + senderName: '<SENDER_NAME>', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + secure: ProjectSMTPSecure::TLS(), // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-php/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..0c75e1011 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-user-limit-policy.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateUserLimitPolicy( + total: 0 +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-variable.md b/examples/2.0.x/server-php/examples/project/update-variable.md new file mode 100644 index 000000000..632467898 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-variable.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateVariable( + variableId: '<VARIABLE_ID>', + key: '<KEY>', // optional + value: '<VALUE>', // optional + secret: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-web-platform.md b/examples/2.0.x/server-php/examples/project/update-web-platform.md new file mode 100644 index 000000000..5066fc6e4 --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-web-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateWebPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com' +); +``` diff --git a/examples/2.0.x/server-php/examples/project/update-windows-platform.md b/examples/2.0.x/server-php/examples/project/update-windows-platform.md new file mode 100644 index 000000000..25e4f3e9e --- /dev/null +++ b/examples/2.0.x/server-php/examples/project/update-windows-platform.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Project; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$project = new Project($client); + +$result = $project->updateWindowsPlatform( + platformId: '<PLATFORM_ID>', + name: '<NAME>', + packageIdentifierName: '<PACKAGE_IDENTIFIER_NAME>' +); +``` diff --git a/examples/2.0.x/server-php/examples/proxy/create-api-rule.md b/examples/2.0.x/server-php/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..20afada28 --- /dev/null +++ b/examples/2.0.x/server-php/examples/proxy/create-api-rule.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Proxy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->createAPIRule( + domain: 'example.com' +); +``` diff --git a/examples/2.0.x/server-php/examples/proxy/create-function-rule.md b/examples/2.0.x/server-php/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..8e04ee22f --- /dev/null +++ b/examples/2.0.x/server-php/examples/proxy/create-function-rule.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Proxy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->createFunctionRule( + domain: 'example.com', + functionId: '<FUNCTION_ID>', + branch: '<BRANCH>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-php/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..475317173 --- /dev/null +++ b/examples/2.0.x/server-php/examples/proxy/create-redirect-rule.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Proxy; +use Appwrite\Enums\StatusCode; +use Appwrite\Enums\ProxyResourceType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->createRedirectRule( + domain: 'example.com', + url: 'https://example.com', + statusCode: StatusCode::MOVEDPERMANENTLY(), + resourceId: '<RESOURCE_ID>', + resourceType: ProxyResourceType::SITE() +); +``` diff --git a/examples/2.0.x/server-php/examples/proxy/create-site-rule.md b/examples/2.0.x/server-php/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..02b1b8716 --- /dev/null +++ b/examples/2.0.x/server-php/examples/proxy/create-site-rule.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Proxy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->createSiteRule( + domain: 'example.com', + siteId: '<SITE_ID>', + branch: '<BRANCH>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/proxy/delete-rule.md b/examples/2.0.x/server-php/examples/proxy/delete-rule.md new file mode 100644 index 000000000..34ab03d9e --- /dev/null +++ b/examples/2.0.x/server-php/examples/proxy/delete-rule.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Proxy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->deleteRule( + ruleId: '<RULE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/proxy/get-rule.md b/examples/2.0.x/server-php/examples/proxy/get-rule.md new file mode 100644 index 000000000..dd2f22766 --- /dev/null +++ b/examples/2.0.x/server-php/examples/proxy/get-rule.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Proxy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->getRule( + ruleId: '<RULE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/proxy/list-rules.md b/examples/2.0.x/server-php/examples/proxy/list-rules.md new file mode 100644 index 000000000..4f357f44e --- /dev/null +++ b/examples/2.0.x/server-php/examples/proxy/list-rules.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Proxy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->listRules( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/proxy/update-rule-status.md b/examples/2.0.x/server-php/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..c62487409 --- /dev/null +++ b/examples/2.0.x/server-php/examples/proxy/update-rule-status.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Proxy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$proxy = new Proxy($client); + +$result = $proxy->updateRuleStatus( + ruleId: '<RULE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/create-deployment.md b/examples/2.0.x/server-php/examples/sites/create-deployment.md new file mode 100644 index 000000000..96bec4fdc --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/create-deployment.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\InputFile; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createDeployment( + siteId: '<SITE_ID>', + code: InputFile::withPath('file.png'), + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + activate: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-php/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..52cb598d6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createDuplicateDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/create-template-deployment.md b/examples/2.0.x/server-php/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..5eb34f8dd --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/create-template-deployment.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; +use Appwrite\Enums\TemplateReferenceType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createTemplateDeployment( + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + type: TemplateReferenceType::BRANCH(), + reference: '<REFERENCE>', + activate: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/create-variable.md b/examples/2.0.x/server-php/examples/sites/create-variable.md new file mode 100644 index 000000000..ea1baabdf --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/create-variable.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-php/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..3ffffd137 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/create-vcs-deployment.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; +use Appwrite\Enums\VCSReferenceType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createVcsDeployment( + siteId: '<SITE_ID>', + type: VCSReferenceType::BRANCH(), + reference: '<REFERENCE>', + activate: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/create.md b/examples/2.0.x/server-php/examples/sites/create.md new file mode 100644 index 000000000..d25a024f1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/create.md @@ -0,0 +1,44 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; +use Appwrite\Enums\Framework; +use Appwrite\Enums\BuildRuntime; +use Appwrite\Enums\Adapter; +use Appwrite\Enums\ProjectKeyScopes; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->create( + siteId: '<SITE_ID>', + name: '<NAME>', + framework: Framework::ANALOG(), + buildRuntime: BuildRuntime::NODE145(), + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + startCommand: '<START_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + adapter: Adapter::STATIC(), // optional + installationId: '<INSTALLATION_ID>', // optional + fallbackFile: '<FALLBACK_FILE>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional + scopes: [ProjectKeyScopes::PROJECTREAD()] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/delete-deployment.md b/examples/2.0.x/server-php/examples/sites/delete-deployment.md new file mode 100644 index 000000000..df06bd2c0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/delete-deployment.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/delete-log.md b/examples/2.0.x/server-php/examples/sites/delete-log.md new file mode 100644 index 000000000..67db0a86b --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/delete-log.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteLog( + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/delete-variable.md b/examples/2.0.x/server-php/examples/sites/delete-variable.md new file mode 100644 index 000000000..b8d24cb17 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/delete-variable.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/delete.md b/examples/2.0.x/server-php/examples/sites/delete.md new file mode 100644 index 000000000..8a37fe997 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->delete( + siteId: '<SITE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/get-deployment-download.md b/examples/2.0.x/server-php/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..b37b45e1d --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/get-deployment-download.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; +use Appwrite\Enums\DeploymentDownloadType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getDeploymentDownload( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType::SOURCE(), // optional + token: '<TOKEN>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/get-deployment.md b/examples/2.0.x/server-php/examples/sites/get-deployment.md new file mode 100644 index 000000000..94138c06a --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/get-deployment.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/get-log.md b/examples/2.0.x/server-php/examples/sites/get-log.md new file mode 100644 index 000000000..e5b561a08 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/get-log.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getLog( + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/get-variable.md b/examples/2.0.x/server-php/examples/sites/get-variable.md new file mode 100644 index 000000000..9ab1ec370 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/get-variable.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/get.md b/examples/2.0.x/server-php/examples/sites/get.md new file mode 100644 index 000000000..013197669 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->get( + siteId: '<SITE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/list-deployments.md b/examples/2.0.x/server-php/examples/sites/list-deployments.md new file mode 100644 index 000000000..450c2890e --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/list-deployments.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listDeployments( + siteId: '<SITE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/list-frameworks.md b/examples/2.0.x/server-php/examples/sites/list-frameworks.md new file mode 100644 index 000000000..74ea88215 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/list-frameworks.md @@ -0,0 +1,15 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listFrameworks(); +``` diff --git a/examples/2.0.x/server-php/examples/sites/list-logs.md b/examples/2.0.x/server-php/examples/sites/list-logs.md new file mode 100644 index 000000000..28f71df21 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/list-logs.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listLogs( + siteId: '<SITE_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/list-specifications.md b/examples/2.0.x/server-php/examples/sites/list-specifications.md new file mode 100644 index 000000000..3a6826adc --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/list-specifications.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listSpecifications( + type: 'runtimes' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/list-variables.md b/examples/2.0.x/server-php/examples/sites/list-variables.md new file mode 100644 index 000000000..047e609e1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/list-variables.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listVariables( + siteId: '<SITE_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/list.md b/examples/2.0.x/server-php/examples/sites/list.md new file mode 100644 index 000000000..0d01e8131 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->list( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/update-deployment-status.md b/examples/2.0.x/server-php/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..d511aa62d --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/update-deployment-status.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateDeploymentStatus( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/update-site-deployment.md b/examples/2.0.x/server-php/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..ed1c580fa --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/update-site-deployment.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateSiteDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/update-variable.md b/examples/2.0.x/server-php/examples/sites/update-variable.md new file mode 100644 index 000000000..b1bc3600e --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/update-variable.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', // optional + value: '<VALUE>', // optional + secret: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/sites/update.md b/examples/2.0.x/server-php/examples/sites/update.md new file mode 100644 index 000000000..16b517136 --- /dev/null +++ b/examples/2.0.x/server-php/examples/sites/update.md @@ -0,0 +1,44 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; +use Appwrite\Enums\Framework; +use Appwrite\Enums\BuildRuntime; +use Appwrite\Enums\Adapter; +use Appwrite\Enums\ProjectKeyScopes; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->update( + siteId: '<SITE_ID>', + name: '<NAME>', + framework: Framework::ANALOG(), + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + startCommand: '<START_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + buildRuntime: BuildRuntime::NODE145(), // optional + adapter: Adapter::STATIC(), // optional + fallbackFile: '<FALLBACK_FILE>', // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: 's-1vcpu-512mb', // optional + runtimeSpecification: 's-1vcpu-512mb', // optional + deploymentRetention: 0, // optional + scopes: [ProjectKeyScopes::PROJECTREAD()] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/create-bucket.md b/examples/2.0.x/server-php/examples/storage/create-bucket.md new file mode 100644 index 000000000..df878841e --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/create-bucket.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; +use Appwrite\Enums\Compression; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->createBucket( + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: [Permission::read(Role::any())], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: Compression::NONE(), // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/create-file.md b/examples/2.0.x/server-php/examples/storage/create-file.md new file mode 100644 index 000000000..1a9387b63 --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/create-file.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\InputFile; +use Appwrite\Services\Storage; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->createFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile::withPath('file.png'), + permissions: [Permission::read(Role::any())], // optional + folder: 'photos/2026' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/delete-bucket.md b/examples/2.0.x/server-php/examples/storage/delete-bucket.md new file mode 100644 index 000000000..d3e497264 --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/delete-bucket.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->deleteBucket( + bucketId: '<BUCKET_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/delete-file.md b/examples/2.0.x/server-php/examples/storage/delete-file.md new file mode 100644 index 000000000..894783522 --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/delete-file.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->deleteFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/get-bucket.md b/examples/2.0.x/server-php/examples/storage/get-bucket.md new file mode 100644 index 000000000..6dbeac9cd --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/get-bucket.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->getBucket( + bucketId: '<BUCKET_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/get-file-download.md b/examples/2.0.x/server-php/examples/storage/get-file-download.md new file mode 100644 index 000000000..58797f239 --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/get-file-download.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->getFileDownload( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/get-file-preview.md b/examples/2.0.x/server-php/examples/storage/get-file-preview.md new file mode 100644 index 000000000..a2960d66a --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/get-file-preview.md @@ -0,0 +1,32 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; +use Appwrite\Enums\ImageGravity; +use Appwrite\Enums\ImageFormat; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->getFilePreview( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity::CENTER(), // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: 'FFFFFF', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: 'FFFFFF', // optional + output: ImageFormat::JPG(), // optional + token: '<TOKEN>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/get-file-view.md b/examples/2.0.x/server-php/examples/storage/get-file-view.md new file mode 100644 index 000000000..270cf900b --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/get-file-view.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->getFileView( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/get-file.md b/examples/2.0.x/server-php/examples/storage/get-file.md new file mode 100644 index 000000000..5d5a1914c --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/get-file.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->getFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/list-buckets.md b/examples/2.0.x/server-php/examples/storage/list-buckets.md new file mode 100644 index 000000000..5bc0f3071 --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/list-buckets.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->listBuckets( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/list-files.md b/examples/2.0.x/server-php/examples/storage/list-files.md new file mode 100644 index 000000000..46718e2bc --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/list-files.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->listFiles( + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/update-bucket.md b/examples/2.0.x/server-php/examples/storage/update-bucket.md new file mode 100644 index 000000000..5557ce89c --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/update-bucket.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; +use Appwrite\Enums\Compression; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->updateBucket( + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: [Permission::read(Role::any())], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: Compression::NONE(), // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/storage/update-file.md b/examples/2.0.x/server-php/examples/storage/update-file.md new file mode 100644 index 000000000..05bcc65a2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/storage/update-file.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->updateFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: [Permission::read(Role::any())] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..0ada6f92e --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createBigIntColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 1000000, // optional + default: 0, // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..f73001e7e --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createBooleanColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: false, // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..d05fad4ad --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createDatetimeColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: '2020-10-15T06:38:00.000+00:00', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..6a23e2a8a --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-email-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createEmailColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'email@example.com', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..c9e3f5fba --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-enum-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createEnumColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + required: false, + default: 'active', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..9b194fc3e --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-float-column.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createFloatColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + default: 10.5, // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-index.md b/examples/2.0.x/server-php/examples/tablesdb/create-index.md new file mode 100644 index 000000000..2b840eb30 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-index.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Enums\TablesDBIndexType; +use Appwrite\Enums\OrderBy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + type: TablesDBIndexType::KEY(), + columns: [], + orders: [OrderBy::ASC()], // optional + lengths: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..f1fa5219d --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-integer-column.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createIntegerColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, // optional + max: 100, // optional + default: 10, // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..2d7103912 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-ip-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createIpColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: '192.0.2.0', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..4d2204680 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-line-column.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createLineColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..8d853305b --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createLongtextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..8da9475c1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createMediumtextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-operations.md b/examples/2.0.x/server-php/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..e60cf34ee --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-operations.md @@ -0,0 +1,28 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createOperations( + transactionId: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..76079b217 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-point-column.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createPointColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [1, 2] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..7018c1e10 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createPolygonColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..a7ddabc2e --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Enums\RelationshipType; +use Appwrite\Enums\RelationMutate; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createRelationshipColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: RelationshipType::ONETOONE(), + twoWay: false, // optional + key: '<KEY>', // optional + twoWayKey: '<TWO_WAY_KEY>', // optional + onDelete: RelationMutate::CASCADE() // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-row.md b/examples/2.0.x/server-php/examples/tablesdb/create-row.md new file mode 100644 index 000000000..1af620076 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-row.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 30, + 'isAdmin' => false + ], + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-rows.md b/examples/2.0.x/server-php/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..6ae0f802c --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-rows.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..a5f1d5c93 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-string-column.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createStringColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + size: 1, + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-table.md b/examples/2.0.x/server-php/examples/tablesdb/create-table.md new file mode 100644 index 000000000..e4d281b42 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-table.md @@ -0,0 +1,26 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: [Permission::read(Role::any())], // optional + rowSecurity: false, // optional + enabled: false, // optional + columns: [], // optional + indexes: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..b729dc5bb --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-text-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createTextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-php/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..022dc50ce --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createTransaction( + ttl: 60 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..9c3b89a59 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-url-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createUrlColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'https://example.com', // optional + array: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-php/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..6afddbf83 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createVarcharColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + size: 1, + required: false, + default: 'Hello World', // optional + array: false, // optional + encrypt: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/create.md b/examples/2.0.x/server-php/examples/tablesdb/create.md new file mode 100644 index 000000000..d8cda9577 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/create.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-php/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..4cc4b3803 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->decrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '<COLUMN>', + value: 1, // optional + min: 0, // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/delete-column.md b/examples/2.0.x/server-php/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..9f477a3d3 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/delete-column.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/delete-index.md b/examples/2.0.x/server-php/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..0072ae207 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/delete-index.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/delete-row.md b/examples/2.0.x/server-php/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..164a4d236 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/delete-row.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-php/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..2b13b6c7b --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/delete-rows.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/delete-table.md b/examples/2.0.x/server-php/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..fd65a34f8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/delete-table.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-php/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..0127259d3 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/delete-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteTransaction( + transactionId: '<TRANSACTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/delete.md b/examples/2.0.x/server-php/examples/tablesdb/delete.md new file mode 100644 index 000000000..279bcf5f9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->delete( + databaseId: '<DATABASE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/get-column.md b/examples/2.0.x/server-php/examples/tablesdb/get-column.md new file mode 100644 index 000000000..b7d88318d --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/get-column.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/get-index.md b/examples/2.0.x/server-php/examples/tablesdb/get-index.md new file mode 100644 index 000000000..b09bf03fd --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/get-index.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/get-row.md b/examples/2.0.x/server-php/examples/tablesdb/get-row.md new file mode 100644 index 000000000..c0415a602 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/get-row.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/get-table.md b/examples/2.0.x/server-php/examples/tablesdb/get-table.md new file mode 100644 index 000000000..5a2415f47 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/get-table.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-php/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..bbce444e8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/get-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getTransaction( + transactionId: '<TRANSACTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/get.md b/examples/2.0.x/server-php/examples/tablesdb/get.md new file mode 100644 index 000000000..cc771eb6f --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->get( + databaseId: '<DATABASE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-php/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..475409b2a --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/increment-row-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->incrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '<COLUMN>', + value: 1, // optional + max: 100, // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/list-columns.md b/examples/2.0.x/server-php/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..8004a3a3b --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/list-columns.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listColumns( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-php/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..dd865c5bb --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/list-indexes.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listIndexes( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/list-rows.md b/examples/2.0.x/server-php/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..3d4bdfb9e --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/list-rows.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/list-tables.md b/examples/2.0.x/server-php/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..e4c4134a9 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/list-tables.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listTables( + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-php/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..90b698c57 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/list-transactions.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listTransactions( + queries: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/list.md b/examples/2.0.x/server-php/examples/tablesdb/list.md new file mode 100644 index 000000000..ec6ec0467 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->list( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..e1e1aeb4f --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateBigIntColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 0, + min: 0, // optional + max: 1000000, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..a95d7956d --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateBooleanColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: false, + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..c9c6de418 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateDatetimeColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: '2020-10-15T06:38:00.000+00:00', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..8cc042881 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-email-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateEmailColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'email@example.com', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..9d657ba6e --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-enum-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateEnumColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + required: false, + default: 'active', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..9ab8b205c --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-float-column.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateFloatColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 10.5, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..1de8db17e --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-integer-column.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateIntegerColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 10, + min: 0, // optional + max: 100, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..f742db248 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-ip-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateIpColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: '192.0.2.0', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..58257151b --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-line-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateLineColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..e8746ebca --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateLongtextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..45d60e4ad --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateMediumtextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..3b55a7aba --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-point-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updatePointColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [1, 2], // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..05be2de0f --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updatePolygonColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..f3e4e7051 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Enums\RelationMutate; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateRelationshipColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + onDelete: RelationMutate::CASCADE(), // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-row.md b/examples/2.0.x/server-php/examples/tablesdb/update-row.md new file mode 100644 index 000000000..197179e89 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-row.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 33, + 'isAdmin' => false + ], // optional + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-rows.md b/examples/2.0.x/server-php/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..5e9dd0aa4 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-rows.md @@ -0,0 +1,27 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 33, + 'isAdmin' => false + ], // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..b1a7c8572 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-string-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateStringColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-table.md b/examples/2.0.x/server-php/examples/tablesdb/update-table.md new file mode 100644 index 000000000..1881d2e2d --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-table.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', // optional + permissions: [Permission::read(Role::any())], // optional + rowSecurity: false, // optional + enabled: false, // optional + purge: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..df1fea578 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-text-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateTextColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-php/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..ee2c7fab8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-transaction.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateTransaction( + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..d674819ee --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-url-column.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateUrlColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'https://example.com', + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-php/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..c6e46c7b2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateVarcharColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + size: 1, // optional + newKey: '<NEW_KEY>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/update.md b/examples/2.0.x/server-php/examples/tablesdb/update.md new file mode 100644 index 000000000..85f218872 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/update.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-php/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..377862391 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/upsert-row.md @@ -0,0 +1,30 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->upsertRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 33, + 'isAdmin' => false + ], // optional + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-php/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..56aa2657f --- /dev/null +++ b/examples/2.0.x/server-php/examples/tablesdb/upsert-rows.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->upsertRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/create-membership.md b/examples/2.0.x/server-php/examples/teams/create-membership.md new file mode 100644 index 000000000..4c09dc7ec --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/create-membership.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->createMembership( + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/create.md b/examples/2.0.x/server-php/examples/teams/create.md new file mode 100644 index 000000000..c4112e997 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/create.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->create( + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/delete-membership.md b/examples/2.0.x/server-php/examples/teams/delete-membership.md new file mode 100644 index 000000000..fd686ec26 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/delete-membership.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->deleteMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/delete.md b/examples/2.0.x/server-php/examples/teams/delete.md new file mode 100644 index 000000000..af3754d93 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->delete( + teamId: '<TEAM_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/get-membership.md b/examples/2.0.x/server-php/examples/teams/get-membership.md new file mode 100644 index 000000000..541897733 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/get-membership.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->getMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/get-prefs.md b/examples/2.0.x/server-php/examples/teams/get-prefs.md new file mode 100644 index 000000000..eb7022b3e --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/get-prefs.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->getPrefs( + teamId: '<TEAM_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/get.md b/examples/2.0.x/server-php/examples/teams/get.md new file mode 100644 index 000000000..4c4ed5894 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->get( + teamId: '<TEAM_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/list-memberships.md b/examples/2.0.x/server-php/examples/teams/list-memberships.md new file mode 100644 index 000000000..919911939 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/list-memberships.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->listMemberships( + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/list.md b/examples/2.0.x/server-php/examples/teams/list.md new file mode 100644 index 000000000..118339e26 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->list( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/update-membership-status.md b/examples/2.0.x/server-php/examples/teams/update-membership-status.md new file mode 100644 index 000000000..b83abc888 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/update-membership-status.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updateMembershipStatus( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>' +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/update-membership.md b/examples/2.0.x/server-php/examples/teams/update-membership.md new file mode 100644 index 000000000..87741774b --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/update-membership.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updateMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [] +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/update-name.md b/examples/2.0.x/server-php/examples/teams/update-name.md new file mode 100644 index 000000000..21260a370 --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/update-name.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updateName( + teamId: '<TEAM_ID>', + name: '<NAME>' +); +``` diff --git a/examples/2.0.x/server-php/examples/teams/update-prefs.md b/examples/2.0.x/server-php/examples/teams/update-prefs.md new file mode 100644 index 000000000..c6a98331c --- /dev/null +++ b/examples/2.0.x/server-php/examples/teams/update-prefs.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updatePrefs( + teamId: '<TEAM_ID>', + prefs: [] +); +``` diff --git a/examples/2.0.x/server-php/examples/tokens/create-file-token.md b/examples/2.0.x/server-php/examples/tokens/create-file-token.md new file mode 100644 index 000000000..c700c5682 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tokens/create-file-token.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->createFileToken( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '2020-10-15T06:38:00.000+00:00' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tokens/delete.md b/examples/2.0.x/server-php/examples/tokens/delete.md new file mode 100644 index 000000000..2c4aea6f7 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tokens/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->delete( + tokenId: '<TOKEN_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tokens/get.md b/examples/2.0.x/server-php/examples/tokens/get.md new file mode 100644 index 000000000..37911e259 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tokens/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->get( + tokenId: '<TOKEN_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/tokens/list.md b/examples/2.0.x/server-php/examples/tokens/list.md new file mode 100644 index 000000000..724d44ed0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/tokens/list.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->list( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/tokens/update.md b/examples/2.0.x/server-php/examples/tokens/update.md new file mode 100644 index 000000000..9944a9ceb --- /dev/null +++ b/examples/2.0.x/server-php/examples/tokens/update.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->update( + tokenId: '<TOKEN_ID>', + expire: '2020-10-15T06:38:00.000+00:00' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-argon-2-user.md b/examples/2.0.x/server-php/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..34018bc69 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-argon-2-user.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createArgon2User( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-php/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..c8badcaff --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-bcrypt-user.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createBcryptUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-jwt.md b/examples/2.0.x/server-php/examples/users/create-jwt.md new file mode 100644 index 000000000..89870a354 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-jwt.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createJWT( + userId: '<USER_ID>', + sessionId: 'recent()', // optional + duration: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-md-5-user.md b/examples/2.0.x/server-php/examples/users/create-md-5-user.md new file mode 100644 index 000000000..304783358 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-md-5-user.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createMD5User( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-php/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..d58681a41 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createMFARecoveryCodes( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-php/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..c9426373c --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-ph-pass-user.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createPHPassUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-php/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..bd3077e7f --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createScryptModifiedUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-scrypt-user.md b/examples/2.0.x/server-php/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..d8be12e22 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-scrypt-user.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createScryptUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-session.md b/examples/2.0.x/server-php/examples/users/create-session.md new file mode 100644 index 000000000..625cd8492 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-session.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createSession( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-sha-user.md b/examples/2.0.x/server-php/examples/users/create-sha-user.md new file mode 100644 index 000000000..94a674cbf --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-sha-user.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; +use Appwrite\Enums\PasswordHash; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createSHAUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: PasswordHash::SHA1(), // optional + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-target.md b/examples/2.0.x/server-php/examples/users/create-target.md new file mode 100644 index 000000000..e9d83ebb6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-target.md @@ -0,0 +1,23 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; +use Appwrite\Enums\MessagingProviderType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: MessagingProviderType::EMAIL(), + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create-token.md b/examples/2.0.x/server-php/examples/users/create-token.md new file mode 100644 index 000000000..b346dd530 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create-token.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createToken( + userId: '<USER_ID>', + length: 4, // optional + expire: 60 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/create.md b/examples/2.0.x/server-php/examples/users/create.md new file mode 100644 index 000000000..0409e50fa --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/create.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->create( + userId: '<USER_ID>', + email: 'email@example.com', // optional + phone: '+12065550100', // optional + password: 'password', // optional + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/delete-identity.md b/examples/2.0.x/server-php/examples/users/delete-identity.md new file mode 100644 index 000000000..9a812db68 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/delete-identity.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteIdentity( + identityId: '<IDENTITY_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-php/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..8fa62661e --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; +use Appwrite\Enums\AuthenticatorType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteMFAAuthenticator( + userId: '<USER_ID>', + type: AuthenticatorType::TOTP() +); +``` diff --git a/examples/2.0.x/server-php/examples/users/delete-session.md b/examples/2.0.x/server-php/examples/users/delete-session.md new file mode 100644 index 000000000..3279befec --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/delete-session.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteSession( + userId: '<USER_ID>', + sessionId: '<SESSION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/delete-sessions.md b/examples/2.0.x/server-php/examples/users/delete-sessions.md new file mode 100644 index 000000000..df58398a3 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/delete-sessions.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteSessions( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/delete-target.md b/examples/2.0.x/server-php/examples/users/delete-target.md new file mode 100644 index 000000000..ed23c1772 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/delete-target.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/delete.md b/examples/2.0.x/server-php/examples/users/delete.md new file mode 100644 index 000000000..dd79743b2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->delete( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-php/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..4f6202dfc --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/get-mfa-challenge.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->getMFAChallenge( + userId: '<USER_ID>', + challengeId: '<CHALLENGE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-php/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..3978e1a8e --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->getMFARecoveryCodes( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/get-prefs.md b/examples/2.0.x/server-php/examples/users/get-prefs.md new file mode 100644 index 000000000..72ebd61a6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/get-prefs.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->getPrefs( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/get-target.md b/examples/2.0.x/server-php/examples/users/get-target.md new file mode 100644 index 000000000..8f86c11c1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/get-target.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->getTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/get.md b/examples/2.0.x/server-php/examples/users/get.md new file mode 100644 index 000000000..f974d7c0c --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->get( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/list-identities.md b/examples/2.0.x/server-php/examples/users/list-identities.md new file mode 100644 index 000000000..38b1be775 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/list-identities.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listIdentities( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/list-memberships.md b/examples/2.0.x/server-php/examples/users/list-memberships.md new file mode 100644 index 000000000..b198103ba --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/list-memberships.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listMemberships( + userId: '<USER_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/list-mfa-factors.md b/examples/2.0.x/server-php/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..ace853e69 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/list-mfa-factors.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listMFAFactors( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/list-sessions.md b/examples/2.0.x/server-php/examples/users/list-sessions.md new file mode 100644 index 000000000..12c5cbe04 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/list-sessions.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listSessions( + userId: '<USER_ID>', + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/list-targets.md b/examples/2.0.x/server-php/examples/users/list-targets.md new file mode 100644 index 000000000..468ac2e25 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/list-targets.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listTargets( + userId: '<USER_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/list.md b/examples/2.0.x/server-php/examples/users/list.md new file mode 100644 index 000000000..87b03f3cd --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->list( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-email-verification.md b/examples/2.0.x/server-php/examples/users/update-email-verification.md new file mode 100644 index 000000000..b188568a5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-email-verification.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateEmailVerification( + userId: '<USER_ID>', + emailVerification: false +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-email.md b/examples/2.0.x/server-php/examples/users/update-email.md new file mode 100644 index 000000000..d30f7d117 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-email.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateEmail( + userId: '<USER_ID>', + email: 'email@example.com' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-impersonator.md b/examples/2.0.x/server-php/examples/users/update-impersonator.md new file mode 100644 index 000000000..b1e9e99fe --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-impersonator.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateImpersonator( + userId: '<USER_ID>', + impersonator: false +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-labels.md b/examples/2.0.x/server-php/examples/users/update-labels.md new file mode 100644 index 000000000..7ac457f58 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-labels.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateLabels( + userId: '<USER_ID>', + labels: [] +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-php/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..adee4c7c5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateMFARecoveryCodes( + userId: '<USER_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-mfa.md b/examples/2.0.x/server-php/examples/users/update-mfa.md new file mode 100644 index 000000000..6ff44fef8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-mfa.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateMFA( + userId: '<USER_ID>', + mfa: false +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-name.md b/examples/2.0.x/server-php/examples/users/update-name.md new file mode 100644 index 000000000..fd2740188 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-name.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateName( + userId: '<USER_ID>', + name: '<NAME>' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-password.md b/examples/2.0.x/server-php/examples/users/update-password.md new file mode 100644 index 000000000..512c67b6c --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-password.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updatePassword( + userId: '<USER_ID>', + password: 'password' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-phone-verification.md b/examples/2.0.x/server-php/examples/users/update-phone-verification.md new file mode 100644 index 000000000..0cfb243d1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-phone-verification.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updatePhoneVerification( + userId: '<USER_ID>', + phoneVerification: false +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-phone.md b/examples/2.0.x/server-php/examples/users/update-phone.md new file mode 100644 index 000000000..b07c4bd81 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-phone.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updatePhone( + userId: '<USER_ID>', + number: '+12065550100' +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-prefs.md b/examples/2.0.x/server-php/examples/users/update-prefs.md new file mode 100644 index 000000000..450f7a4b2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-prefs.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updatePrefs( + userId: '<USER_ID>', + prefs: [] +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-status.md b/examples/2.0.x/server-php/examples/users/update-status.md new file mode 100644 index 000000000..b9e003d95 --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-status.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateStatus( + userId: '<USER_ID>', + status: false +); +``` diff --git a/examples/2.0.x/server-php/examples/users/update-target.md b/examples/2.0.x/server-php/examples/users/update-target.md new file mode 100644 index 000000000..c4efc592c --- /dev/null +++ b/examples/2.0.x/server-php/examples/users/update-target.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // optional + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-php/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..c3ed66282 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/create-collection.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->createCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, + permissions: [Permission::read(Role::any())], // optional + documentSecurity: false, // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/create-document.md b/examples/2.0.x/server-php/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..b97f81e4c --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/create-document.md @@ -0,0 +1,34 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [ + 'embeddings' => [ + '0' => 0.12, + '1' => -0.55, + '2' => 0.88, + '3' => 1.02 + ], + 'metadata' => [ + 'key' => 'value' + ] + ], + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-php/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..2d1c9c2f8 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/create-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->createDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/create-index.md b/examples/2.0.x/server-php/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..d3e699cbd --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/create-index.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; +use Appwrite\Enums\VectorsDBIndexType; +use Appwrite\Enums\OrderBy; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->createIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>', + type: VectorsDBIndexType::HNSWEUCLIDEAN(), + attributes: [], + orders: [OrderBy::ASC()], // optional + lengths: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-php/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..c311d5e41 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/create-operations.md @@ -0,0 +1,28 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->createOperations( + transactionId: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/create-query.md b/examples/2.0.x/server-php/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..baa9655c2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/create-query.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->createQuery( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-php/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..e8fd72e77 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/create-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->createTransaction( + ttl: 60 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/create.md b/examples/2.0.x/server-php/examples/vectorsdb/create.md new file mode 100644 index 000000000..fc0abd4b5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/create.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-php/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..f92fc345a --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/delete-collection.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->deleteCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-php/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..7d4968110 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/delete-document.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-php/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..17b0831d0 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/delete-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->deleteDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-php/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..e5693e415 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/delete-index.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->deleteIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-php/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..c3dee45b5 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->deleteTransaction( + transactionId: '<TRANSACTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/delete.md b/examples/2.0.x/server-php/examples/vectorsdb/delete.md new file mode 100644 index 000000000..2fed51fe2 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->delete( + databaseId: '<DATABASE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-php/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..1d5f2adda --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/get-collection.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->getCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/get-document.md b/examples/2.0.x/server-php/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..d3d4e5ecd --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/get-document.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/get-index.md b/examples/2.0.x/server-php/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..1fd9bf9ad --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/get-index.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->getIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<KEY>' +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-php/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..c6db89273 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/get-transaction.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->getTransaction( + transactionId: '<TRANSACTION_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/get.md b/examples/2.0.x/server-php/examples/vectorsdb/get.md new file mode 100644 index 000000000..7d61d872e --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->get( + databaseId: '<DATABASE_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-php/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..7275e094f --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/list-collections.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->listCollections( + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-php/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..d90096182 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/list-documents.md @@ -0,0 +1,22 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0 // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-php/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..e49f04530 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/list-indexes.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->listIndexes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-php/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..022bd60e1 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/list-transactions.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->listTransactions( + queries: [] // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/list.md b/examples/2.0.x/server-php/examples/vectorsdb/list.md new file mode 100644 index 000000000..7f9414cf6 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/list.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->list( + queries: [], // optional + search: '<SEARCH>', // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-php/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..7898ee038 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/update-collection.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->updateCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, // optional + permissions: [Permission::read(Role::any())], // optional + documentSecurity: false, // optional + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/update-document.md b/examples/2.0.x/server-php/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..e6ac13cab --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/update-document.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [], // optional + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-php/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..96ec4c37a --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/update-documents.md @@ -0,0 +1,21 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->updateDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: [], // optional + queries: [], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-php/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..448120904 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/update-transaction.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->updateTransaction( + transactionId: '<TRANSACTION_ID>', + commit: false, // optional + rollback: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/update.md b/examples/2.0.x/server-php/examples/vectorsdb/update.md new file mode 100644 index 000000000..fcdfc6429 --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/update.md @@ -0,0 +1,19 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-php/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..b7acca16d --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/upsert-document.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; +use Appwrite\Permission; +use Appwrite\Role; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [], // optional + permissions: [Permission::read(Role::any())], // optional + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-php/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..11e5d31fd --- /dev/null +++ b/examples/2.0.x/server-php/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,20 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\VectorsDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$vectorsDB = new VectorsDB($client); + +$result = $vectorsDB->upsertDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], + transactionId: '<TRANSACTION_ID>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/webhooks/create.md b/examples/2.0.x/server-php/examples/webhooks/create.md new file mode 100644 index 000000000..2b437a54b --- /dev/null +++ b/examples/2.0.x/server-php/examples/webhooks/create.md @@ -0,0 +1,25 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Webhooks; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$webhooks = new Webhooks($client); + +$result = $webhooks->create( + webhookId: '<WEBHOOK_ID>', + url: 'https://example.com/webhook', + name: '<NAME>', + events: [], + enabled: false, // optional + tls: false, // optional + authUsername: '<AUTH_USERNAME>', // optional + authPassword: 'password', // optional + secret: '<SECRET>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/webhooks/delete.md b/examples/2.0.x/server-php/examples/webhooks/delete.md new file mode 100644 index 000000000..c96a1d5fc --- /dev/null +++ b/examples/2.0.x/server-php/examples/webhooks/delete.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Webhooks; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$webhooks = new Webhooks($client); + +$result = $webhooks->delete( + webhookId: '<WEBHOOK_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/webhooks/get.md b/examples/2.0.x/server-php/examples/webhooks/get.md new file mode 100644 index 000000000..85e95776b --- /dev/null +++ b/examples/2.0.x/server-php/examples/webhooks/get.md @@ -0,0 +1,17 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Webhooks; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$webhooks = new Webhooks($client); + +$result = $webhooks->get( + webhookId: '<WEBHOOK_ID>' +); +``` diff --git a/examples/2.0.x/server-php/examples/webhooks/list.md b/examples/2.0.x/server-php/examples/webhooks/list.md new file mode 100644 index 000000000..e0652d51b --- /dev/null +++ b/examples/2.0.x/server-php/examples/webhooks/list.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Webhooks; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$webhooks = new Webhooks($client); + +$result = $webhooks->list( + queries: [], // optional + total: false // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/webhooks/update-secret.md b/examples/2.0.x/server-php/examples/webhooks/update-secret.md new file mode 100644 index 000000000..6a8168d5d --- /dev/null +++ b/examples/2.0.x/server-php/examples/webhooks/update-secret.md @@ -0,0 +1,18 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Webhooks; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$webhooks = new Webhooks($client); + +$result = $webhooks->updateSecret( + webhookId: '<WEBHOOK_ID>', + secret: '<SECRET>' // optional +); +``` diff --git a/examples/2.0.x/server-php/examples/webhooks/update.md b/examples/2.0.x/server-php/examples/webhooks/update.md new file mode 100644 index 000000000..95dafcf0f --- /dev/null +++ b/examples/2.0.x/server-php/examples/webhooks/update.md @@ -0,0 +1,24 @@ +```php +<?php + +use Appwrite\Client; +use Appwrite\Services\Webhooks; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$webhooks = new Webhooks($client); + +$result = $webhooks->update( + webhookId: '<WEBHOOK_ID>', + name: '<NAME>', + url: 'https://example.com/webhook', + events: [], + enabled: false, // optional + tls: false, // optional + authUsername: '<AUTH_USERNAME>', // optional + authPassword: 'password' // optional +); +``` diff --git a/examples/2.0.x/server-python/examples/account/create-anonymous-session.md b/examples/2.0.x/server-python/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..70a7dd343 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-anonymous-session.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Session = account.create_anonymous_session() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-email-password-session.md b/examples/2.0.x/server-python/examples/account/create-email-password-session.md new file mode 100644 index 000000000..292074dba --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-email-password-session.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Session = account.create_email_password_session( + email = 'email@example.com', + password = 'password' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-email-token.md b/examples/2.0.x/server-python/examples/account/create-email-token.md new file mode 100644 index 000000000..78c5ecaab --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-email-token.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.create_email_token( + user_id = '<USER_ID>', + email = 'email@example.com', + phrase = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-email-verification.md b/examples/2.0.x/server-python/examples/account/create-email-verification.md new file mode 100644 index 000000000..d4d8fd866 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-email-verification.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.create_email_verification( + url = 'https://example.com' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-magic-url-token.md b/examples/2.0.x/server-python/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..5ded01281 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-magic-url-token.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.create_magic_url_token( + user_id = '<USER_ID>', + email = 'email@example.com', + url = 'https://example.com', # optional + phrase = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-python/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..468011b2e --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-mfa-authenticator.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import MfaType +from appwrite.enums import AuthenticatorType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: MfaType = account.create_mfa_authenticator( + type = AuthenticatorType.TOTP +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-python/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..f31797a45 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-mfa-challenge.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import MfaChallenge +from appwrite.enums import AuthenticationFactor + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: MfaChallenge = account.create_mfa_challenge( + factor = AuthenticationFactor.EMAIL +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-python/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..b7a2c4dd5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import MfaRecoveryCodes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: MfaRecoveryCodes = account.create_mfa_recovery_codes() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-python/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..87f7de0f4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-o-auth-2-token.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.enums import OAuthProvider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: str = account.create_o_auth2_token( + provider = OAuthProvider.AMAZON, + success = 'https://example.com', # optional + failure = 'https://example.com', # optional + scopes = [] # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-phone-token.md b/examples/2.0.x/server-python/examples/account/create-phone-token.md new file mode 100644 index 000000000..fb09d64ec --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-phone-token.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.create_phone_token( + user_id = '<USER_ID>', + phone = '+12065550100' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-phone-verification.md b/examples/2.0.x/server-python/examples/account/create-phone-verification.md new file mode 100644 index 000000000..35d058e2b --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-phone-verification.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.create_phone_verification() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-recovery.md b/examples/2.0.x/server-python/examples/account/create-recovery.md new file mode 100644 index 000000000..ea63672fe --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-recovery.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.create_recovery( + email = 'email@example.com', + url = 'https://example.com' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-session.md b/examples/2.0.x/server-python/examples/account/create-session.md new file mode 100644 index 000000000..b09cf7224 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-session.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Session = account.create_session( + user_id = '<USER_ID>', + secret = '<SECRET>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create-verification.md b/examples/2.0.x/server-python/examples/account/create-verification.md new file mode 100644 index 000000000..c44a76936 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create-verification.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.create_verification( + url = 'https://example.com' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/create.md b/examples/2.0.x/server-python/examples/account/create.md new file mode 100644 index 000000000..503b37016 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/create.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.create( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/delete-identity.md b/examples/2.0.x/server-python/examples/account/delete-identity.md new file mode 100644 index 000000000..1ba48c203 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/delete-identity.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.delete_identity( + identity_id = '<IDENTITY_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-python/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..faeccb8b2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.enums import AuthenticatorType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.delete_mfa_authenticator( + type = AuthenticatorType.TOTP +) +``` diff --git a/examples/2.0.x/server-python/examples/account/delete-session.md b/examples/2.0.x/server-python/examples/account/delete-session.md new file mode 100644 index 000000000..051a38a57 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/delete-session.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.delete_session( + session_id = '<SESSION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/account/delete-sessions.md b/examples/2.0.x/server-python/examples/account/delete-sessions.md new file mode 100644 index 000000000..4db5c1ec6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/delete-sessions.md @@ -0,0 +1,13 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.delete_sessions() +``` diff --git a/examples/2.0.x/server-python/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-python/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..f236eb6ba --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import MfaRecoveryCodes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: MfaRecoveryCodes = account.get_mfa_recovery_codes() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/get-prefs.md b/examples/2.0.x/server-python/examples/account/get-prefs.md new file mode 100644 index 000000000..db5861525 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/get-prefs.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Preferences + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Preferences = account.get_prefs() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/get-session.md b/examples/2.0.x/server-python/examples/account/get-session.md new file mode 100644 index 000000000..9a247b2ae --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/get-session.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Session = account.get_session( + session_id = '<SESSION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/get.md b/examples/2.0.x/server-python/examples/account/get.md new file mode 100644 index 000000000..c06fd6ba0 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/get.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.get() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/list-identities.md b/examples/2.0.x/server-python/examples/account/list-identities.md new file mode 100644 index 000000000..5b8496de0 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/list-identities.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import IdentityList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: IdentityList = account.list_identities( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/list-mfa-factors.md b/examples/2.0.x/server-python/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..411a3e9a1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/list-mfa-factors.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import MfaFactors + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: MfaFactors = account.list_mfa_factors() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/list-sessions.md b/examples/2.0.x/server-python/examples/account/list-sessions.md new file mode 100644 index 000000000..d9df7a714 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/list-sessions.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import SessionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: SessionList = account.list_sessions() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-email-verification.md b/examples/2.0.x/server-python/examples/account/update-email-verification.md new file mode 100644 index 000000000..5415f7d92 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-email-verification.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.update_email_verification( + user_id = '<USER_ID>', + secret = '<SECRET>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-email.md b/examples/2.0.x/server-python/examples/account/update-email.md new file mode 100644 index 000000000..d559e026c --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-email.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.update_email( + email = 'email@example.com', + password = 'password' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-magic-url-session.md b/examples/2.0.x/server-python/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..754bbcdff --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-magic-url-session.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Session = account.update_magic_url_session( + user_id = '<USER_ID>', + secret = '<SECRET>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-python/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..e7040b0a2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-mfa-authenticator.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User +from appwrite.enums import AuthenticatorType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.update_mfa_authenticator( + type = AuthenticatorType.TOTP, + otp = '<OTP>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-python/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..40d6382f2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-mfa-challenge.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Session = account.update_mfa_challenge( + challenge_id = '<CHALLENGE_ID>', + otp = '<OTP>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-python/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..38ff568d9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import MfaRecoveryCodes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: MfaRecoveryCodes = account.update_mfa_recovery_codes() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-mfa.md b/examples/2.0.x/server-python/examples/account/update-mfa.md new file mode 100644 index 000000000..607cea791 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-mfa.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.update_mfa( + mfa = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-name.md b/examples/2.0.x/server-python/examples/account/update-name.md new file mode 100644 index 000000000..d16c8dd01 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-name.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.update_name( + name = '<NAME>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-password.md b/examples/2.0.x/server-python/examples/account/update-password.md new file mode 100644 index 000000000..2c6db58bc --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-password.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.update_password( + password = 'password', + old_password = 'password' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-phone-session.md b/examples/2.0.x/server-python/examples/account/update-phone-session.md new file mode 100644 index 000000000..300cadd8f --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-phone-session.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Session = account.update_phone_session( + user_id = '<USER_ID>', + secret = '<SECRET>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-phone-verification.md b/examples/2.0.x/server-python/examples/account/update-phone-verification.md new file mode 100644 index 000000000..9091264d3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-phone-verification.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.update_phone_verification( + user_id = '<USER_ID>', + secret = '<SECRET>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-phone.md b/examples/2.0.x/server-python/examples/account/update-phone.md new file mode 100644 index 000000000..6dcd811e3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-phone.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.update_phone( + phone = '+12065550100', + password = 'password' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-prefs.md b/examples/2.0.x/server-python/examples/account/update-prefs.md new file mode 100644 index 000000000..1c6a0a518 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-prefs.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.update_prefs( + prefs = { + "language": "en", + "timezone": "UTC", + "darkTheme": True + } +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-recovery.md b/examples/2.0.x/server-python/examples/account/update-recovery.md new file mode 100644 index 000000000..3201722e7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-recovery.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.update_recovery( + user_id = '<USER_ID>', + secret = '<SECRET>', + password = 'password' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-session.md b/examples/2.0.x/server-python/examples/account/update-session.md new file mode 100644 index 000000000..6232e0b38 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-session.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Session = account.update_session( + session_id = '<SESSION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-status.md b/examples/2.0.x/server-python/examples/account/update-status.md new file mode 100644 index 000000000..d48014532 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-status.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: User = account.update_status() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/account/update-verification.md b/examples/2.0.x/server-python/examples/account/update-verification.md new file mode 100644 index 000000000..5dffe6ad4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/account/update-verification.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result: Token = account.update_verification( + user_id = '<USER_ID>', + secret = '<SECRET>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/advisor/delete-report.md b/examples/2.0.x/server-python/examples/advisor/delete-report.md new file mode 100644 index 000000000..ef50a2f0d --- /dev/null +++ b/examples/2.0.x/server-python/examples/advisor/delete-report.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.advisor import Advisor + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor(client) + +result = advisor.delete_report( + report_id = '<REPORT_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/advisor/get-insight.md b/examples/2.0.x/server-python/examples/advisor/get-insight.md new file mode 100644 index 000000000..7f4b804ad --- /dev/null +++ b/examples/2.0.x/server-python/examples/advisor/get-insight.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.advisor import Advisor +from appwrite.models import Insight + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor(client) + +result: Insight = advisor.get_insight( + report_id = '<REPORT_ID>', + insight_id = '<INSIGHT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/advisor/get-report.md b/examples/2.0.x/server-python/examples/advisor/get-report.md new file mode 100644 index 000000000..2d9836ac4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/advisor/get-report.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.advisor import Advisor +from appwrite.models import Report + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor(client) + +result: Report = advisor.get_report( + report_id = '<REPORT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/advisor/list-insights.md b/examples/2.0.x/server-python/examples/advisor/list-insights.md new file mode 100644 index 000000000..2813e6e3b --- /dev/null +++ b/examples/2.0.x/server-python/examples/advisor/list-insights.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.advisor import Advisor +from appwrite.models import InsightList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor(client) + +result: InsightList = advisor.list_insights( + report_id = '<REPORT_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/advisor/list-reports.md b/examples/2.0.x/server-python/examples/advisor/list-reports.md new file mode 100644 index 000000000..146bbf1c4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/advisor/list-reports.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.advisor import Advisor +from appwrite.models import ReportList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor(client) + +result: ReportList = advisor.list_reports( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-browser.md b/examples/2.0.x/server-python/examples/avatars/get-browser.md new file mode 100644 index 000000000..3c950dbb8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-browser.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars +from appwrite.enums import Browser + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_browser( + code = Browser.AVANT_BROWSER, + width = 0, # optional + height = 0, # optional + quality = -1 # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-credit-card.md b/examples/2.0.x/server-python/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..8ef04f635 --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-credit-card.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars +from appwrite.enums import CreditCard + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_credit_card( + code = CreditCard.AMERICAN_EXPRESS, + width = 0, # optional + height = 0, # optional + quality = -1 # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-favicon.md b/examples/2.0.x/server-python/examples/avatars/get-favicon.md new file mode 100644 index 000000000..dd234eafc --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-favicon.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_favicon( + url = 'https://example.com' +) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-flag.md b/examples/2.0.x/server-python/examples/avatars/get-flag.md new file mode 100644 index 000000000..f97b20dd8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-flag.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars +from appwrite.enums import Flag + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_flag( + code = Flag.AFGHANISTAN, + width = 0, # optional + height = 0, # optional + quality = -1 # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-image.md b/examples/2.0.x/server-python/examples/avatars/get-image.md new file mode 100644 index 000000000..9beea030e --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-image.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_image( + url = 'https://example.com', + width = 0, # optional + height = 0 # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-initials.md b/examples/2.0.x/server-python/examples/avatars/get-initials.md new file mode 100644 index 000000000..08788555e --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-initials.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_initials( + name = '<NAME>', # optional + width = 0, # optional + height = 0, # optional + background = 'FFFFFF' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-photo.md b/examples/2.0.x/server-python/examples/avatars/get-photo.md new file mode 100644 index 000000000..64cdf309e --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-photo.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_photo( + width = 0, # optional + height = 0, # optional + quality = 0, # optional + output = 'png', # optional + rating = 'g', # optional + user_id = 'current()', # optional + email_hash = '<EMAIL_HASH>', # optional + name = '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-qr.md b/examples/2.0.x/server-python/examples/avatars/get-qr.md new file mode 100644 index 000000000..a7968e75c --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-qr.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_qr( + text = '<TEXT>', + size = 1, # optional + margin = 0, # optional + download = False # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/avatars/get-screenshot.md b/examples/2.0.x/server-python/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..cf7f9a6b4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/avatars/get-screenshot.md @@ -0,0 +1,41 @@ +```python +from appwrite.client import Client +from appwrite.services.avatars import Avatars +from appwrite.enums import BrowserTheme +from appwrite.enums import Timezone +from appwrite.enums import BrowserPermission +from appwrite.enums import ImageFormat + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result: bytes = avatars.get_screenshot( + url = 'https://example.com', + headers = { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + }, # optional + viewport_width = 1920, # optional + viewport_height = 1080, # optional + scale = 2, # optional + theme = BrowserTheme.DARK, # optional + user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', # optional + fullpage = True, # optional + locale = 'en-US', # optional + timezone = Timezone.AFRICA_ABIDJAN, # optional + latitude = 37.7749, # optional + longitude = -122.4194, # optional + accuracy = 100, # optional + touch = True, # optional + permissions = [BrowserPermission.GEOLOCATION, BrowserPermission.NOTIFICATIONS], # optional + sleep = 3, # optional + width = 800, # optional + height = 600, # optional + quality = 85, # optional + output = ImageFormat.JPEG # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-python/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..e55ab28c5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-big-int-attribute.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeBigint + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeBigint = databases.create_big_int_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + min = 0, # optional + max = 1000000, # optional + default = 0, # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-python/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..7c66b3227 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-boolean-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeBoolean + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeBoolean = databases.create_boolean_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = False, # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-collection.md b/examples/2.0.x/server-python/examples/databases/create-collection.md new file mode 100644 index 000000000..7e9afa0f1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-collection.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Collection +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Collection = databases.create_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + name = '<NAME>', + permissions = [Permission.read(Role.any())], # optional + document_security = False, # optional + enabled = False, # optional + attributes = [], # optional + indexes = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-python/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..d6e5a4379 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-datetime-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeDatetime + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeDatetime = databases.create_datetime_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = '2020-10-15T06:38:00.000+00:00', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-document.md b/examples/2.0.x/server-python/examples/databases/create-document.md new file mode 100644 index 000000000..26b003443 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-document.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result: Document = databases.create_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": False + }, + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-documents.md b/examples/2.0.x/server-python/examples/databases/create-documents.md new file mode 100644 index 000000000..a1df96a90 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: DocumentList = databases.create_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [], + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-email-attribute.md b/examples/2.0.x/server-python/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..8330bb9aa --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-email-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeEmail + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeEmail = databases.create_email_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'email@example.com', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-python/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..4710819f7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-enum-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeEnum + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeEnum = databases.create_enum_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + elements = ["active", "inactive"], + required = False, + default = 'active', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-float-attribute.md b/examples/2.0.x/server-python/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..e7155081c --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-float-attribute.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeFloat + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeFloat = databases.create_float_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + min = 0, # optional + max = 100, # optional + default = 10.5, # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-index.md b/examples/2.0.x/server-python/examples/databases/create-index.md new file mode 100644 index 000000000..71c694f1f --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-index.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Index +from appwrite.enums import DatabasesIndexType +from appwrite.enums import OrderBy + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Index = databases.create_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + type = DatabasesIndexType.KEY, + attributes = [], + orders = [OrderBy.ASC], # optional + lengths = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-python/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..c46e22959 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-integer-attribute.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeInteger + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeInteger = databases.create_integer_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + min = 0, # optional + max = 100, # optional + default = 10, # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-python/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..34542fa9e --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-ip-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeIp + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeIp = databases.create_ip_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = '192.0.2.0', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-line-attribute.md b/examples/2.0.x/server-python/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..6745498ad --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-line-attribute.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeLine + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeLine = databases.create_line_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = [[1, 2], [3, 4], [5, 6]] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-python/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..70b0eb483 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-longtext-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeLongtext + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeLongtext = databases.create_longtext_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-python/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..cf3011acf --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeMediumtext + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeMediumtext = databases.create_mediumtext_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-operations.md b/examples/2.0.x/server-python/examples/databases/create-operations.md new file mode 100644 index 000000000..ce412c3b6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-operations.md @@ -0,0 +1,29 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Transaction = databases.create_operations( + transaction_id = '<TRANSACTION_ID>', + operations = [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-point-attribute.md b/examples/2.0.x/server-python/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..a3d12715a --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-point-attribute.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributePoint + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributePoint = databases.create_point_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = [1, 2] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-python/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..4e6145f5e --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-polygon-attribute.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributePolygon + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributePolygon = databases.create_polygon_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-python/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..81959496e --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-relationship-attribute.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeRelationship +from appwrite.enums import RelationshipType +from appwrite.enums import RelationMutate + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeRelationship = databases.create_relationship_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + related_collection_id = '<RELATED_COLLECTION_ID>', + type = RelationshipType.ONETOONE, + two_way = False, # optional + key = '<KEY>', # optional + two_way_key = '<TWO_WAY_KEY>', # optional + on_delete = RelationMutate.CASCADE # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-string-attribute.md b/examples/2.0.x/server-python/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..840892433 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-string-attribute.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeString + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeString = databases.create_string_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + size = 1, + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-text-attribute.md b/examples/2.0.x/server-python/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..195650ee8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-text-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeText + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeText = databases.create_text_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-transaction.md b/examples/2.0.x/server-python/examples/databases/create-transaction.md new file mode 100644 index 000000000..733b2cf3b --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-transaction.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Transaction = databases.create_transaction( + ttl = 60 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-url-attribute.md b/examples/2.0.x/server-python/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..2fdaadaca --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-url-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeUrl + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeUrl = databases.create_url_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'https://example.com', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-python/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..b0a322216 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create-varchar-attribute.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeVarchar + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeVarchar = databases.create_varchar_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + size = 1, + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/create.md b/examples/2.0.x/server-python/examples/databases/create.md new file mode 100644 index 000000000..68a5b3743 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/create.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Database = databases.create( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-python/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..15a42ec3a --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/decrement-document-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Document + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result: Document = databases.decrement_document_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + attribute = '<ATTRIBUTE>', + value = 1, # optional + min = 0, # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/delete-attribute.md b/examples/2.0.x/server-python/examples/databases/delete-attribute.md new file mode 100644 index 000000000..f3ba64766 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/delete-attribute.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>' +) +``` diff --git a/examples/2.0.x/server-python/examples/databases/delete-collection.md b/examples/2.0.x/server-python/examples/databases/delete-collection.md new file mode 100644 index 000000000..ff486c588 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/delete-collection.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/databases/delete-document.md b/examples/2.0.x/server-python/examples/databases/delete-document.md new file mode 100644 index 000000000..6a56cd2df --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/delete-document.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.delete_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + transaction_id = '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/databases/delete-documents.md b/examples/2.0.x/server-python/examples/databases/delete-documents.md new file mode 100644 index 000000000..d410bdefe --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/delete-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: DocumentList = databases.delete_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/delete-index.md b/examples/2.0.x/server-python/examples/databases/delete-index.md new file mode 100644 index 000000000..1e48fa8e2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/delete-index.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>' +) +``` diff --git a/examples/2.0.x/server-python/examples/databases/delete-transaction.md b/examples/2.0.x/server-python/examples/databases/delete-transaction.md new file mode 100644 index 000000000..bbc0d9757 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/delete-transaction.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete_transaction( + transaction_id = '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/databases/delete.md b/examples/2.0.x/server-python/examples/databases/delete.md new file mode 100644 index 000000000..4bf78037a --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete( + database_id = '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/databases/get-attribute.md b/examples/2.0.x/server-python/examples/databases/get-attribute.md new file mode 100644 index 000000000..880a58727 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/get-attribute.md @@ -0,0 +1,30 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeBoolean +from appwrite.models import AttributeInteger +from appwrite.models import AttributeFloat +from appwrite.models import AttributeEmail +from appwrite.models import AttributeEnum +from appwrite.models import AttributeUrl +from appwrite.models import AttributeIp +from appwrite.models import AttributeDatetime +from appwrite.models import AttributeRelationship +from appwrite.models import AttributeString +from typing import Union + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Union[AttributeBoolean, AttributeInteger, AttributeFloat, AttributeEmail, AttributeEnum, AttributeUrl, AttributeIp, AttributeDatetime, AttributeRelationship, AttributeString] = databases.get_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/get-collection.md b/examples/2.0.x/server-python/examples/databases/get-collection.md new file mode 100644 index 000000000..6650f4ae8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/get-collection.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Collection + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Collection = databases.get_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/get-document.md b/examples/2.0.x/server-python/examples/databases/get-document.md new file mode 100644 index 000000000..c6d968ac1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/get-document.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Document + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result: Document = databases.get_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/get-index.md b/examples/2.0.x/server-python/examples/databases/get-index.md new file mode 100644 index 000000000..4d327be10 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/get-index.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Index + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Index = databases.get_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/get-transaction.md b/examples/2.0.x/server-python/examples/databases/get-transaction.md new file mode 100644 index 000000000..3348baa83 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/get-transaction.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Transaction = databases.get_transaction( + transaction_id = '<TRANSACTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/get.md b/examples/2.0.x/server-python/examples/databases/get.md new file mode 100644 index 000000000..b2906c561 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Database = databases.get( + database_id = '<DATABASE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-python/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..77a96bd3f --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/increment-document-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Document + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result: Document = databases.increment_document_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + attribute = '<ATTRIBUTE>', + value = 1, # optional + max = 100, # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/list-attributes.md b/examples/2.0.x/server-python/examples/databases/list-attributes.md new file mode 100644 index 000000000..4fc25f41b --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/list-attributes.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeList = databases.list_attributes( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/list-collections.md b/examples/2.0.x/server-python/examples/databases/list-collections.md new file mode 100644 index 000000000..19e71456e --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/list-collections.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import CollectionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: CollectionList = databases.list_collections( + database_id = '<DATABASE_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/list-documents.md b/examples/2.0.x/server-python/examples/databases/list-documents.md new file mode 100644 index 000000000..f085c7d30 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/list-documents.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result: DocumentList = databases.list_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>', # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/list-indexes.md b/examples/2.0.x/server-python/examples/databases/list-indexes.md new file mode 100644 index 000000000..7129c5a55 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/list-indexes.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import IndexList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: IndexList = databases.list_indexes( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/list-transactions.md b/examples/2.0.x/server-python/examples/databases/list-transactions.md new file mode 100644 index 000000000..bd0993144 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/list-transactions.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import TransactionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: TransactionList = databases.list_transactions( + queries = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/list.md b/examples/2.0.x/server-python/examples/databases/list.md new file mode 100644 index 000000000..7fb1acd22 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import DatabaseList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: DatabaseList = databases.list( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-python/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..84ecb9425 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-big-int-attribute.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeBigint + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeBigint = databases.update_big_int_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 0, + min = 0, # optional + max = 1000000, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-python/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..26ac80236 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-boolean-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeBoolean + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeBoolean = databases.update_boolean_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = False, + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-collection.md b/examples/2.0.x/server-python/examples/databases/update-collection.md new file mode 100644 index 000000000..85d50789f --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-collection.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Collection +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Collection = databases.update_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + name = '<NAME>', # optional + permissions = [Permission.read(Role.any())], # optional + document_security = False, # optional + enabled = False, # optional + purge = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-python/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..cf80c1d73 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-datetime-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeDatetime + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeDatetime = databases.update_datetime_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = '2020-10-15T06:38:00.000+00:00', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-document.md b/examples/2.0.x/server-python/examples/databases/update-document.md new file mode 100644 index 000000000..667d9b6e3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-document.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result: Document = databases.update_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": False + }, # optional + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-documents.md b/examples/2.0.x/server-python/examples/databases/update-documents.md new file mode 100644 index 000000000..edae26a45 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-documents.md @@ -0,0 +1,28 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: DocumentList = databases.update_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": False + }, # optional + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-email-attribute.md b/examples/2.0.x/server-python/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..6a6b2d522 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-email-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeEmail + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeEmail = databases.update_email_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'email@example.com', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-python/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..822f712c2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-enum-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeEnum + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeEnum = databases.update_enum_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + elements = ["active", "inactive"], + required = False, + default = 'active', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-float-attribute.md b/examples/2.0.x/server-python/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..4497a4a5d --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-float-attribute.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeFloat + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeFloat = databases.update_float_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 10.5, + min = 0, # optional + max = 100, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-python/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..61fe8bccd --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-integer-attribute.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeInteger + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeInteger = databases.update_integer_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 10, + min = 0, # optional + max = 100, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-python/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..89945ee31 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-ip-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeIp + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeIp = databases.update_ip_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = '192.0.2.0', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-line-attribute.md b/examples/2.0.x/server-python/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..96d6b4e64 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-line-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeLine + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeLine = databases.update_line_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = [[1, 2], [3, 4], [5, 6]], # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-python/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..d039a6e0d --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-longtext-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeLongtext + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeLongtext = databases.update_longtext_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-python/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..dc960fc64 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeMediumtext + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeMediumtext = databases.update_mediumtext_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-point-attribute.md b/examples/2.0.x/server-python/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..bf6a94d83 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-point-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributePoint + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributePoint = databases.update_point_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = [1, 2], # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-python/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..2dd1194cb --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-polygon-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributePolygon + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributePolygon = databases.update_polygon_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-python/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..a507aca11 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-relationship-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeRelationship +from appwrite.enums import RelationMutate + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeRelationship = databases.update_relationship_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + on_delete = RelationMutate.CASCADE, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-string-attribute.md b/examples/2.0.x/server-python/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..bfe14df17 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-string-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeString + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeString = databases.update_string_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + size = 1, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-text-attribute.md b/examples/2.0.x/server-python/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..01f66d137 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-text-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeText + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeText = databases.update_text_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-transaction.md b/examples/2.0.x/server-python/examples/databases/update-transaction.md new file mode 100644 index 000000000..937a227e6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-transaction.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Transaction = databases.update_transaction( + transaction_id = '<TRANSACTION_ID>', + commit = False, # optional + rollback = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-url-attribute.md b/examples/2.0.x/server-python/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..9f05a4a4d --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-url-attribute.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeUrl + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeUrl = databases.update_url_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'https://example.com', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-python/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..b844a7128 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update-varchar-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import AttributeVarchar + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: AttributeVarchar = databases.update_varchar_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + size = 1, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/update.md b/examples/2.0.x/server-python/examples/databases/update.md new file mode 100644 index 000000000..73458d4f2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/update.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: Database = databases.update( + database_id = '<DATABASE_ID>', + name = '<NAME>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/upsert-document.md b/examples/2.0.x/server-python/examples/databases/upsert-document.md new file mode 100644 index 000000000..b18eb794d --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/upsert-document.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result: Document = databases.upsert_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": False + }, # optional + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/databases/upsert-documents.md b/examples/2.0.x/server-python/examples/databases/upsert-documents.md new file mode 100644 index 000000000..5039ccb0a --- /dev/null +++ b/examples/2.0.x/server-python/examples/databases/upsert-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result: DocumentList = databases.upsert_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [], + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/create-collection.md b/examples/2.0.x/server-python/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..b717460fc --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/create-collection.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Collection +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Collection = documents_db.create_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + name = '<NAME>', + permissions = [Permission.read(Role.any())], # optional + document_security = False, # optional + enabled = False, # optional + attributes = [], # optional + indexes = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/create-document.md b/examples/2.0.x/server-python/examples/documentsdb/create-document.md new file mode 100644 index 000000000..a6a3055f6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/create-document.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: Document = documents_db.create_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": False + }, + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/create-documents.md b/examples/2.0.x/server-python/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..2b15e560a --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/create-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: DocumentList = documents_db.create_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [], + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/create-index.md b/examples/2.0.x/server-python/examples/documentsdb/create-index.md new file mode 100644 index 000000000..34a36dc83 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/create-index.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Index +from appwrite.enums import DocumentsDBIndexType +from appwrite.enums import OrderBy + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Index = documents_db.create_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + type = DocumentsDBIndexType.KEY, + attributes = [], + orders = [OrderBy.ASC], # optional + lengths = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/create-operations.md b/examples/2.0.x/server-python/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..23128e81e --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/create-operations.md @@ -0,0 +1,29 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Transaction = documents_db.create_operations( + transaction_id = '<TRANSACTION_ID>', + operations = [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-python/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..d34b358e5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/create-transaction.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Transaction = documents_db.create_transaction( + ttl = 60 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/create.md b/examples/2.0.x/server-python/examples/documentsdb/create.md new file mode 100644 index 000000000..753759bee --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/create.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Database = documents_db.create( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-python/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..d6c753299 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Document + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: Document = documents_db.decrement_document_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + attribute = '<ATTRIBUTE>', + value = 1, # optional + min = 0, # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-python/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..1652ab2be --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/delete-collection.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result = documents_db.delete_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/delete-document.md b/examples/2.0.x/server-python/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..e588088e0 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result = documents_db.delete_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + transaction_id = '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-python/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..8bc343de9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/delete-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: DocumentList = documents_db.delete_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/delete-index.md b/examples/2.0.x/server-python/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..befd9fee0 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/delete-index.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result = documents_db.delete_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>' +) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-python/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..009bf807d --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result = documents_db.delete_transaction( + transaction_id = '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/delete.md b/examples/2.0.x/server-python/examples/documentsdb/delete.md new file mode 100644 index 000000000..648450918 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result = documents_db.delete( + database_id = '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/get-collection.md b/examples/2.0.x/server-python/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..5ec739b89 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/get-collection.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Collection + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Collection = documents_db.get_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/get-document.md b/examples/2.0.x/server-python/examples/documentsdb/get-document.md new file mode 100644 index 000000000..3f0006e7c --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/get-document.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Document + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: Document = documents_db.get_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/get-index.md b/examples/2.0.x/server-python/examples/documentsdb/get-index.md new file mode 100644 index 000000000..598873f07 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/get-index.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Index + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Index = documents_db.get_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-python/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..27d88ee76 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/get-transaction.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Transaction = documents_db.get_transaction( + transaction_id = '<TRANSACTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/get.md b/examples/2.0.x/server-python/examples/documentsdb/get.md new file mode 100644 index 000000000..fc2ffb9b1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Database = documents_db.get( + database_id = '<DATABASE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-python/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..08e618834 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Document + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: Document = documents_db.increment_document_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + attribute = '<ATTRIBUTE>', + value = 1, # optional + max = 100, # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/list-collections.md b/examples/2.0.x/server-python/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..0d72a3761 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/list-collections.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import CollectionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: CollectionList = documents_db.list_collections( + database_id = '<DATABASE_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/list-documents.md b/examples/2.0.x/server-python/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..c1b2a3607 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/list-documents.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: DocumentList = documents_db.list_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>', # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-python/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..26655d728 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/list-indexes.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import IndexList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: IndexList = documents_db.list_indexes( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-python/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..6dc7aae2f --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/list-transactions.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import TransactionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: TransactionList = documents_db.list_transactions( + queries = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/list.md b/examples/2.0.x/server-python/examples/documentsdb/list.md new file mode 100644 index 000000000..5fbe94848 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import DatabaseList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: DatabaseList = documents_db.list( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/update-collection.md b/examples/2.0.x/server-python/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..955fb28fa --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/update-collection.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Collection +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Collection = documents_db.update_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + name = '<NAME>', + permissions = [Permission.read(Role.any())], # optional + document_security = False, # optional + enabled = False, # optional + purge = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/update-document.md b/examples/2.0.x/server-python/examples/documentsdb/update-document.md new file mode 100644 index 000000000..cf0bfcc9d --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/update-document.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: Document = documents_db.update_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = {}, # optional + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/update-documents.md b/examples/2.0.x/server-python/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..2c183e55a --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/update-documents.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: DocumentList = documents_db.update_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + data = {}, # optional + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-python/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..fff946cba --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/update-transaction.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Transaction = documents_db.update_transaction( + transaction_id = '<TRANSACTION_ID>', + commit = False, # optional + rollback = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/update.md b/examples/2.0.x/server-python/examples/documentsdb/update.md new file mode 100644 index 000000000..1e0c0692f --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/update.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: Database = documents_db.update( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-python/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..07086f4a8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/upsert-document.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +documents_db = DocumentsDB(client) + +result: Document = documents_db.upsert_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = {}, # optional + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-python/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..d98b227c2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/documentsdb/upsert-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.documents_db import DocumentsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB(client) + +result: DocumentList = documents_db.upsert_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [], + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-python/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..49d3c258d --- /dev/null +++ b/examples/2.0.x/server-python/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.embeddings import Embeddings +from appwrite.models import EmbeddingList +from appwrite.enums import EmbeddingModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +embeddings = Embeddings(client) + +result: EmbeddingList = embeddings.create_text_embeddings( + texts = [], + model = EmbeddingModel.NOMIC_EMBED_TEXT # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/create-deployment.md b/examples/2.0.x/server-python/examples/functions/create-deployment.md new file mode 100644 index 000000000..ed197c329 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/create-deployment.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.input_file import InputFile +from appwrite.models import Deployment + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Deployment = functions.create_deployment( + function_id = '<FUNCTION_ID>', + code = InputFile.from_path('file.png'), + activate = False, + entrypoint = '<ENTRYPOINT>', # optional + commands = '<COMMANDS>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-python/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..68400cbeb --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Deployment + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Deployment = functions.create_duplicate_deployment( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>', + build_id = '<BUILD_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/create-execution.md b/examples/2.0.x/server-python/examples/functions/create-execution.md new file mode 100644 index 000000000..c88c00efd --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/create-execution.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Execution +from appwrite.enums import ExecutionMethod + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +functions = Functions(client) + +result: Execution = functions.create_execution( + function_id = '<FUNCTION_ID>', + body = '<BODY>', # optional + async = False, # optional + path = '<PATH>', # optional + method = ExecutionMethod.GET, # optional + headers = {}, # optional + scheduled_at = '<SCHEDULED_AT>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/create-template-deployment.md b/examples/2.0.x/server-python/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..19227be6f --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/create-template-deployment.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Deployment +from appwrite.enums import TemplateReferenceType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Deployment = functions.create_template_deployment( + function_id = '<FUNCTION_ID>', + repository = '<REPOSITORY>', + owner = '<OWNER>', + root_directory = '<ROOT_DIRECTORY>', + type = TemplateReferenceType.COMMIT, + reference = '<REFERENCE>', + activate = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/create-variable.md b/examples/2.0.x/server-python/examples/functions/create-variable.md new file mode 100644 index 000000000..da323f97d --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/create-variable.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Variable = functions.create_variable( + function_id = '<FUNCTION_ID>', + variable_id = '<VARIABLE_ID>', + key = '<KEY>', + value = '<VALUE>', + secret = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-python/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..be644a7c4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/create-vcs-deployment.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Deployment +from appwrite.enums import VCSReferenceType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Deployment = functions.create_vcs_deployment( + function_id = '<FUNCTION_ID>', + type = VCSReferenceType.BRANCH, + reference = '<REFERENCE>', + activate = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/create.md b/examples/2.0.x/server-python/examples/functions/create.md new file mode 100644 index 000000000..e35204852 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/create.md @@ -0,0 +1,41 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Function +from appwrite.enums import Runtime +from appwrite.enums import ProjectKeyScopes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Function = functions.create( + function_id = '<FUNCTION_ID>', + name = '<NAME>', + runtime = Runtime.NODE_14_5, + execute = ["any"], # optional + events = [], # optional + schedule = '0 0 * * *', # optional + timeout = 1, # optional + enabled = False, # optional + logging = False, # optional + entrypoint = '<ENTRYPOINT>', # optional + commands = '<COMMANDS>', # optional + scopes = [ProjectKeyScopes.PROJECT_READ], # optional + installation_id = '<INSTALLATION_ID>', # optional + provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch = '<PROVIDER_BRANCH>', # optional + provider_silent_mode = False, # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + provider_branches = [], # optional + provider_paths = [], # optional + build_specification = 's-1vcpu-512mb', # optional + runtime_specification = 's-1vcpu-512mb', # optional + deployment_retention = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/delete-deployment.md b/examples/2.0.x/server-python/examples/functions/delete-deployment.md new file mode 100644 index 000000000..72abfb744 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/delete-deployment.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete_deployment( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/functions/delete-execution.md b/examples/2.0.x/server-python/examples/functions/delete-execution.md new file mode 100644 index 000000000..634bfef72 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/delete-execution.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete_execution( + function_id = '<FUNCTION_ID>', + execution_id = '<EXECUTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/functions/delete-variable.md b/examples/2.0.x/server-python/examples/functions/delete-variable.md new file mode 100644 index 000000000..e93cd9c55 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/delete-variable.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete_variable( + function_id = '<FUNCTION_ID>', + variable_id = '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/functions/delete.md b/examples/2.0.x/server-python/examples/functions/delete.md new file mode 100644 index 000000000..ebd09f477 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete( + function_id = '<FUNCTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/functions/get-deployment-download.md b/examples/2.0.x/server-python/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..49df861b2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/get-deployment-download.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.enums import DeploymentDownloadType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: bytes = functions.get_deployment_download( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>', + type = DeploymentDownloadType.SOURCE, # optional + token = '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/functions/get-deployment.md b/examples/2.0.x/server-python/examples/functions/get-deployment.md new file mode 100644 index 000000000..d9f8ba2bf --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/get-deployment.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Deployment + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Deployment = functions.get_deployment( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/get-execution.md b/examples/2.0.x/server-python/examples/functions/get-execution.md new file mode 100644 index 000000000..47d4ce387 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/get-execution.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Execution + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +functions = Functions(client) + +result: Execution = functions.get_execution( + function_id = '<FUNCTION_ID>', + execution_id = '<EXECUTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/get-variable.md b/examples/2.0.x/server-python/examples/functions/get-variable.md new file mode 100644 index 000000000..7ba591ad6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/get-variable.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Variable = functions.get_variable( + function_id = '<FUNCTION_ID>', + variable_id = '<VARIABLE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/get.md b/examples/2.0.x/server-python/examples/functions/get.md new file mode 100644 index 000000000..a604e4d9c --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Function + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Function = functions.get( + function_id = '<FUNCTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/list-deployments.md b/examples/2.0.x/server-python/examples/functions/list-deployments.md new file mode 100644 index 000000000..097181653 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/list-deployments.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import DeploymentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: DeploymentList = functions.list_deployments( + function_id = '<FUNCTION_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/list-executions.md b/examples/2.0.x/server-python/examples/functions/list-executions.md new file mode 100644 index 000000000..907ec8597 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/list-executions.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import ExecutionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +functions = Functions(client) + +result: ExecutionList = functions.list_executions( + function_id = '<FUNCTION_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/list-runtimes.md b/examples/2.0.x/server-python/examples/functions/list-runtimes.md new file mode 100644 index 000000000..ee75c80e6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/list-runtimes.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import RuntimeList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: RuntimeList = functions.list_runtimes() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/list-specifications.md b/examples/2.0.x/server-python/examples/functions/list-specifications.md new file mode 100644 index 000000000..7cf529a93 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/list-specifications.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import SpecificationList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: SpecificationList = functions.list_specifications( + type = 'runtimes' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/list-variables.md b/examples/2.0.x/server-python/examples/functions/list-variables.md new file mode 100644 index 000000000..693334b7c --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/list-variables.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import VariableList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: VariableList = functions.list_variables( + function_id = '<FUNCTION_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/list.md b/examples/2.0.x/server-python/examples/functions/list.md new file mode 100644 index 000000000..6f1876966 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import FunctionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: FunctionList = functions.list( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/update-deployment-status.md b/examples/2.0.x/server-python/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..97a554935 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/update-deployment-status.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Deployment + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Deployment = functions.update_deployment_status( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/update-function-deployment.md b/examples/2.0.x/server-python/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..be39738ac --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/update-function-deployment.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Function + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Function = functions.update_function_deployment( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/update-variable.md b/examples/2.0.x/server-python/examples/functions/update-variable.md new file mode 100644 index 000000000..6aa2f98c1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/update-variable.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Variable = functions.update_variable( + function_id = '<FUNCTION_ID>', + variable_id = '<VARIABLE_ID>', + key = '<KEY>', # optional + value = '<VALUE>', # optional + secret = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/functions/update.md b/examples/2.0.x/server-python/examples/functions/update.md new file mode 100644 index 000000000..d7dd50df6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/functions/update.md @@ -0,0 +1,41 @@ +```python +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.models import Function +from appwrite.enums import Runtime +from appwrite.enums import ProjectKeyScopes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result: Function = functions.update( + function_id = '<FUNCTION_ID>', + name = '<NAME>', + runtime = Runtime.NODE_14_5, # optional + execute = ["any"], # optional + events = [], # optional + schedule = '0 0 * * *', # optional + timeout = 1, # optional + enabled = False, # optional + logging = False, # optional + entrypoint = '<ENTRYPOINT>', # optional + commands = '<COMMANDS>', # optional + scopes = [ProjectKeyScopes.PROJECT_READ], # optional + installation_id = '<INSTALLATION_ID>', # optional + provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch = '<PROVIDER_BRANCH>', # optional + provider_silent_mode = False, # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + provider_branches = [], # optional + provider_paths = [], # optional + build_specification = 's-1vcpu-512mb', # optional + runtime_specification = 's-1vcpu-512mb', # optional + deployment_retention = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/graphql/mutation.md b/examples/2.0.x/server-python/examples/graphql/mutation.md new file mode 100644 index 000000000..26ed1cbed --- /dev/null +++ b/examples/2.0.x/server-python/examples/graphql/mutation.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.graphql import Graphql + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +graphql = Graphql(client) + +result = graphql.mutation( + query = {} +) +``` diff --git a/examples/2.0.x/server-python/examples/graphql/query.md b/examples/2.0.x/server-python/examples/graphql/query.md new file mode 100644 index 000000000..94142f993 --- /dev/null +++ b/examples/2.0.x/server-python/examples/graphql/query.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.graphql import Graphql + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +graphql = Graphql(client) + +result = graphql.query( + query = {} +) +``` diff --git a/examples/2.0.x/server-python/examples/locale/get.md b/examples/2.0.x/server-python/examples/locale/get.md new file mode 100644 index 000000000..bef85fab8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/locale/get.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.locale import Locale +from appwrite.models import Locale as LocaleModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result: LocaleModel = locale.get() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/locale/list-codes.md b/examples/2.0.x/server-python/examples/locale/list-codes.md new file mode 100644 index 000000000..adc293961 --- /dev/null +++ b/examples/2.0.x/server-python/examples/locale/list-codes.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.locale import Locale +from appwrite.models import LocaleCodeList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result: LocaleCodeList = locale.list_codes() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/locale/list-continents.md b/examples/2.0.x/server-python/examples/locale/list-continents.md new file mode 100644 index 000000000..fcf05e6ef --- /dev/null +++ b/examples/2.0.x/server-python/examples/locale/list-continents.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.locale import Locale +from appwrite.models import ContinentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result: ContinentList = locale.list_continents() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/locale/list-countries-eu.md b/examples/2.0.x/server-python/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..374cc9a37 --- /dev/null +++ b/examples/2.0.x/server-python/examples/locale/list-countries-eu.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.locale import Locale +from appwrite.models import CountryList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result: CountryList = locale.list_countries_eu() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/locale/list-countries-phones.md b/examples/2.0.x/server-python/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..8b36a1f91 --- /dev/null +++ b/examples/2.0.x/server-python/examples/locale/list-countries-phones.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.locale import Locale +from appwrite.models import PhoneList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result: PhoneList = locale.list_countries_phones() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/locale/list-countries.md b/examples/2.0.x/server-python/examples/locale/list-countries.md new file mode 100644 index 000000000..5c45a7668 --- /dev/null +++ b/examples/2.0.x/server-python/examples/locale/list-countries.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.locale import Locale +from appwrite.models import CountryList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result: CountryList = locale.list_countries() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/locale/list-currencies.md b/examples/2.0.x/server-python/examples/locale/list-currencies.md new file mode 100644 index 000000000..07f061c96 --- /dev/null +++ b/examples/2.0.x/server-python/examples/locale/list-currencies.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.locale import Locale +from appwrite.models import CurrencyList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result: CurrencyList = locale.list_currencies() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/locale/list-languages.md b/examples/2.0.x/server-python/examples/locale/list-languages.md new file mode 100644 index 000000000..3fb0c82cf --- /dev/null +++ b/examples/2.0.x/server-python/examples/locale/list-languages.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.locale import Locale +from appwrite.models import LanguageList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result: LanguageList = locale.list_languages() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-python/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..52d144d62 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-apns-provider.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_apns_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + auth_key = '<AUTH_KEY>', # optional + auth_key_id = '<AUTH_KEY_ID>', # optional + team_id = '<TEAM_ID>', # optional + bundle_id = '<BUNDLE_ID>', # optional + sandbox = False, # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-email.md b/examples/2.0.x/server-python/examples/messaging/create-email.md new file mode 100644 index 000000000..a6454e493 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-email.md @@ -0,0 +1,29 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Message + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Message = messaging.create_email( + message_id = '<MESSAGE_ID>', + subject = '<SUBJECT>', + content = '<CONTENT>', + topics = [], # optional + users = [], # optional + targets = [], # optional + cc = [], # optional + bcc = [], # optional + attachments = [], # optional + draft = False, # optional + html = False, # optional + scheduled_at = '2020-10-15T06:38:00.000+00:00' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-python/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..b4dc9b2f2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-fcm-provider.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_fcm_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + service_account_json = {}, # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-python/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..89ecea103 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_mailgun_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + api_key = '<API_KEY>', # optional + domain = 'example.com', # optional + is_eu_region = False, # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-python/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..9bf577df7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_msg91_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + template_id = '<TEMPLATE_ID>', # optional + sender_id = '<SENDER_ID>', # optional + auth_key = '<AUTH_KEY>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-push.md b/examples/2.0.x/server-python/examples/messaging/create-push.md new file mode 100644 index 000000000..155128a02 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-push.md @@ -0,0 +1,37 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Message +from appwrite.enums import MessagePriority + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Message = messaging.create_push( + message_id = '<MESSAGE_ID>', + title = '<TITLE>', # optional + body = '<BODY>', # optional + topics = [], # optional + users = [], # optional + targets = [], # optional + data = {}, # optional + action = '<ACTION>', # optional + image = '<ID1:ID2>', # optional + icon = '<ICON>', # optional + sound = '<SOUND>', # optional + color = '<COLOR>', # optional + tag = '<TAG>', # optional + badge = 1, # optional + draft = False, # optional + scheduled_at = '2020-10-15T06:38:00.000+00:00', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-python/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..5a1205a41 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-resend-provider.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_resend_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + api_key = '<API_KEY>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-python/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..e9abd646a --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_sendgrid_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + api_key = '<API_KEY>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-python/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..369ffc71e --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-ses-provider.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_ses_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + access_key = '<ACCESS_KEY>', # optional + secret_key = '<SECRET_KEY>', # optional + region = '<REGION>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-sms.md b/examples/2.0.x/server-python/examples/messaging/create-sms.md new file mode 100644 index 000000000..7512a542d --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-sms.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Message + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Message = messaging.create_sms( + message_id = '<MESSAGE_ID>', + content = '<CONTENT>', + topics = [], # optional + users = [], # optional + targets = [], # optional + draft = False, # optional + scheduled_at = '2020-10-15T06:38:00.000+00:00' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-python/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..9681bc18e --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-smtp-provider.md @@ -0,0 +1,32 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider +from appwrite.enums import SmtpEncryption + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_smtp_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + host = '<HOST>', + port = 587, # optional + username = '<USERNAME>', # optional + password = 'password', # optional + encryption = SmtpEncryption.NONE, # optional + auto_tls = False, # optional + mailer = '<MAILER>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-subscriber.md b/examples/2.0.x/server-python/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..2c230b1ac --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-subscriber.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Subscriber + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token + +messaging = Messaging(client) + +result: Subscriber = messaging.create_subscriber( + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>', + target_id = '<TARGET_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-python/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..e4e105893 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-telesign-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_telesign_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + from = '+12065550100', # optional + customer_id = '<CUSTOMER_ID>', # optional + api_key = '<API_KEY>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-python/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..3b42e692b --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_textmagic_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + from = '+12065550100', # optional + username = '<USERNAME>', # optional + api_key = '<API_KEY>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-topic.md b/examples/2.0.x/server-python/examples/messaging/create-topic.md new file mode 100644 index 000000000..3a6547eb1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-topic.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Topic + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Topic = messaging.create_topic( + topic_id = '<TOPIC_ID>', + name = '<NAME>', + subscribe = ["any"] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-python/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..6a20087d7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-twilio-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_twilio_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + from = '+12065550100', # optional + account_sid = '<ACCOUNT_SID>', # optional + auth_token = '<AUTH_TOKEN>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-python/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..4afc224d3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/create-vonage-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.create_vonage_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + from = '+12065550100', # optional + api_key = '<API_KEY>', # optional + api_secret = '<API_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/delete-provider.md b/examples/2.0.x/server-python/examples/messaging/delete-provider.md new file mode 100644 index 000000000..887434c02 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/delete-provider.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.delete_provider( + provider_id = '<PROVIDER_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-python/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..32eec660b --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/delete-subscriber.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token + +messaging = Messaging(client) + +result = messaging.delete_subscriber( + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/delete-topic.md b/examples/2.0.x/server-python/examples/messaging/delete-topic.md new file mode 100644 index 000000000..f46587099 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/delete-topic.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.delete_topic( + topic_id = '<TOPIC_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/delete.md b/examples/2.0.x/server-python/examples/messaging/delete.md new file mode 100644 index 000000000..d3447ced9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.delete( + message_id = '<MESSAGE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/get-message.md b/examples/2.0.x/server-python/examples/messaging/get-message.md new file mode 100644 index 000000000..b93df097e --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/get-message.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Message + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Message = messaging.get_message( + message_id = '<MESSAGE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/get-provider.md b/examples/2.0.x/server-python/examples/messaging/get-provider.md new file mode 100644 index 000000000..77750af4b --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/get-provider.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.get_provider( + provider_id = '<PROVIDER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/get-subscriber.md b/examples/2.0.x/server-python/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..58b6dda21 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/get-subscriber.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Subscriber + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Subscriber = messaging.get_subscriber( + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/get-topic.md b/examples/2.0.x/server-python/examples/messaging/get-topic.md new file mode 100644 index 000000000..7c38c8012 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/get-topic.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Topic + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Topic = messaging.get_topic( + topic_id = '<TOPIC_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/list-messages.md b/examples/2.0.x/server-python/examples/messaging/list-messages.md new file mode 100644 index 000000000..cb833b251 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/list-messages.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import MessageList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: MessageList = messaging.list_messages( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/list-providers.md b/examples/2.0.x/server-python/examples/messaging/list-providers.md new file mode 100644 index 000000000..eae8eee0c --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/list-providers.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import ProviderList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: ProviderList = messaging.list_providers( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/list-subscribers.md b/examples/2.0.x/server-python/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..7502d00f1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/list-subscribers.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import SubscriberList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: SubscriberList = messaging.list_subscribers( + topic_id = '<TOPIC_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/list-targets.md b/examples/2.0.x/server-python/examples/messaging/list-targets.md new file mode 100644 index 000000000..6c753b2fb --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/list-targets.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import TargetList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: TargetList = messaging.list_targets( + message_id = '<MESSAGE_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/list-topics.md b/examples/2.0.x/server-python/examples/messaging/list-topics.md new file mode 100644 index 000000000..106deab05 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/list-topics.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import TopicList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: TopicList = messaging.list_topics( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-python/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..bdbfc06e4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-apns-provider.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_apns_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + auth_key = '<AUTH_KEY>', # optional + auth_key_id = '<AUTH_KEY_ID>', # optional + team_id = '<TEAM_ID>', # optional + bundle_id = '<BUNDLE_ID>', # optional + sandbox = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-email.md b/examples/2.0.x/server-python/examples/messaging/update-email.md new file mode 100644 index 000000000..94d2d4073 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-email.md @@ -0,0 +1,29 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Message + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Message = messaging.update_email( + message_id = '<MESSAGE_ID>', + topics = [], # optional + users = [], # optional + targets = [], # optional + subject = '<SUBJECT>', # optional + content = '<CONTENT>', # optional + draft = False, # optional + html = False, # optional + cc = [], # optional + bcc = [], # optional + scheduled_at = '2020-10-15T06:38:00.000+00:00', # optional + attachments = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-python/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..6270cb80d --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-fcm-provider.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_fcm_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + service_account_json = {} # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-python/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..82086c418 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_mailgun_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + api_key = '<API_KEY>', # optional + domain = 'example.com', # optional + is_eu_region = False, # optional + enabled = False, # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-python/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..d608d6315 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_msg91_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + template_id = '<TEMPLATE_ID>', # optional + sender_id = '<SENDER_ID>', # optional + auth_key = '<AUTH_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-push.md b/examples/2.0.x/server-python/examples/messaging/update-push.md new file mode 100644 index 000000000..0c592d6c1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-push.md @@ -0,0 +1,37 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Message +from appwrite.enums import MessagePriority + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Message = messaging.update_push( + message_id = '<MESSAGE_ID>', + topics = [], # optional + users = [], # optional + targets = [], # optional + title = '<TITLE>', # optional + body = '<BODY>', # optional + data = {}, # optional + action = '<ACTION>', # optional + image = '<ID1:ID2>', # optional + icon = '<ICON>', # optional + sound = '<SOUND>', # optional + color = '<COLOR>', # optional + tag = '<TAG>', # optional + badge = 1, # optional + draft = False, # optional + scheduled_at = '2020-10-15T06:38:00.000+00:00', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-python/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..1de7e46fd --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-resend-provider.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_resend_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + api_key = '<API_KEY>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-python/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..23bf7bad9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_sendgrid_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + api_key = '<API_KEY>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-python/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..ab77e2eb7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-ses-provider.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_ses_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + access_key = '<ACCESS_KEY>', # optional + secret_key = '<SECRET_KEY>', # optional + region = '<REGION>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-sms.md b/examples/2.0.x/server-python/examples/messaging/update-sms.md new file mode 100644 index 000000000..32698978b --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-sms.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Message + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Message = messaging.update_sms( + message_id = '<MESSAGE_ID>', + topics = [], # optional + users = [], # optional + targets = [], # optional + content = '<CONTENT>', # optional + draft = False, # optional + scheduled_at = '2020-10-15T06:38:00.000+00:00' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-python/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..23294e88b --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-smtp-provider.md @@ -0,0 +1,32 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider +from appwrite.enums import SmtpEncryption + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_smtp_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + host = '<HOST>', # optional + port = 1, # optional + username = '<USERNAME>', # optional + password = 'password', # optional + encryption = SmtpEncryption.NONE, # optional + auto_tls = False, # optional + mailer = '<MAILER>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-python/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..d59fbaf67 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-telesign-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_telesign_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + customer_id = '<CUSTOMER_ID>', # optional + api_key = '<API_KEY>', # optional + from = '<FROM>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-python/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..e1f9569b9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_textmagic_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + username = '<USERNAME>', # optional + api_key = '<API_KEY>', # optional + from = '<FROM>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-topic.md b/examples/2.0.x/server-python/examples/messaging/update-topic.md new file mode 100644 index 000000000..d7936aa6a --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-topic.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Topic + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Topic = messaging.update_topic( + topic_id = '<TOPIC_ID>', + name = '<NAME>', # optional + subscribe = ["any"] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-python/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..e4622e273 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-twilio-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_twilio_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + account_sid = '<ACCOUNT_SID>', # optional + auth_token = '<AUTH_TOKEN>', # optional + from = '<FROM>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-python/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..ba3798943 --- /dev/null +++ b/examples/2.0.x/server-python/examples/messaging/update-vonage-provider.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging +from appwrite.models import Provider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result: Provider = messaging.update_vonage_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + api_key = '<API_KEY>', # optional + api_secret = '<API_SECRET>', # optional + from = '<FROM>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/organization/create-project.md b/examples/2.0.x/server-python/examples/organization/create-project.md new file mode 100644 index 000000000..f9fb4d3ee --- /dev/null +++ b/examples/2.0.x/server-python/examples/organization/create-project.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.organization import Organization +from appwrite.models import Project +from appwrite.enums import Region + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization(client) + +result: Project = organization.create_project( + project_id = '<PROJECT_ID>', + name = '<NAME>', + region = Region.DEFAULT # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/organization/delete-project.md b/examples/2.0.x/server-python/examples/organization/delete-project.md new file mode 100644 index 000000000..024c03e84 --- /dev/null +++ b/examples/2.0.x/server-python/examples/organization/delete-project.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.organization import Organization + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization(client) + +result = organization.delete_project( + project_id = '<PROJECT_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/organization/get-project.md b/examples/2.0.x/server-python/examples/organization/get-project.md new file mode 100644 index 000000000..f0d74fd1a --- /dev/null +++ b/examples/2.0.x/server-python/examples/organization/get-project.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.organization import Organization +from appwrite.models import Project + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization(client) + +result: Project = organization.get_project( + project_id = '<PROJECT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/organization/list-projects.md b/examples/2.0.x/server-python/examples/organization/list-projects.md new file mode 100644 index 000000000..42b902ea4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/organization/list-projects.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.organization import Organization +from appwrite.models import ProjectList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization(client) + +result: ProjectList = organization.list_projects( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/organization/update-project.md b/examples/2.0.x/server-python/examples/organization/update-project.md new file mode 100644 index 000000000..c14fd0cc6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/organization/update-project.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.organization import Organization +from appwrite.models import Project + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization(client) + +result: Project = organization.update_project( + project_id = '<PROJECT_ID>', + name = '<NAME>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/presences/delete.md b/examples/2.0.x/server-python/examples/presences/delete.md new file mode 100644 index 000000000..ca4ba6601 --- /dev/null +++ b/examples/2.0.x/server-python/examples/presences/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.presences import Presences + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences(client) + +result = presences.delete( + presence_id = '<PRESENCE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/presences/get.md b/examples/2.0.x/server-python/examples/presences/get.md new file mode 100644 index 000000000..2c57df097 --- /dev/null +++ b/examples/2.0.x/server-python/examples/presences/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.presences import Presences +from appwrite.models import Presence + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences(client) + +result: Presence = presences.get( + presence_id = '<PRESENCE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/presences/list.md b/examples/2.0.x/server-python/examples/presences/list.md new file mode 100644 index 000000000..a03492851 --- /dev/null +++ b/examples/2.0.x/server-python/examples/presences/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.presences import Presences +from appwrite.models import PresenceList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences(client) + +result: PresenceList = presences.list( + queries = [], # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/presences/update.md b/examples/2.0.x/server-python/examples/presences/update.md new file mode 100644 index 000000000..fd3a9ef0b --- /dev/null +++ b/examples/2.0.x/server-python/examples/presences/update.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.presences import Presences +from appwrite.models import Presence +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences(client) + +result: Presence = presences.update( + presence_id = '<PRESENCE_ID>', + user_id = '<USER_ID>', + status = '<STATUS>', # optional + expires_at = '2020-10-15T06:38:00.000+00:00', # optional + metadata = {}, # optional + permissions = [Permission.read(Role.any())], # optional + purge = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/presences/upsert.md b/examples/2.0.x/server-python/examples/presences/upsert.md new file mode 100644 index 000000000..2750434c2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/presences/upsert.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.presences import Presences +from appwrite.models import Presence +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences(client) + +result: Presence = presences.upsert( + presence_id = '<PRESENCE_ID>', + user_id = '<USER_ID>', + status = '<STATUS>', + permissions = [Permission.read(Role.any())], # optional + expires_at = '2020-10-15T06:38:00.000+00:00', # optional + metadata = {} # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-android-platform.md b/examples/2.0.x/server-python/examples/project/create-android-platform.md new file mode 100644 index 000000000..092376e00 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-android-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformAndroid + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformAndroid = project.create_android_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + application_id = '<APPLICATION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-apple-platform.md b/examples/2.0.x/server-python/examples/project/create-apple-platform.md new file mode 100644 index 000000000..3e190d4c7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-apple-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformApple + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformApple = project.create_apple_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + bundle_identifier = '<BUNDLE_IDENTIFIER>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-python/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..17a48da69 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-ephemeral-key.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import EphemeralKey +from appwrite.enums import ProjectKeyScopes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: EphemeralKey = project.create_ephemeral_key( + scopes = [ProjectKeyScopes.PROJECT_READ], + duration = 600 +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-linux-platform.md b/examples/2.0.x/server-python/examples/project/create-linux-platform.md new file mode 100644 index 000000000..e1ac1da86 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-linux-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformLinux + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformLinux = project.create_linux_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + package_name = '<PACKAGE_NAME>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-mock-phone.md b/examples/2.0.x/server-python/examples/project/create-mock-phone.md new file mode 100644 index 000000000..6ad457df8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-mock-phone.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import MockNumber + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: MockNumber = project.create_mock_phone( + number = '+12065550100', + otp = '<OTP>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-smtp-test.md b/examples/2.0.x/server-python/examples/project/create-smtp-test.md new file mode 100644 index 000000000..3b39979bb --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-smtp-test.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result = project.create_smtp_test( + emails = [] +) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-variable.md b/examples/2.0.x/server-python/examples/project/create-variable.md new file mode 100644 index 000000000..668e3548e --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-variable.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: Variable = project.create_variable( + variable_id = '<VARIABLE_ID>', + key = '<KEY>', + value = '<VALUE>', + secret = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-web-platform.md b/examples/2.0.x/server-python/examples/project/create-web-platform.md new file mode 100644 index 000000000..c92e167bf --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-web-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformWeb + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformWeb = project.create_web_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + hostname = 'app.example.com' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/create-windows-platform.md b/examples/2.0.x/server-python/examples/project/create-windows-platform.md new file mode 100644 index 000000000..5f782144e --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/create-windows-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformWindows + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformWindows = project.create_windows_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + package_identifier_name = '<PACKAGE_IDENTIFIER_NAME>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/delete-key.md b/examples/2.0.x/server-python/examples/project/delete-key.md new file mode 100644 index 000000000..8af3c0fc4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/delete-key.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result = project.delete_key( + key_id = '<KEY_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/project/delete-mock-phone.md b/examples/2.0.x/server-python/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..5ce79db59 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/delete-mock-phone.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result = project.delete_mock_phone( + number = '+12065550100' +) +``` diff --git a/examples/2.0.x/server-python/examples/project/delete-platform.md b/examples/2.0.x/server-python/examples/project/delete-platform.md new file mode 100644 index 000000000..471bb8386 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/delete-platform.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result = project.delete_platform( + platform_id = '<PLATFORM_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/project/delete-variable.md b/examples/2.0.x/server-python/examples/project/delete-variable.md new file mode 100644 index 000000000..89b16d21f --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/delete-variable.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result = project.delete_variable( + variable_id = '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/project/delete.md b/examples/2.0.x/server-python/examples/project/delete.md new file mode 100644 index 000000000..0c74d3116 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/delete.md @@ -0,0 +1,13 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result = project.delete() +``` diff --git a/examples/2.0.x/server-python/examples/project/get-email-template.md b/examples/2.0.x/server-python/examples/project/get-email-template.md new file mode 100644 index 000000000..8fedaf742 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/get-email-template.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import EmailTemplate +from appwrite.enums import ProjectEmailTemplateId +from appwrite.enums import ProjectEmailTemplateLocale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: EmailTemplate = project.get_email_template( + template_id = ProjectEmailTemplateId.VERIFICATION, + locale = ProjectEmailTemplateLocale.AF # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/get-key.md b/examples/2.0.x/server-python/examples/project/get-key.md new file mode 100644 index 000000000..0165746db --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/get-key.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Key + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: Key = project.get_key( + key_id = '<KEY_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/get-mock-phone.md b/examples/2.0.x/server-python/examples/project/get-mock-phone.md new file mode 100644 index 000000000..e35dffdde --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/get-mock-phone.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import MockNumber + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: MockNumber = project.get_mock_phone( + number = '+12065550100' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-python/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..e2e8f9e95 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,62 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Github +from appwrite.models import OAuth2Discord +from appwrite.models import OAuth2Figma +from appwrite.models import OAuth2Dropbox +from appwrite.models import OAuth2Dailymotion +from appwrite.models import OAuth2Bitbucket +from appwrite.models import OAuth2Bitly +from appwrite.models import OAuth2Box +from appwrite.models import OAuth2Autodesk +from appwrite.models import OAuth2Google +from appwrite.models import OAuth2Zoom +from appwrite.models import OAuth2Zoho +from appwrite.models import OAuth2Yandex +from appwrite.models import OAuth2X +from appwrite.models import OAuth2WordPress +from appwrite.models import OAuth2Twitch +from appwrite.models import OAuth2Stripe +from appwrite.models import OAuth2Spotify +from appwrite.models import OAuth2Slack +from appwrite.models import OAuth2Podio +from appwrite.models import OAuth2Notion +from appwrite.models import OAuth2Salesforce +from appwrite.models import OAuth2Yahoo +from appwrite.models import OAuth2HuggingFace +from appwrite.models import OAuth2Resend +from appwrite.models import OAuth2Cloudflare +from appwrite.models import OAuth2Linkedin +from appwrite.models import OAuth2Disqus +from appwrite.models import OAuth2Amazon +from appwrite.models import OAuth2Etsy +from appwrite.models import OAuth2Facebook +from appwrite.models import OAuth2Tradeshift +from appwrite.models import OAuth2Paypal +from appwrite.models import OAuth2Gitlab +from appwrite.models import OAuth2Authentik +from appwrite.models import OAuth2Auth0 +from appwrite.models import OAuth2FusionAuth +from appwrite.models import OAuth2Keycloak +from appwrite.models import OAuth2Oidc +from appwrite.models import OAuth2Apple +from appwrite.models import OAuth2Okta +from appwrite.models import OAuth2Kick +from appwrite.models import OAuth2Microsoft +from typing import Union +from appwrite.enums import ProjectOAuthProviderId + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: Union[OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2HuggingFace, OAuth2Resend, OAuth2Cloudflare, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft] = project.get_o_auth2_provider( + provider_id = ProjectOAuthProviderId.AMAZON +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/get-platform.md b/examples/2.0.x/server-python/examples/project/get-platform.md new file mode 100644 index 000000000..2075a706a --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/get-platform.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformWeb +from appwrite.models import PlatformApple +from appwrite.models import PlatformAndroid +from appwrite.models import PlatformWindows +from appwrite.models import PlatformLinux +from typing import Union + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: Union[PlatformWeb, PlatformApple, PlatformAndroid, PlatformWindows, PlatformLinux] = project.get_platform( + platform_id = '<PLATFORM_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/get-policy.md b/examples/2.0.x/server-python/examples/project/get-policy.md new file mode 100644 index 000000000..3af009ca6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/get-policy.md @@ -0,0 +1,30 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PolicyPasswordDictionary +from appwrite.models import PolicyPasswordHistory +from appwrite.models import PolicyPasswordStrength +from appwrite.models import PolicyPasswordPersonalData +from appwrite.models import PolicySessionAlert +from appwrite.models import PolicySessionDuration +from appwrite.models import PolicySessionInvalidation +from appwrite.models import PolicySessionLimit +from appwrite.models import PolicyUserLimit +from appwrite.models import PolicyMembershipPrivacy +from appwrite.models import PolicyMfaFactors +from typing import Union +from appwrite.enums import ProjectPolicyId + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: Union[PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors] = project.get_policy( + policy_id = ProjectPolicyId.PASSWORD_DICTIONARY +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/get-variable.md b/examples/2.0.x/server-python/examples/project/get-variable.md new file mode 100644 index 000000000..9771151a6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/get-variable.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: Variable = project.get_variable( + variable_id = '<VARIABLE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/get.md b/examples/2.0.x/server-python/examples/project/get.md new file mode 100644 index 000000000..ea0046c71 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/get.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.get() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/list-email-templates.md b/examples/2.0.x/server-python/examples/project/list-email-templates.md new file mode 100644 index 000000000..293bae738 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/list-email-templates.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import EmailTemplateList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: EmailTemplateList = project.list_email_templates( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/list-keys.md b/examples/2.0.x/server-python/examples/project/list-keys.md new file mode 100644 index 000000000..e72b20bd2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/list-keys.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import KeyList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: KeyList = project.list_keys( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/list-mock-phones.md b/examples/2.0.x/server-python/examples/project/list-mock-phones.md new file mode 100644 index 000000000..6a73776b9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/list-mock-phones.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import MockNumberList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: MockNumberList = project.list_mock_phones( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-python/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..fbe6791a9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2ProviderList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2ProviderList = project.list_o_auth2_providers( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/list-platforms.md b/examples/2.0.x/server-python/examples/project/list-platforms.md new file mode 100644 index 000000000..690f7a798 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/list-platforms.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformList = project.list_platforms( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/list-policies.md b/examples/2.0.x/server-python/examples/project/list-policies.md new file mode 100644 index 000000000..e150a3f6c --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/list-policies.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PolicyList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PolicyList = project.list_policies( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/list-variables.md b/examples/2.0.x/server-python/examples/project/list-variables.md new file mode 100644 index 000000000..4316f7c3e --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/list-variables.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import VariableList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: VariableList = project.list_variables( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-android-platform.md b/examples/2.0.x/server-python/examples/project/update-android-platform.md new file mode 100644 index 000000000..1c915ac47 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-android-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformAndroid + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformAndroid = project.update_android_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + application_id = '<APPLICATION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-apple-platform.md b/examples/2.0.x/server-python/examples/project/update-apple-platform.md new file mode 100644 index 000000000..33fd9c745 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-apple-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformApple + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformApple = project.update_apple_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + bundle_identifier = '<BUNDLE_IDENTIFIER>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-auth-method.md b/examples/2.0.x/server-python/examples/project/update-auth-method.md new file mode 100644 index 000000000..d9e4c6430 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-auth-method.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel +from appwrite.enums import ProjectAuthMethodId + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_auth_method( + method_id = ProjectAuthMethodId.EMAIL_PASSWORD, + enabled = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-email-template.md b/examples/2.0.x/server-python/examples/project/update-email-template.md new file mode 100644 index 000000000..d5548fdbb --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-email-template.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import EmailTemplate +from appwrite.enums import ProjectEmailTemplateId +from appwrite.enums import ProjectEmailTemplateLocale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: EmailTemplate = project.update_email_template( + template_id = ProjectEmailTemplateId.VERIFICATION, + locale = ProjectEmailTemplateLocale.AF, # optional + subject = '<SUBJECT>', # optional + message = '<MESSAGE>', # optional + sender_name = '<SENDER_NAME>', # optional + sender_email = 'email@example.com', # optional + reply_to_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-key.md b/examples/2.0.x/server-python/examples/project/update-key.md new file mode 100644 index 000000000..e1ecc201a --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-key.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Key +from appwrite.enums import ProjectKeyScopes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: Key = project.update_key( + key_id = '<KEY_ID>', + name = '<NAME>', + scopes = [ProjectKeyScopes.PROJECT_READ], + expire = '2020-10-15T06:38:00.000+00:00' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-labels.md b/examples/2.0.x/server-python/examples/project/update-labels.md new file mode 100644 index 000000000..4fedceb18 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-labels.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_labels( + labels = [] +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-linux-platform.md b/examples/2.0.x/server-python/examples/project/update-linux-platform.md new file mode 100644 index 000000000..661286919 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-linux-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformLinux + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformLinux = project.update_linux_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + package_name = '<PACKAGE_NAME>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-python/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..f6878ee47 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_membership_privacy_policy( + user_id = False, # optional + user_email = False, # optional + user_phone = False, # optional + user_name = False, # optional + user_mfa = False, # optional + user_accessed_at = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-python/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..67f75688e --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_mfa_factors_policy( + totp = False, # optional + email = False, # optional + phone = False, # optional + custom = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-mock-phone.md b/examples/2.0.x/server-python/examples/project/update-mock-phone.md new file mode 100644 index 000000000..8a9a96c36 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-mock-phone.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import MockNumber + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: MockNumber = project.update_mock_phone( + number = '+12065550100', + otp = '<OTP>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..61459693a --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Amazon + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Amazon = project.update_o_auth2_amazon( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..2619115ee --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Apple + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Apple = project.update_o_auth2_apple( + service_id = '<SERVICE_ID>', # optional + key_id = '<KEY_ID>', # optional + team_id = '<TEAM_ID>', # optional + p8_file = '<P8_FILE>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..7b7659218 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Appwrite + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Appwrite = project.update_o_auth2_appwrite( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..568bb9bb4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Auth0 + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Auth0 = project.update_o_auth2_auth0( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + endpoint = '<ENDPOINT>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..2fbc09900 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Authentik + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Authentik = project.update_o_auth2_authentik( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + endpoint = '<ENDPOINT>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..cff31e1ef --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Autodesk + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Autodesk = project.update_o_auth2_autodesk( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..a2099d1bd --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Bitbucket + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Bitbucket = project.update_o_auth2_bitbucket( + key = '<KEY>', # optional + secret = '<SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..1f026038e --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Bitly + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Bitly = project.update_o_auth2_bitly( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..363cd0609 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-box.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Box + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Box = project.update_o_auth2_box( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..1044a61b8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Cloudflare + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Cloudflare = project.update_o_auth2_cloudflare( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..53449cd1b --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Dailymotion + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Dailymotion = project.update_o_auth2_dailymotion( + api_key = '<API_KEY>', # optional + api_secret = '<API_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..a95cc4961 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Discord + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Discord = project.update_o_auth2_discord( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..f2af447f9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Disqus + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Disqus = project.update_o_auth2_disqus( + public_key = '<PUBLIC_KEY>', # optional + secret_key = '<SECRET_KEY>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..50e301197 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Dropbox + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Dropbox = project.update_o_auth2_dropbox( + app_key = '<APP_KEY>', # optional + app_secret = '<APP_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..4a0a20eaa --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Etsy + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Etsy = project.update_o_auth2_etsy( + key_string = '<KEY_STRING>', # optional + shared_secret = '<SHARED_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..5b536dbbf --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Facebook + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Facebook = project.update_o_auth2_facebook( + app_id = '<APP_ID>', # optional + app_secret = '<APP_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..eb2a2d252 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Figma + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Figma = project.update_o_auth2_figma( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..fb4d25dff --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2FusionAuth + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2FusionAuth = project.update_o_auth2_fusion_auth( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + endpoint = '<ENDPOINT>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..36664b851 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Github + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Github = project.update_o_auth2_git_hub( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..05905fdce --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Gitlab + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Gitlab = project.update_o_auth2_gitlab( + application_id = '<APPLICATION_ID>', # optional + secret = '<SECRET>', # optional + endpoint = 'https://example.com', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..b1cc1eca3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-google.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Google +from appwrite.enums import ProjectOAuth2GooglePrompt + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Google = project.update_o_auth2_google( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + prompt = [ProjectOAuth2GooglePrompt.NONE], # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..932d4af87 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2HuggingFace + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2HuggingFace = project.update_o_auth2_hugging_face( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..11a0defb5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Keycloak + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Keycloak = project.update_o_auth2_keycloak( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + endpoint = '<ENDPOINT>', # optional + realm_name = '<REALM_NAME>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..bc73e0637 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Kick + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Kick = project.update_o_auth2_kick( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..4b6eec3be --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Linkedin + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Linkedin = project.update_o_auth2_linkedin( + client_id = '<CLIENT_ID>', # optional + primary_client_secret = '<PRIMARY_CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..aeeefa9ec --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Microsoft + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Microsoft = project.update_o_auth2_microsoft( + application_id = '<APPLICATION_ID>', # optional + application_secret = '<APPLICATION_SECRET>', # optional + tenant = '<TENANT>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..0ba765ea9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Notion + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Notion = project.update_o_auth2_notion( + oauth_client_id = '<OAUTH_CLIENT_ID>', # optional + oauth_client_secret = '<OAUTH_CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..e2df2e3ca --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Oidc +from appwrite.enums import ProjectOAuth2OidcPrompt + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Oidc = project.update_o_auth2_oidc( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + well_known_url = 'https://example.com', # optional + authorization_url = 'https://example.com', # optional + token_url = 'https://example.com', # optional + user_info_url = 'https://example.com', # optional + prompt = [ProjectOAuth2OidcPrompt.NONE], # optional + max_age = 0, # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..0b4fc5329 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Okta + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Okta = project.update_o_auth2_okta( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + domain = 'example.com', # optional + authorization_server_id = '<AUTHORIZATION_SERVER_ID>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..f31dc2855 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Paypal + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Paypal = project.update_o_auth2_paypal_sandbox( + client_id = '<CLIENT_ID>', # optional + secret_key = '<SECRET_KEY>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..450e95925 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Paypal + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Paypal = project.update_o_auth2_paypal( + client_id = '<CLIENT_ID>', # optional + secret_key = '<SECRET_KEY>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..992ecdcea --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Podio + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Podio = project.update_o_auth2_podio( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..8ce174189 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Resend + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Resend = project.update_o_auth2_resend( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..a3cb63772 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Salesforce + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Salesforce = project.update_o_auth2_salesforce( + customer_key = '<CUSTOMER_KEY>', # optional + customer_secret = '<CUSTOMER_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..65cc30995 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Slack + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Slack = project.update_o_auth2_slack( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..257f45d04 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Spotify + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Spotify = project.update_o_auth2_spotify( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..7207a897e --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Stripe + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Stripe = project.update_o_auth2_stripe( + client_id = '<CLIENT_ID>', # optional + api_secret_key = '<API_SECRET_KEY>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..2aaf7e642 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Tradeshift + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Tradeshift = project.update_o_auth2_tradeshift_sandbox( + oauth2_client_id = '<OAUTH2_CLIENT_ID>', # optional + oauth2_client_secret = '<OAUTH2_CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..6ed5baccd --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Tradeshift + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Tradeshift = project.update_o_auth2_tradeshift( + oauth2_client_id = '<OAUTH2_CLIENT_ID>', # optional + oauth2_client_secret = '<OAUTH2_CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..7c4027897 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Twitch + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Twitch = project.update_o_auth2_twitch( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..c7b406b95 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2WordPress + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2WordPress = project.update_o_auth2_word_press( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..6ea825b57 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Yahoo + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Yahoo = project.update_o_auth2_yahoo( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..c8604ede3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Yandex + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Yandex = project.update_o_auth2_yandex( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..069a9645b --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Zoho + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Zoho = project.update_o_auth2_zoho( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..e779a0c09 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2Zoom + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2Zoom = project.update_o_auth2_zoom( + client_id = '<CLIENT_ID>', # optional + client_secret = '<CLIENT_SECRET>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-python/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..5637fd6a7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-o-auth-2x.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import OAuth2X + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: OAuth2X = project.update_o_auth2_x( + customer_key = '<CUSTOMER_KEY>', # optional + secret_key = '<SECRET_KEY>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-python/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..93e652be4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_password_dictionary_policy( + enabled = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-password-history-policy.md b/examples/2.0.x/server-python/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..5e3c1406a --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-password-history-policy.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_password_history_policy( + total = 1 +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-python/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..507bdac4d --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_password_personal_data_policy( + enabled = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-python/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..c87aeaf3f --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-password-strength-policy.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PolicyPasswordStrength + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PolicyPasswordStrength = project.update_password_strength_policy( + min = 8, # optional + uppercase = False, # optional + lowercase = False, # optional + number = False, # optional + symbols = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-protocol.md b/examples/2.0.x/server-python/examples/project/update-protocol.md new file mode 100644 index 000000000..db26644d6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-protocol.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel +from appwrite.enums import ProjectProtocolId + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_protocol( + protocol_id = ProjectProtocolId.REST, + enabled = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-service.md b/examples/2.0.x/server-python/examples/project/update-service.md new file mode 100644 index 000000000..17c003c09 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-service.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel +from appwrite.enums import ProjectServiceId + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_service( + service_id = ProjectServiceId.ACCOUNT, + enabled = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-python/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..382f694d0 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-session-alert-policy.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_session_alert_policy( + enabled = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-python/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..817947e45 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-session-duration-policy.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_session_duration_policy( + duration = 60 +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-python/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..6e8417d34 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_session_invalidation_policy( + enabled = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-python/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..bcfd671af --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-session-limit-policy.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_session_limit_policy( + total = 1 +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-smtp.md b/examples/2.0.x/server-python/examples/project/update-smtp.md new file mode 100644 index 000000000..772bafeaa --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-smtp.md @@ -0,0 +1,28 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel +from appwrite.enums import ProjectSMTPSecure + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_smtp( + host = 'example.com', # optional + port = 587, # optional + username = '<USERNAME>', # optional + password = 'password', # optional + sender_email = 'email@example.com', # optional + sender_name = '<SENDER_NAME>', # optional + reply_to_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + secure = ProjectSMTPSecure.TLS, # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-python/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..42d66de30 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-user-limit-policy.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Project as ProjectModel + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: ProjectModel = project.update_user_limit_policy( + total = 0 +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-variable.md b/examples/2.0.x/server-python/examples/project/update-variable.md new file mode 100644 index 000000000..3f4dac0fc --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-variable.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: Variable = project.update_variable( + variable_id = '<VARIABLE_ID>', + key = '<KEY>', # optional + value = '<VALUE>', # optional + secret = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-web-platform.md b/examples/2.0.x/server-python/examples/project/update-web-platform.md new file mode 100644 index 000000000..19f10b4b5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-web-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformWeb + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformWeb = project.update_web_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + hostname = 'app.example.com' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/project/update-windows-platform.md b/examples/2.0.x/server-python/examples/project/update-windows-platform.md new file mode 100644 index 000000000..cf154e045 --- /dev/null +++ b/examples/2.0.x/server-python/examples/project/update-windows-platform.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.project import Project +from appwrite.models import PlatformWindows + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project(client) + +result: PlatformWindows = project.update_windows_platform( + platform_id = '<PLATFORM_ID>', + name = '<NAME>', + package_identifier_name = '<PACKAGE_IDENTIFIER_NAME>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/proxy/create-api-rule.md b/examples/2.0.x/server-python/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..7baf360c4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/proxy/create-api-rule.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.proxy import Proxy +from appwrite.models import ProxyRule + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy(client) + +result: ProxyRule = proxy.create_api_rule( + domain = 'example.com' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/proxy/create-function-rule.md b/examples/2.0.x/server-python/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..0abc59264 --- /dev/null +++ b/examples/2.0.x/server-python/examples/proxy/create-function-rule.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.proxy import Proxy +from appwrite.models import ProxyRule + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy(client) + +result: ProxyRule = proxy.create_function_rule( + domain = 'example.com', + function_id = '<FUNCTION_ID>', + branch = '<BRANCH>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-python/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..7a44bac02 --- /dev/null +++ b/examples/2.0.x/server-python/examples/proxy/create-redirect-rule.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.proxy import Proxy +from appwrite.models import ProxyRule +from appwrite.enums import StatusCode +from appwrite.enums import ProxyResourceType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy(client) + +result: ProxyRule = proxy.create_redirect_rule( + domain = 'example.com', + url = 'https://example.com', + status_code = StatusCode.MOVEDPERMANENTLY, + resource_id = '<RESOURCE_ID>', + resource_type = ProxyResourceType.SITE +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/proxy/create-site-rule.md b/examples/2.0.x/server-python/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..c108dca6c --- /dev/null +++ b/examples/2.0.x/server-python/examples/proxy/create-site-rule.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.proxy import Proxy +from appwrite.models import ProxyRule + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy(client) + +result: ProxyRule = proxy.create_site_rule( + domain = 'example.com', + site_id = '<SITE_ID>', + branch = '<BRANCH>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/proxy/delete-rule.md b/examples/2.0.x/server-python/examples/proxy/delete-rule.md new file mode 100644 index 000000000..c5a76ee5e --- /dev/null +++ b/examples/2.0.x/server-python/examples/proxy/delete-rule.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.proxy import Proxy + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy(client) + +result = proxy.delete_rule( + rule_id = '<RULE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/proxy/get-rule.md b/examples/2.0.x/server-python/examples/proxy/get-rule.md new file mode 100644 index 000000000..becc4c360 --- /dev/null +++ b/examples/2.0.x/server-python/examples/proxy/get-rule.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.proxy import Proxy +from appwrite.models import ProxyRule + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy(client) + +result: ProxyRule = proxy.get_rule( + rule_id = '<RULE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/proxy/list-rules.md b/examples/2.0.x/server-python/examples/proxy/list-rules.md new file mode 100644 index 000000000..4cf085f4b --- /dev/null +++ b/examples/2.0.x/server-python/examples/proxy/list-rules.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.proxy import Proxy +from appwrite.models import ProxyRuleList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy(client) + +result: ProxyRuleList = proxy.list_rules( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/proxy/update-rule-status.md b/examples/2.0.x/server-python/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..f317926da --- /dev/null +++ b/examples/2.0.x/server-python/examples/proxy/update-rule-status.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.proxy import Proxy +from appwrite.models import ProxyRule + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy(client) + +result: ProxyRule = proxy.update_rule_status( + rule_id = '<RULE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/create-deployment.md b/examples/2.0.x/server-python/examples/sites/create-deployment.md new file mode 100644 index 000000000..8abb038e3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/create-deployment.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.input_file import InputFile +from appwrite.models import Deployment + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Deployment = sites.create_deployment( + site_id = '<SITE_ID>', + code = InputFile.from_path('file.png'), + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>', # optional + activate = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-python/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..35b52564b --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Deployment + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Deployment = sites.create_duplicate_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/create-template-deployment.md b/examples/2.0.x/server-python/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..f65b153b5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/create-template-deployment.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Deployment +from appwrite.enums import TemplateReferenceType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Deployment = sites.create_template_deployment( + site_id = '<SITE_ID>', + repository = '<REPOSITORY>', + owner = '<OWNER>', + root_directory = '<ROOT_DIRECTORY>', + type = TemplateReferenceType.BRANCH, + reference = '<REFERENCE>', + activate = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/create-variable.md b/examples/2.0.x/server-python/examples/sites/create-variable.md new file mode 100644 index 000000000..ca6d9e578 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/create-variable.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Variable = sites.create_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>', + key = '<KEY>', + value = '<VALUE>', + secret = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-python/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..1846cefc3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/create-vcs-deployment.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Deployment +from appwrite.enums import VCSReferenceType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Deployment = sites.create_vcs_deployment( + site_id = '<SITE_ID>', + type = VCSReferenceType.BRANCH, + reference = '<REFERENCE>', + activate = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/create.md b/examples/2.0.x/server-python/examples/sites/create.md new file mode 100644 index 000000000..8fd41e725 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/create.md @@ -0,0 +1,45 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Site +from appwrite.enums import Framework +from appwrite.enums import BuildRuntime +from appwrite.enums import Adapter +from appwrite.enums import ProjectKeyScopes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Site = sites.create( + site_id = '<SITE_ID>', + name = '<NAME>', + framework = Framework.ANALOG, + build_runtime = BuildRuntime.NODE_14_5, + enabled = False, # optional + logging = False, # optional + timeout = 1, # optional + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + start_command = '<START_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>', # optional + adapter = Adapter.STATIC, # optional + installation_id = '<INSTALLATION_ID>', # optional + fallback_file = '<FALLBACK_FILE>', # optional + provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch = '<PROVIDER_BRANCH>', # optional + provider_silent_mode = False, # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + provider_branches = [], # optional + provider_paths = [], # optional + build_specification = 's-1vcpu-512mb', # optional + runtime_specification = 's-1vcpu-512mb', # optional + deployment_retention = 0, # optional + scopes = [ProjectKeyScopes.PROJECT_READ] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/delete-deployment.md b/examples/2.0.x/server-python/examples/sites/delete-deployment.md new file mode 100644 index 000000000..ee2f14915 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/delete-deployment.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.delete_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/sites/delete-log.md b/examples/2.0.x/server-python/examples/sites/delete-log.md new file mode 100644 index 000000000..26c631240 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/delete-log.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.delete_log( + site_id = '<SITE_ID>', + log_id = '<LOG_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/sites/delete-variable.md b/examples/2.0.x/server-python/examples/sites/delete-variable.md new file mode 100644 index 000000000..97e77cd65 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/delete-variable.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.delete_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/sites/delete.md b/examples/2.0.x/server-python/examples/sites/delete.md new file mode 100644 index 000000000..41e3eafb6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.delete( + site_id = '<SITE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/sites/get-deployment-download.md b/examples/2.0.x/server-python/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..7d6ae537d --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/get-deployment-download.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.enums import DeploymentDownloadType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: bytes = sites.get_deployment_download( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>', + type = DeploymentDownloadType.SOURCE, # optional + token = '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/sites/get-deployment.md b/examples/2.0.x/server-python/examples/sites/get-deployment.md new file mode 100644 index 000000000..5291928c3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/get-deployment.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Deployment + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Deployment = sites.get_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/get-log.md b/examples/2.0.x/server-python/examples/sites/get-log.md new file mode 100644 index 000000000..aa718daad --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/get-log.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Execution + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Execution = sites.get_log( + site_id = '<SITE_ID>', + log_id = '<LOG_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/get-variable.md b/examples/2.0.x/server-python/examples/sites/get-variable.md new file mode 100644 index 000000000..9eb30dd91 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/get-variable.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Variable = sites.get_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/get.md b/examples/2.0.x/server-python/examples/sites/get.md new file mode 100644 index 000000000..c792987a1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Site + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Site = sites.get( + site_id = '<SITE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/list-deployments.md b/examples/2.0.x/server-python/examples/sites/list-deployments.md new file mode 100644 index 000000000..70b2a0b3c --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/list-deployments.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import DeploymentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: DeploymentList = sites.list_deployments( + site_id = '<SITE_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/list-frameworks.md b/examples/2.0.x/server-python/examples/sites/list-frameworks.md new file mode 100644 index 000000000..84996b3f7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/list-frameworks.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import FrameworkList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: FrameworkList = sites.list_frameworks() + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/list-logs.md b/examples/2.0.x/server-python/examples/sites/list-logs.md new file mode 100644 index 000000000..4543f2323 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/list-logs.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import ExecutionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: ExecutionList = sites.list_logs( + site_id = '<SITE_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/list-specifications.md b/examples/2.0.x/server-python/examples/sites/list-specifications.md new file mode 100644 index 000000000..2f04ddf48 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/list-specifications.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import SpecificationList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: SpecificationList = sites.list_specifications( + type = 'runtimes' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/list-variables.md b/examples/2.0.x/server-python/examples/sites/list-variables.md new file mode 100644 index 000000000..4a2c2c5a6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/list-variables.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import VariableList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: VariableList = sites.list_variables( + site_id = '<SITE_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/list.md b/examples/2.0.x/server-python/examples/sites/list.md new file mode 100644 index 000000000..0a5648271 --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import SiteList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: SiteList = sites.list( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/update-deployment-status.md b/examples/2.0.x/server-python/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..8ab82d4ad --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/update-deployment-status.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Deployment + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Deployment = sites.update_deployment_status( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/update-site-deployment.md b/examples/2.0.x/server-python/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..507923e9d --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/update-site-deployment.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Site + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Site = sites.update_site_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/update-variable.md b/examples/2.0.x/server-python/examples/sites/update-variable.md new file mode 100644 index 000000000..637d2220e --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/update-variable.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Variable + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Variable = sites.update_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>', + key = '<KEY>', # optional + value = '<VALUE>', # optional + secret = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/sites/update.md b/examples/2.0.x/server-python/examples/sites/update.md new file mode 100644 index 000000000..0065e89fd --- /dev/null +++ b/examples/2.0.x/server-python/examples/sites/update.md @@ -0,0 +1,45 @@ +```python +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.models import Site +from appwrite.enums import Framework +from appwrite.enums import BuildRuntime +from appwrite.enums import Adapter +from appwrite.enums import ProjectKeyScopes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result: Site = sites.update( + site_id = '<SITE_ID>', + name = '<NAME>', + framework = Framework.ANALOG, + enabled = False, # optional + logging = False, # optional + timeout = 1, # optional + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + start_command = '<START_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>', # optional + build_runtime = BuildRuntime.NODE_14_5, # optional + adapter = Adapter.STATIC, # optional + fallback_file = '<FALLBACK_FILE>', # optional + installation_id = '<INSTALLATION_ID>', # optional + provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch = '<PROVIDER_BRANCH>', # optional + provider_silent_mode = False, # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + provider_branches = [], # optional + provider_paths = [], # optional + build_specification = 's-1vcpu-512mb', # optional + runtime_specification = 's-1vcpu-512mb', # optional + deployment_retention = 0, # optional + scopes = [ProjectKeyScopes.PROJECT_READ] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/storage/create-bucket.md b/examples/2.0.x/server-python/examples/storage/create-bucket.md new file mode 100644 index 000000000..418f8ecb1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/create-bucket.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.models import Bucket +from appwrite.enums import Compression +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result: Bucket = storage.create_bucket( + bucket_id = '<BUCKET_ID>', + name = '<NAME>', + permissions = [Permission.read(Role.any())], # optional + file_security = False, # optional + enabled = False, # optional + maximum_file_size = 1, # optional + allowed_file_extensions = [], # optional + compression = Compression.NONE, # optional + encryption = False, # optional + antivirus = False, # optional + transformations = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/storage/create-file.md b/examples/2.0.x/server-python/examples/storage/create-file.md new file mode 100644 index 000000000..9adb89cf8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/create-file.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.input_file import InputFile +from appwrite.models import File +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result: File = storage.create_file( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + file = InputFile.from_path('file.png'), + permissions = [Permission.read(Role.any())], # optional + folder = 'photos/2026' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/storage/delete-bucket.md b/examples/2.0.x/server-python/examples/storage/delete-bucket.md new file mode 100644 index 000000000..ae71a793a --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/delete-bucket.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result = storage.delete_bucket( + bucket_id = '<BUCKET_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/storage/delete-file.md b/examples/2.0.x/server-python/examples/storage/delete-file.md new file mode 100644 index 000000000..ce1d26044 --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/delete-file.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.delete_file( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/storage/get-bucket.md b/examples/2.0.x/server-python/examples/storage/get-bucket.md new file mode 100644 index 000000000..eaa707ced --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/get-bucket.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.models import Bucket + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result: Bucket = storage.get_bucket( + bucket_id = '<BUCKET_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/storage/get-file-download.md b/examples/2.0.x/server-python/examples/storage/get-file-download.md new file mode 100644 index 000000000..ac6f9424d --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/get-file-download.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result: bytes = storage.get_file_download( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + token = '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/storage/get-file-preview.md b/examples/2.0.x/server-python/examples/storage/get-file-preview.md new file mode 100644 index 000000000..373cb9418 --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/get-file-preview.md @@ -0,0 +1,30 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.enums import ImageGravity +from appwrite.enums import ImageFormat + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result: bytes = storage.get_file_preview( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + width = 0, # optional + height = 0, # optional + gravity = ImageGravity.CENTER, # optional + quality = -1, # optional + border_width = 0, # optional + border_color = 'FFFFFF', # optional + border_radius = 0, # optional + opacity = 0, # optional + rotation = -360, # optional + background = 'FFFFFF', # optional + output = ImageFormat.JPG, # optional + token = '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/storage/get-file-view.md b/examples/2.0.x/server-python/examples/storage/get-file-view.md new file mode 100644 index 000000000..5cceef6ff --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/get-file-view.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result: bytes = storage.get_file_view( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + token = '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/storage/get-file.md b/examples/2.0.x/server-python/examples/storage/get-file.md new file mode 100644 index 000000000..fb1435115 --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/get-file.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.models import File + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result: File = storage.get_file( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/storage/list-buckets.md b/examples/2.0.x/server-python/examples/storage/list-buckets.md new file mode 100644 index 000000000..aebd50b6b --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/list-buckets.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.models import BucketList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result: BucketList = storage.list_buckets( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/storage/list-files.md b/examples/2.0.x/server-python/examples/storage/list-files.md new file mode 100644 index 000000000..a676c3136 --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/list-files.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.models import FileList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result: FileList = storage.list_files( + bucket_id = '<BUCKET_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/storage/update-bucket.md b/examples/2.0.x/server-python/examples/storage/update-bucket.md new file mode 100644 index 000000000..ecb1ada62 --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/update-bucket.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.models import Bucket +from appwrite.enums import Compression +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result: Bucket = storage.update_bucket( + bucket_id = '<BUCKET_ID>', + name = '<NAME>', + permissions = [Permission.read(Role.any())], # optional + file_security = False, # optional + enabled = False, # optional + maximum_file_size = 1, # optional + allowed_file_extensions = [], # optional + compression = Compression.NONE, # optional + encryption = False, # optional + antivirus = False, # optional + transformations = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/storage/update-file.md b/examples/2.0.x/server-python/examples/storage/update-file.md new file mode 100644 index 000000000..b0fad8d47 --- /dev/null +++ b/examples/2.0.x/server-python/examples/storage/update-file.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.models import File +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result: File = storage.update_file( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + name = '<NAME>', # optional + permissions = [Permission.read(Role.any())] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..cff669600 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnBigint + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnBigint = tables_db.create_big_int_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + min = 0, # optional + max = 1000000, # optional + default = 0, # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..b325095d7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnBoolean + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnBoolean = tables_db.create_boolean_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = False, # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..a4a565d09 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnDatetime + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnDatetime = tables_db.create_datetime_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = '2020-10-15T06:38:00.000+00:00', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..7315689cd --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-email-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnEmail + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnEmail = tables_db.create_email_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'email@example.com', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..3e4cb1b97 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-enum-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnEnum + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnEnum = tables_db.create_enum_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + elements = ["active", "inactive"], + required = False, + default = 'active', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..0edd6a260 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-float-column.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnFloat + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnFloat = tables_db.create_float_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + min = 0, # optional + max = 100, # optional + default = 10.5, # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-index.md b/examples/2.0.x/server-python/examples/tablesdb/create-index.md new file mode 100644 index 000000000..5de707fed --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-index.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnIndex +from appwrite.enums import TablesDBIndexType +from appwrite.enums import OrderBy + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnIndex = tables_db.create_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + type = TablesDBIndexType.KEY, + columns = [], + orders = [OrderBy.ASC], # optional + lengths = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..bbe768891 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-integer-column.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnInteger + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnInteger = tables_db.create_integer_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + min = 0, # optional + max = 100, # optional + default = 10, # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..a0a47e67a --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-ip-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnIp + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnIp = tables_db.create_ip_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = '192.0.2.0', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..2fc64c4f5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-line-column.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnLine + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnLine = tables_db.create_line_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = [[1, 2], [3, 4], [5, 6]] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..1438ff8a8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnLongtext + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnLongtext = tables_db.create_longtext_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..6729b3292 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnMediumtext + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnMediumtext = tables_db.create_mediumtext_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-operations.md b/examples/2.0.x/server-python/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..cb2a8c920 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-operations.md @@ -0,0 +1,29 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Transaction = tables_db.create_operations( + transaction_id = '<TRANSACTION_ID>', + operations = [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..17c1e4472 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-point-column.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnPoint + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnPoint = tables_db.create_point_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = [1, 2] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..86fca3047 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnPolygon + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnPolygon = tables_db.create_polygon_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..ffad0db40 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnRelationship +from appwrite.enums import RelationshipType +from appwrite.enums import RelationMutate + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnRelationship = tables_db.create_relationship_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + related_table_id = '<RELATED_TABLE_ID>', + type = RelationshipType.ONETOONE, + two_way = False, # optional + key = '<KEY>', # optional + two_way_key = '<TWO_WAY_KEY>', # optional + on_delete = RelationMutate.CASCADE # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-row.md b/examples/2.0.x/server-python/examples/tablesdb/create-row.md new file mode 100644 index 000000000..aa8a9fe67 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-row.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Row +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result: Row = tables_db.create_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": False + }, + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-rows.md b/examples/2.0.x/server-python/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..9e741fe4c --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-rows.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import RowList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: RowList = tables_db.create_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + rows = [], + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..85decfdec --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-string-column.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnString + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnString = tables_db.create_string_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + size = 1, + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-table.md b/examples/2.0.x/server-python/examples/tablesdb/create-table.md new file mode 100644 index 000000000..029fb281e --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-table.md @@ -0,0 +1,27 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Table +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Table = tables_db.create_table( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + name = '<NAME>', + permissions = [Permission.read(Role.any())], # optional + row_security = False, # optional + enabled = False, # optional + columns = [], # optional + indexes = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..f3c8df3d8 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-text-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnText + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnText = tables_db.create_text_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-python/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..b48e262fd --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-transaction.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Transaction = tables_db.create_transaction( + ttl = 60 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..4bfb858fb --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-url-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnUrl + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnUrl = tables_db.create_url_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'https://example.com', # optional + array = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-python/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..2fb6338c5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnVarchar + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnVarchar = tables_db.create_varchar_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + size = 1, + required = False, + default = 'Hello World', # optional + array = False, # optional + encrypt = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/create.md b/examples/2.0.x/server-python/examples/tablesdb/create.md new file mode 100644 index 000000000..fb6bf0fb4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/create.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Database = tables_db.create( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-python/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..6ee2f9020 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Row + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result: Row = tables_db.decrement_row_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + column = '<COLUMN>', + value = 1, # optional + min = 0, # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/delete-column.md b/examples/2.0.x/server-python/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..110fb17f6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/delete-column.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>' +) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/delete-index.md b/examples/2.0.x/server-python/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..8d9e2adf9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/delete-index.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>' +) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/delete-row.md b/examples/2.0.x/server-python/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..7615459e7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/delete-row.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.delete_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + transaction_id = '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-python/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..2a3a89ca0 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/delete-rows.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import RowList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: RowList = tables_db.delete_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/delete-table.md b/examples/2.0.x/server-python/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..599753706 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/delete-table.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete_table( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-python/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..cbbbc5d97 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/delete-transaction.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete_transaction( + transaction_id = '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/delete.md b/examples/2.0.x/server-python/examples/tablesdb/delete.md new file mode 100644 index 000000000..9859c1e9c --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete( + database_id = '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/get-column.md b/examples/2.0.x/server-python/examples/tablesdb/get-column.md new file mode 100644 index 000000000..6d2b82551 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/get-column.md @@ -0,0 +1,30 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnBoolean +from appwrite.models import ColumnInteger +from appwrite.models import ColumnFloat +from appwrite.models import ColumnEmail +from appwrite.models import ColumnEnum +from appwrite.models import ColumnUrl +from appwrite.models import ColumnIp +from appwrite.models import ColumnDatetime +from appwrite.models import ColumnRelationship +from appwrite.models import ColumnString +from typing import Union + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Union[ColumnBoolean, ColumnInteger, ColumnFloat, ColumnEmail, ColumnEnum, ColumnUrl, ColumnIp, ColumnDatetime, ColumnRelationship, ColumnString] = tables_db.get_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/get-index.md b/examples/2.0.x/server-python/examples/tablesdb/get-index.md new file mode 100644 index 000000000..2bce205d2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/get-index.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnIndex + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnIndex = tables_db.get_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/get-row.md b/examples/2.0.x/server-python/examples/tablesdb/get-row.md new file mode 100644 index 000000000..55609e257 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/get-row.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Row + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result: Row = tables_db.get_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/get-table.md b/examples/2.0.x/server-python/examples/tablesdb/get-table.md new file mode 100644 index 000000000..da6a4bcb4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/get-table.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Table + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Table = tables_db.get_table( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-python/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..b51fcc268 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/get-transaction.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Transaction = tables_db.get_transaction( + transaction_id = '<TRANSACTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/get.md b/examples/2.0.x/server-python/examples/tablesdb/get.md new file mode 100644 index 000000000..036deeec9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Database = tables_db.get( + database_id = '<DATABASE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-python/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..ae25a0b69 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/increment-row-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Row + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result: Row = tables_db.increment_row_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + column = '<COLUMN>', + value = 1, # optional + max = 100, # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/list-columns.md b/examples/2.0.x/server-python/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..3a450487e --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/list-columns.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnList = tables_db.list_columns( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-python/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..b1ccf1a42 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/list-indexes.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnIndexList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnIndexList = tables_db.list_indexes( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/list-rows.md b/examples/2.0.x/server-python/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..0ef941040 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/list-rows.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import RowList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result: RowList = tables_db.list_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>', # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/list-tables.md b/examples/2.0.x/server-python/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..589aaa989 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/list-tables.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import TableList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: TableList = tables_db.list_tables( + database_id = '<DATABASE_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-python/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..b4384e67c --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/list-transactions.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import TransactionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: TransactionList = tables_db.list_transactions( + queries = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/list.md b/examples/2.0.x/server-python/examples/tablesdb/list.md new file mode 100644 index 000000000..cfc352d1b --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import DatabaseList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: DatabaseList = tables_db.list( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..f4e6e90d3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnBigint + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnBigint = tables_db.update_big_int_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 0, + min = 0, # optional + max = 1000000, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..9352362c7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnBoolean + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnBoolean = tables_db.update_boolean_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = False, + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..70cd57545 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnDatetime + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnDatetime = tables_db.update_datetime_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = '2020-10-15T06:38:00.000+00:00', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..94036baf2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-email-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnEmail + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnEmail = tables_db.update_email_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'email@example.com', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..0ac9ac919 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-enum-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnEnum + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnEnum = tables_db.update_enum_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + elements = ["active", "inactive"], + required = False, + default = 'active', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..08e39be5a --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-float-column.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnFloat + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnFloat = tables_db.update_float_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 10.5, + min = 0, # optional + max = 100, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..cd6831fc2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-integer-column.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnInteger + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnInteger = tables_db.update_integer_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 10, + min = 0, # optional + max = 100, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..c3570fb1b --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-ip-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnIp + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnIp = tables_db.update_ip_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = '192.0.2.0', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..052a12c0f --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-line-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnLine + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnLine = tables_db.update_line_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = [[1, 2], [3, 4], [5, 6]], # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..8e44bd032 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnLongtext + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnLongtext = tables_db.update_longtext_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..2412dc84f --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnMediumtext + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnMediumtext = tables_db.update_mediumtext_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..5368394e2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-point-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnPoint + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnPoint = tables_db.update_point_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = [1, 2], # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..b7af58ae6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnPolygon + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnPolygon = tables_db.update_polygon_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..4932a8a92 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnRelationship +from appwrite.enums import RelationMutate + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnRelationship = tables_db.update_relationship_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + on_delete = RelationMutate.CASCADE, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-row.md b/examples/2.0.x/server-python/examples/tablesdb/update-row.md new file mode 100644 index 000000000..30522e7bc --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-row.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Row +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result: Row = tables_db.update_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": False + }, # optional + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-rows.md b/examples/2.0.x/server-python/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..dc3641b3e --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-rows.md @@ -0,0 +1,28 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import RowList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: RowList = tables_db.update_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": False + }, # optional + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..f33752373 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-string-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnString + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnString = tables_db.update_string_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + size = 1, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-table.md b/examples/2.0.x/server-python/examples/tablesdb/update-table.md new file mode 100644 index 000000000..ee6bba024 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-table.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Table +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Table = tables_db.update_table( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + name = '<NAME>', # optional + permissions = [Permission.read(Role.any())], # optional + row_security = False, # optional + enabled = False, # optional + purge = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..21e039443 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-text-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnText + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnText = tables_db.update_text_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-python/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..999f53b18 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-transaction.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Transaction = tables_db.update_transaction( + transaction_id = '<TRANSACTION_ID>', + commit = False, # optional + rollback = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..2553957d6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-url-column.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnUrl + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnUrl = tables_db.update_url_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'https://example.com', + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-python/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..3f03b42f2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import ColumnVarchar + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: ColumnVarchar = tables_db.update_varchar_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '<KEY>', + required = False, + default = 'Hello World', + size = 1, # optional + new_key = '<NEW_KEY>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/update.md b/examples/2.0.x/server-python/examples/tablesdb/update.md new file mode 100644 index 000000000..aea548588 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/update.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: Database = tables_db.update( + database_id = '<DATABASE_ID>', + name = '<NAME>', # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-python/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..c511545c3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/upsert-row.md @@ -0,0 +1,31 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import Row +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result: Row = tables_db.upsert_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": False + }, # optional + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-python/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..0b6a754e3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tablesdb/upsert-rows.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.models import RowList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result: RowList = tables_db.upsert_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + rows = [], + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/create-membership.md b/examples/2.0.x/server-python/examples/teams/create-membership.md new file mode 100644 index 000000000..313bf5f6a --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/create-membership.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Membership + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Membership = teams.create_membership( + team_id = '<TEAM_ID>', + roles = [], + email = 'email@example.com', # optional + user_id = '<USER_ID>', # optional + phone = '+12065550100', # optional + url = 'https://example.com', # optional + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/create.md b/examples/2.0.x/server-python/examples/teams/create.md new file mode 100644 index 000000000..965d854a2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/create.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Team + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Team = teams.create( + team_id = '<TEAM_ID>', + name = '<NAME>', + roles = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/delete-membership.md b/examples/2.0.x/server-python/examples/teams/delete-membership.md new file mode 100644 index 000000000..2ed97d15b --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/delete-membership.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.delete_membership( + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/teams/delete.md b/examples/2.0.x/server-python/examples/teams/delete.md new file mode 100644 index 000000000..c9a65b370 --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.delete( + team_id = '<TEAM_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/teams/get-membership.md b/examples/2.0.x/server-python/examples/teams/get-membership.md new file mode 100644 index 000000000..54ad0cd34 --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/get-membership.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Membership + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Membership = teams.get_membership( + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/get-prefs.md b/examples/2.0.x/server-python/examples/teams/get-prefs.md new file mode 100644 index 000000000..20ae59624 --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/get-prefs.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Preferences + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Preferences = teams.get_prefs( + team_id = '<TEAM_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/get.md b/examples/2.0.x/server-python/examples/teams/get.md new file mode 100644 index 000000000..3b5116c9e --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Team + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Team = teams.get( + team_id = '<TEAM_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/list-memberships.md b/examples/2.0.x/server-python/examples/teams/list-memberships.md new file mode 100644 index 000000000..8acc9d14b --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/list-memberships.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import MembershipList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: MembershipList = teams.list_memberships( + team_id = '<TEAM_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/list.md b/examples/2.0.x/server-python/examples/teams/list.md new file mode 100644 index 000000000..9fcd1ddb3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import TeamList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: TeamList = teams.list( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/update-membership-status.md b/examples/2.0.x/server-python/examples/teams/update-membership-status.md new file mode 100644 index 000000000..b836d8204 --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/update-membership-status.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Membership + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Membership = teams.update_membership_status( + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>', + user_id = '<USER_ID>', + secret = '<SECRET>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/update-membership.md b/examples/2.0.x/server-python/examples/teams/update-membership.md new file mode 100644 index 000000000..4425ae58d --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/update-membership.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Membership + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Membership = teams.update_membership( + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>', + roles = [] +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/update-name.md b/examples/2.0.x/server-python/examples/teams/update-name.md new file mode 100644 index 000000000..376d6c3fe --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/update-name.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Team + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Team = teams.update_name( + team_id = '<TEAM_ID>', + name = '<NAME>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/teams/update-prefs.md b/examples/2.0.x/server-python/examples/teams/update-prefs.md new file mode 100644 index 000000000..23f487891 --- /dev/null +++ b/examples/2.0.x/server-python/examples/teams/update-prefs.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.teams import Teams +from appwrite.models import Preferences + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result: Preferences = teams.update_prefs( + team_id = '<TEAM_ID>', + prefs = {} +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tokens/create-file-token.md b/examples/2.0.x/server-python/examples/tokens/create-file-token.md new file mode 100644 index 000000000..73ad13559 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tokens/create-file-token.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.tokens import Tokens +from appwrite.models import ResourceToken + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result: ResourceToken = tokens.create_file_token( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + expire = '2020-10-15T06:38:00.000+00:00' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tokens/delete.md b/examples/2.0.x/server-python/examples/tokens/delete.md new file mode 100644 index 000000000..80777fd0d --- /dev/null +++ b/examples/2.0.x/server-python/examples/tokens/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result = tokens.delete( + token_id = '<TOKEN_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/tokens/get.md b/examples/2.0.x/server-python/examples/tokens/get.md new file mode 100644 index 000000000..83a9649a2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tokens/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.tokens import Tokens +from appwrite.models import ResourceToken + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result: ResourceToken = tokens.get( + token_id = '<TOKEN_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tokens/list.md b/examples/2.0.x/server-python/examples/tokens/list.md new file mode 100644 index 000000000..d5700165a --- /dev/null +++ b/examples/2.0.x/server-python/examples/tokens/list.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.tokens import Tokens +from appwrite.models import ResourceTokenList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result: ResourceTokenList = tokens.list( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/tokens/update.md b/examples/2.0.x/server-python/examples/tokens/update.md new file mode 100644 index 000000000..6b5ad4b43 --- /dev/null +++ b/examples/2.0.x/server-python/examples/tokens/update.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.tokens import Tokens +from appwrite.models import ResourceToken + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result: ResourceToken = tokens.update( + token_id = '<TOKEN_ID>', + expire = '2020-10-15T06:38:00.000+00:00' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-argon-2-user.md b/examples/2.0.x/server-python/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..cd3e2bc9e --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-argon-2-user.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.create_argon2_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-python/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..d3ab13e69 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-bcrypt-user.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.create_bcrypt_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-jwt.md b/examples/2.0.x/server-python/examples/users/create-jwt.md new file mode 100644 index 000000000..109ad50a1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-jwt.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import Jwt + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: Jwt = users.create_jwt( + user_id = '<USER_ID>', + session_id = 'recent()', # optional + duration = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-md-5-user.md b/examples/2.0.x/server-python/examples/users/create-md-5-user.md new file mode 100644 index 000000000..53b45bfed --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-md-5-user.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.create_md5_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-python/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..0c83df496 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import MfaRecoveryCodes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: MfaRecoveryCodes = users.create_mfa_recovery_codes( + user_id = '<USER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-python/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..456a04b00 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-ph-pass-user.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.create_ph_pass_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-python/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..e802270b7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.create_scrypt_modified_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + password_salt = '<PASSWORD_SALT>', + password_salt_separator = '<PASSWORD_SALT_SEPARATOR>', + password_signer_key = '<PASSWORD_SIGNER_KEY>', + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-scrypt-user.md b/examples/2.0.x/server-python/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..ecfa60298 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-scrypt-user.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.create_scrypt_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + password_salt = '<PASSWORD_SALT>', + password_cpu = 8, + password_memory = 65536, + password_parallel = 1, + password_length = 64, + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-session.md b/examples/2.0.x/server-python/examples/users/create-session.md new file mode 100644 index 000000000..38a6dbccb --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-session.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import Session + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: Session = users.create_session( + user_id = '<USER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-sha-user.md b/examples/2.0.x/server-python/examples/users/create-sha-user.md new file mode 100644 index 000000000..9d42300a7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-sha-user.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User +from appwrite.enums import PasswordHash + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.create_sha_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + password_version = PasswordHash.SHA1, # optional + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-target.md b/examples/2.0.x/server-python/examples/users/create-target.md new file mode 100644 index 000000000..fcfd394a3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-target.md @@ -0,0 +1,24 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import Target +from appwrite.enums import MessagingProviderType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: Target = users.create_target( + user_id = '<USER_ID>', + target_id = '<TARGET_ID>', + provider_type = MessagingProviderType.EMAIL, + identifier = '<IDENTIFIER>', + provider_id = '<PROVIDER_ID>', # optional + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create-token.md b/examples/2.0.x/server-python/examples/users/create-token.md new file mode 100644 index 000000000..d7520f5ef --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create-token.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import Token + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: Token = users.create_token( + user_id = '<USER_ID>', + length = 4, # optional + expire = 60 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/create.md b/examples/2.0.x/server-python/examples/users/create.md new file mode 100644 index 000000000..0a7a7eeeb --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/create.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.create( + user_id = '<USER_ID>', + email = 'email@example.com', # optional + phone = '+12065550100', # optional + password = 'password', # optional + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/delete-identity.md b/examples/2.0.x/server-python/examples/users/delete-identity.md new file mode 100644 index 000000000..06af66819 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/delete-identity.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_identity( + identity_id = '<IDENTITY_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-python/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..67ab6b788 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.enums import AuthenticatorType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_mfa_authenticator( + user_id = '<USER_ID>', + type = AuthenticatorType.TOTP +) +``` diff --git a/examples/2.0.x/server-python/examples/users/delete-session.md b/examples/2.0.x/server-python/examples/users/delete-session.md new file mode 100644 index 000000000..31ac5246f --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/delete-session.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_session( + user_id = '<USER_ID>', + session_id = '<SESSION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/users/delete-sessions.md b/examples/2.0.x/server-python/examples/users/delete-sessions.md new file mode 100644 index 000000000..c600d4c30 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/delete-sessions.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_sessions( + user_id = '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/users/delete-target.md b/examples/2.0.x/server-python/examples/users/delete-target.md new file mode 100644 index 000000000..6dfbc7e53 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/delete-target.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_target( + user_id = '<USER_ID>', + target_id = '<TARGET_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/users/delete.md b/examples/2.0.x/server-python/examples/users/delete.md new file mode 100644 index 000000000..8d236b4f7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete( + user_id = '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-python/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..8dde75a73 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/get-mfa-challenge.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import MfaChallengeSecret + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: MfaChallengeSecret = users.get_mfa_challenge( + user_id = '<USER_ID>', + challenge_id = '<CHALLENGE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-python/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..058aedde1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import MfaRecoveryCodes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: MfaRecoveryCodes = users.get_mfa_recovery_codes( + user_id = '<USER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/get-prefs.md b/examples/2.0.x/server-python/examples/users/get-prefs.md new file mode 100644 index 000000000..093b92013 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/get-prefs.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import Preferences + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: Preferences = users.get_prefs( + user_id = '<USER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/get-target.md b/examples/2.0.x/server-python/examples/users/get-target.md new file mode 100644 index 000000000..38a7d63d7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/get-target.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import Target + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: Target = users.get_target( + user_id = '<USER_ID>', + target_id = '<TARGET_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/get.md b/examples/2.0.x/server-python/examples/users/get.md new file mode 100644 index 000000000..941d428ae --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.get( + user_id = '<USER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/list-identities.md b/examples/2.0.x/server-python/examples/users/list-identities.md new file mode 100644 index 000000000..c6e7d8dcb --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/list-identities.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import IdentityList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: IdentityList = users.list_identities( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/list-memberships.md b/examples/2.0.x/server-python/examples/users/list-memberships.md new file mode 100644 index 000000000..c64d7ba55 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/list-memberships.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import MembershipList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: MembershipList = users.list_memberships( + user_id = '<USER_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/list-mfa-factors.md b/examples/2.0.x/server-python/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..69f5a56ff --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/list-mfa-factors.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import MfaFactors + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: MfaFactors = users.list_mfa_factors( + user_id = '<USER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/list-sessions.md b/examples/2.0.x/server-python/examples/users/list-sessions.md new file mode 100644 index 000000000..e8abced45 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/list-sessions.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import SessionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: SessionList = users.list_sessions( + user_id = '<USER_ID>', + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/list-targets.md b/examples/2.0.x/server-python/examples/users/list-targets.md new file mode 100644 index 000000000..e043866f3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/list-targets.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import TargetList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: TargetList = users.list_targets( + user_id = '<USER_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/list.md b/examples/2.0.x/server-python/examples/users/list.md new file mode 100644 index 000000000..0d623a776 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import UserList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: UserList = users.list( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-email-verification.md b/examples/2.0.x/server-python/examples/users/update-email-verification.md new file mode 100644 index 000000000..8fd05134e --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-email-verification.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_email_verification( + user_id = '<USER_ID>', + email_verification = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-email.md b/examples/2.0.x/server-python/examples/users/update-email.md new file mode 100644 index 000000000..7dcf066f3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-email.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_email( + user_id = '<USER_ID>', + email = 'email@example.com' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-impersonator.md b/examples/2.0.x/server-python/examples/users/update-impersonator.md new file mode 100644 index 000000000..38fae13ca --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-impersonator.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_impersonator( + user_id = '<USER_ID>', + impersonator = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-labels.md b/examples/2.0.x/server-python/examples/users/update-labels.md new file mode 100644 index 000000000..bffba0c1e --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-labels.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_labels( + user_id = '<USER_ID>', + labels = [] +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-python/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..c9090ee85 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import MfaRecoveryCodes + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: MfaRecoveryCodes = users.update_mfa_recovery_codes( + user_id = '<USER_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-mfa.md b/examples/2.0.x/server-python/examples/users/update-mfa.md new file mode 100644 index 000000000..4dda390c2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-mfa.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_mfa( + user_id = '<USER_ID>', + mfa = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-name.md b/examples/2.0.x/server-python/examples/users/update-name.md new file mode 100644 index 000000000..248411be2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-name.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_name( + user_id = '<USER_ID>', + name = '<NAME>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-password.md b/examples/2.0.x/server-python/examples/users/update-password.md new file mode 100644 index 000000000..d0238ec38 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-password.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_password( + user_id = '<USER_ID>', + password = 'password' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-phone-verification.md b/examples/2.0.x/server-python/examples/users/update-phone-verification.md new file mode 100644 index 000000000..6b3120221 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-phone-verification.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_phone_verification( + user_id = '<USER_ID>', + phone_verification = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-phone.md b/examples/2.0.x/server-python/examples/users/update-phone.md new file mode 100644 index 000000000..82f8e15fe --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-phone.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_phone( + user_id = '<USER_ID>', + number = '+12065550100' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-prefs.md b/examples/2.0.x/server-python/examples/users/update-prefs.md new file mode 100644 index 000000000..6d1f043b1 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-prefs.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import Preferences + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: Preferences = users.update_prefs( + user_id = '<USER_ID>', + prefs = {} +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-status.md b/examples/2.0.x/server-python/examples/users/update-status.md new file mode 100644 index 000000000..fcf8d0e5e --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-status.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import User + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: User = users.update_status( + user_id = '<USER_ID>', + status = False +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/users/update-target.md b/examples/2.0.x/server-python/examples/users/update-target.md new file mode 100644 index 000000000..1a7c5f107 --- /dev/null +++ b/examples/2.0.x/server-python/examples/users/update-target.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.models import Target + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result: Target = users.update_target( + user_id = '<USER_ID>', + target_id = '<TARGET_ID>', + identifier = '<IDENTIFIER>', # optional + provider_id = '<PROVIDER_ID>', # optional + name = '<NAME>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-python/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..793aa3f5d --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/create-collection.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import VectorsdbCollection +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: VectorsdbCollection = vectors_db.create_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + name = '<NAME>', + dimension = 1, + permissions = [Permission.read(Role.any())], # optional + document_security = False, # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/create-document.md b/examples/2.0.x/server-python/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..d5675d864 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/create-document.md @@ -0,0 +1,35 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +vectors_db = VectorsDB(client) + +result: Document = vectors_db.create_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + }, + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-python/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..b84eea6d5 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/create-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: DocumentList = vectors_db.create_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [], + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/create-index.md b/examples/2.0.x/server-python/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..2f5bf2564 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/create-index.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Index +from appwrite.enums import VectorsDBIndexType +from appwrite.enums import OrderBy + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Index = vectors_db.create_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>', + type = VectorsDBIndexType.HNSW_EUCLIDEAN, + attributes = [], + orders = [OrderBy.ASC], # optional + lengths = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-python/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..e19a89363 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/create-operations.md @@ -0,0 +1,29 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Transaction = vectors_db.create_operations( + transaction_id = '<TRANSACTION_ID>', + operations = [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/create-query.md b/examples/2.0.x/server-python/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..093a4653f --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/create-query.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +vectors_db = VectorsDB(client) + +result: DocumentList = vectors_db.create_query( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>', # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-python/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..6b6cd6316 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/create-transaction.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Transaction = vectors_db.create_transaction( + ttl = 60 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/create.md b/examples/2.0.x/server-python/examples/vectorsdb/create.md new file mode 100644 index 000000000..2fe4347f9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/create.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Database = vectors_db.create( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-python/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..b96a628bb --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/delete-collection.md @@ -0,0 +1,16 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result = vectors_db.delete_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-python/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..3915b9379 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +vectors_db = VectorsDB(client) + +result = vectors_db.delete_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + transaction_id = '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-python/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..f1bee6ee3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/delete-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: DocumentList = vectors_db.delete_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-python/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..834b45ccf --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/delete-index.md @@ -0,0 +1,17 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result = vectors_db.delete_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>' +) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-python/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..58a367f73 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result = vectors_db.delete_transaction( + transaction_id = '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/delete.md b/examples/2.0.x/server-python/examples/vectorsdb/delete.md new file mode 100644 index 000000000..da1c5a491 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result = vectors_db.delete( + database_id = '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-python/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..2616d72a2 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/get-collection.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import VectorsdbCollection + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: VectorsdbCollection = vectors_db.get_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/get-document.md b/examples/2.0.x/server-python/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..a484c5ddb --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/get-document.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Document + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +vectors_db = VectorsDB(client) + +result: Document = vectors_db.get_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/get-index.md b/examples/2.0.x/server-python/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..b7a8726b0 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/get-index.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Index + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Index = vectors_db.get_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '<KEY>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-python/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..601ed0b04 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/get-transaction.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Transaction = vectors_db.get_transaction( + transaction_id = '<TRANSACTION_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/get.md b/examples/2.0.x/server-python/examples/vectorsdb/get.md new file mode 100644 index 000000000..b251b427e --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Database = vectors_db.get( + database_id = '<DATABASE_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-python/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..184c3c3f6 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/list-collections.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import VectorsdbCollectionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: VectorsdbCollectionList = vectors_db.list_collections( + database_id = '<DATABASE_ID>', + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-python/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..5ac3ab2fe --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/list-documents.md @@ -0,0 +1,23 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +vectors_db = VectorsDB(client) + +result: DocumentList = vectors_db.list_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + transaction_id = '<TRANSACTION_ID>', # optional + total = False, # optional + ttl = 0 # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-python/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..c72e98002 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/list-indexes.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import IndexList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: IndexList = vectors_db.list_indexes( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-python/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..d21db0122 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/list-transactions.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import TransactionList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: TransactionList = vectors_db.list_transactions( + queries = [] # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/list.md b/examples/2.0.x/server-python/examples/vectorsdb/list.md new file mode 100644 index 000000000..ac87bca38 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/list.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import DatabaseList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: DatabaseList = vectors_db.list( + queries = [], # optional + search = '<SEARCH>', # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-python/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..3dcf8903e --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/update-collection.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import VectorsdbCollection +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: VectorsdbCollection = vectors_db.update_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + name = '<NAME>', + dimension = 1, # optional + permissions = [Permission.read(Role.any())], # optional + document_security = False, # optional + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/update-document.md b/examples/2.0.x/server-python/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..c70c2bc16 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/update-document.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +vectors_db = VectorsDB(client) + +result: Document = vectors_db.update_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = {}, # optional + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-python/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..5c947cd1a --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/update-documents.md @@ -0,0 +1,22 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: DocumentList = vectors_db.update_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + data = {}, # optional + queries = [], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-python/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..276c25c85 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/update-transaction.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Transaction + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Transaction = vectors_db.update_transaction( + transaction_id = '<TRANSACTION_ID>', + commit = False, # optional + rollback = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/update.md b/examples/2.0.x/server-python/examples/vectorsdb/update.md new file mode 100644 index 000000000..c2bcb3dc4 --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/update.md @@ -0,0 +1,20 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Database + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: Database = vectors_db.update( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-python/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..95f916d3e --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/upsert-document.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import Document +from appwrite.permission import Permission +from appwrite.role import Role + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +vectors_db = VectorsDB(client) + +result: Document = vectors_db.upsert_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = {}, # optional + permissions = [Permission.read(Role.any())], # optional + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-python/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..5eb3d2d1a --- /dev/null +++ b/examples/2.0.x/server-python/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,21 @@ +```python +from appwrite.client import Client +from appwrite.services.vectors_db import VectorsDB +from appwrite.models import DocumentList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB(client) + +result: DocumentList = vectors_db.upsert_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [], + transaction_id = '<TRANSACTION_ID>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/webhooks/create.md b/examples/2.0.x/server-python/examples/webhooks/create.md new file mode 100644 index 000000000..ed957a41e --- /dev/null +++ b/examples/2.0.x/server-python/examples/webhooks/create.md @@ -0,0 +1,26 @@ +```python +from appwrite.client import Client +from appwrite.services.webhooks import Webhooks +from appwrite.models import Webhook + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks(client) + +result: Webhook = webhooks.create( + webhook_id = '<WEBHOOK_ID>', + url = 'https://example.com/webhook', + name = '<NAME>', + events = [], + enabled = False, # optional + tls = False, # optional + auth_username = '<AUTH_USERNAME>', # optional + auth_password = 'password', # optional + secret = '<SECRET>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/webhooks/delete.md b/examples/2.0.x/server-python/examples/webhooks/delete.md new file mode 100644 index 000000000..1b6cbdb38 --- /dev/null +++ b/examples/2.0.x/server-python/examples/webhooks/delete.md @@ -0,0 +1,15 @@ +```python +from appwrite.client import Client +from appwrite.services.webhooks import Webhooks + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks(client) + +result = webhooks.delete( + webhook_id = '<WEBHOOK_ID>' +) +``` diff --git a/examples/2.0.x/server-python/examples/webhooks/get.md b/examples/2.0.x/server-python/examples/webhooks/get.md new file mode 100644 index 000000000..e24808ce3 --- /dev/null +++ b/examples/2.0.x/server-python/examples/webhooks/get.md @@ -0,0 +1,18 @@ +```python +from appwrite.client import Client +from appwrite.services.webhooks import Webhooks +from appwrite.models import Webhook + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks(client) + +result: Webhook = webhooks.get( + webhook_id = '<WEBHOOK_ID>' +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/webhooks/list.md b/examples/2.0.x/server-python/examples/webhooks/list.md new file mode 100644 index 000000000..0bb232043 --- /dev/null +++ b/examples/2.0.x/server-python/examples/webhooks/list.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.webhooks import Webhooks +from appwrite.models import WebhookList + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks(client) + +result: WebhookList = webhooks.list( + queries = [], # optional + total = False # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/webhooks/update-secret.md b/examples/2.0.x/server-python/examples/webhooks/update-secret.md new file mode 100644 index 000000000..5e38b24b9 --- /dev/null +++ b/examples/2.0.x/server-python/examples/webhooks/update-secret.md @@ -0,0 +1,19 @@ +```python +from appwrite.client import Client +from appwrite.services.webhooks import Webhooks +from appwrite.models import Webhook + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks(client) + +result: Webhook = webhooks.update_secret( + webhook_id = '<WEBHOOK_ID>', + secret = '<SECRET>' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-python/examples/webhooks/update.md b/examples/2.0.x/server-python/examples/webhooks/update.md new file mode 100644 index 000000000..a6d3ac7b7 --- /dev/null +++ b/examples/2.0.x/server-python/examples/webhooks/update.md @@ -0,0 +1,25 @@ +```python +from appwrite.client import Client +from appwrite.services.webhooks import Webhooks +from appwrite.models import Webhook + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks(client) + +result: Webhook = webhooks.update( + webhook_id = '<WEBHOOK_ID>', + name = '<NAME>', + url = 'https://example.com/webhook', + events = [], + enabled = False, # optional + tls = False, # optional + auth_username = '<AUTH_USERNAME>', # optional + auth_password = 'password' # optional +) + +print(result.model_dump()) +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-anonymous-session.md b/examples/2.0.x/server-rest/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..ea0b5d45e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-anonymous-session.md @@ -0,0 +1,9 @@ +```http +POST /v1/account/sessions/anonymous HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-email-password-session.md b/examples/2.0.x/server-rest/examples/account/create-email-password-session.md new file mode 100644 index 000000000..27068af95 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-email-password-session.md @@ -0,0 +1,13 @@ +```http +POST /v1/account/sessions/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "email": "email@example.com", + "password": "password" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-email-token.md b/examples/2.0.x/server-rest/examples/account/create-email-token.md new file mode 100644 index 000000000..78ef041a0 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-email-token.md @@ -0,0 +1,14 @@ +```http +POST /v1/account/tokens/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "phrase": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-email-verification.md b/examples/2.0.x/server-rest/examples/account/create-email-verification.md new file mode 100644 index 000000000..836b98d78 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-email-verification.md @@ -0,0 +1,12 @@ +```http +POST /v1/account/verifications/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "url": "https://example.com" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-magic-url-token.md b/examples/2.0.x/server-rest/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..29eb52ac5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-magic-url-token.md @@ -0,0 +1,15 @@ +```http +POST /v1/account/tokens/magic-url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "url": "https://example.com", + "phrase": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-rest/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..be21af4b7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-mfa-authenticator.md @@ -0,0 +1,9 @@ +```http +POST /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-rest/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..0175ac0e6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-mfa-challenge.md @@ -0,0 +1,12 @@ +```http +POST /v1/account/mfa/challenges HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "factor": "email" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-rest/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..16c75df10 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```http +POST /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-rest/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..b19a35c01 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-o-auth-2-token.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/tokens/oauth2/{provider} HTTP/1.1 +Host: cloud.appwrite.io +Accept: text/html +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-phone-token.md b/examples/2.0.x/server-rest/examples/account/create-phone-token.md new file mode 100644 index 000000000..b1d2bb78d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-phone-token.md @@ -0,0 +1,13 @@ +```http +POST /v1/account/tokens/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "phone": "+12065550100" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-phone-verification.md b/examples/2.0.x/server-rest/examples/account/create-phone-verification.md new file mode 100644 index 000000000..e14cfad29 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-phone-verification.md @@ -0,0 +1,9 @@ +```http +POST /v1/account/verifications/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-recovery.md b/examples/2.0.x/server-rest/examples/account/create-recovery.md new file mode 100644 index 000000000..eb5b43a9b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-recovery.md @@ -0,0 +1,13 @@ +```http +POST /v1/account/recovery HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "email": "email@example.com", + "url": "https://example.com" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-session.md b/examples/2.0.x/server-rest/examples/account/create-session.md new file mode 100644 index 000000000..751a63df9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-session.md @@ -0,0 +1,13 @@ +```http +POST /v1/account/sessions/token HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create-verification.md b/examples/2.0.x/server-rest/examples/account/create-verification.md new file mode 100644 index 000000000..836b98d78 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create-verification.md @@ -0,0 +1,12 @@ +```http +POST /v1/account/verifications/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "url": "https://example.com" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/create.md b/examples/2.0.x/server-rest/examples/account/create.md new file mode 100644 index 000000000..df2538b89 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/create.md @@ -0,0 +1,15 @@ +```http +POST /v1/account HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/delete-identity.md b/examples/2.0.x/server-rest/examples/account/delete-identity.md new file mode 100644 index 000000000..f20de5903 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/delete-identity.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/identities/{identityId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-rest/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..cbd62a55a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/delete-session.md b/examples/2.0.x/server-rest/examples/account/delete-session.md new file mode 100644 index 000000000..cbb8c40c8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/delete-session.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/delete-sessions.md b/examples/2.0.x/server-rest/examples/account/delete-sessions.md new file mode 100644 index 000000000..f36a3a5e5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/delete-sessions.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/account/sessions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-rest/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..c4a6af661 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/account/get-prefs.md b/examples/2.0.x/server-rest/examples/account/get-prefs.md new file mode 100644 index 000000000..6d7f3cf50 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/get-prefs.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/prefs HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/account/get-session.md b/examples/2.0.x/server-rest/examples/account/get-session.md new file mode 100644 index 000000000..c97eb6b89 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/get-session.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/account/get.md b/examples/2.0.x/server-rest/examples/account/get.md new file mode 100644 index 000000000..c4a692e47 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/account HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/account/list-identities.md b/examples/2.0.x/server-rest/examples/account/list-identities.md new file mode 100644 index 000000000..1a29c60c5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/list-identities.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/identities HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/account/list-mfa-factors.md b/examples/2.0.x/server-rest/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..20da67a89 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/list-mfa-factors.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/mfa/factors HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/account/list-sessions.md b/examples/2.0.x/server-rest/examples/account/list-sessions.md new file mode 100644 index 000000000..dd1d1e773 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/list-sessions.md @@ -0,0 +1,7 @@ +```http +GET /v1/account/sessions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-email-verification.md b/examples/2.0.x/server-rest/examples/account/update-email-verification.md new file mode 100644 index 000000000..fb7c4c18c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-email-verification.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/verifications/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-email.md b/examples/2.0.x/server-rest/examples/account/update-email.md new file mode 100644 index 000000000..38120d9bb --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-email.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/account/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "email": "email@example.com", + "password": "password" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-magic-url-session.md b/examples/2.0.x/server-rest/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..5f9ed0a6b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-magic-url-session.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/sessions/magic-url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-rest/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..bbf28b896 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-mfa-authenticator.md @@ -0,0 +1,12 @@ +```http +PUT /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "otp": "<OTP>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-rest/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..3096e977b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-mfa-challenge.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/mfa/challenges HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "challengeId": "<CHALLENGE_ID>", + "otp": "<OTP>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-rest/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..489692edb --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-mfa.md b/examples/2.0.x/server-rest/examples/account/update-mfa.md new file mode 100644 index 000000000..a1258bc74 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-mfa.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/account/mfa HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "mfa": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-name.md b/examples/2.0.x/server-rest/examples/account/update-name.md new file mode 100644 index 000000000..558df6398 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-name.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/account/name HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-password.md b/examples/2.0.x/server-rest/examples/account/update-password.md new file mode 100644 index 000000000..963f4b8f7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-password.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/account/password HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "password": "password", + "oldPassword": "password" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-phone-session.md b/examples/2.0.x/server-rest/examples/account/update-phone-session.md new file mode 100644 index 000000000..bccc8ca2b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-phone-session.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/sessions/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-phone-verification.md b/examples/2.0.x/server-rest/examples/account/update-phone-verification.md new file mode 100644 index 000000000..6b8079122 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-phone-verification.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/verifications/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-phone.md b/examples/2.0.x/server-rest/examples/account/update-phone.md new file mode 100644 index 000000000..ca021eb09 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-phone.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/account/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "phone": "+12065550100", + "password": "password" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-prefs.md b/examples/2.0.x/server-rest/examples/account/update-prefs.md new file mode 100644 index 000000000..b6d238ea9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-prefs.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/account/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "prefs": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-recovery.md b/examples/2.0.x/server-rest/examples/account/update-recovery.md new file mode 100644 index 000000000..c8cda2d89 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +```http +PUT /v1/account/recovery HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>", + "password": "password" +} +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-session.md b/examples/2.0.x/server-rest/examples/account/update-session.md new file mode 100644 index 000000000..7b291854a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-session.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-status.md b/examples/2.0.x/server-rest/examples/account/update-status.md new file mode 100644 index 000000000..305c445ce --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-status.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/account/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/account/update-verification.md b/examples/2.0.x/server-rest/examples/account/update-verification.md new file mode 100644 index 000000000..fb7c4c18c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/account/update-verification.md @@ -0,0 +1,13 @@ +```http +PUT /v1/account/verifications/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/advisor/delete-report.md b/examples/2.0.x/server-rest/examples/advisor/delete-report.md new file mode 100644 index 000000000..72ae6a1ff --- /dev/null +++ b/examples/2.0.x/server-rest/examples/advisor/delete-report.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/reports/{reportId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/advisor/get-insight.md b/examples/2.0.x/server-rest/examples/advisor/get-insight.md new file mode 100644 index 000000000..2f6a344f6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/advisor/get-insight.md @@ -0,0 +1,7 @@ +```http +GET /v1/reports/{reportId}/insights/{insightId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/advisor/get-report.md b/examples/2.0.x/server-rest/examples/advisor/get-report.md new file mode 100644 index 000000000..497319940 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/advisor/get-report.md @@ -0,0 +1,7 @@ +```http +GET /v1/reports/{reportId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/advisor/list-insights.md b/examples/2.0.x/server-rest/examples/advisor/list-insights.md new file mode 100644 index 000000000..cae7f770e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/advisor/list-insights.md @@ -0,0 +1,7 @@ +```http +GET /v1/reports/{reportId}/insights HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/advisor/list-reports.md b/examples/2.0.x/server-rest/examples/advisor/list-reports.md new file mode 100644 index 000000000..933b58dd8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/advisor/list-reports.md @@ -0,0 +1,7 @@ +```http +GET /v1/reports HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-browser.md b/examples/2.0.x/server-rest/examples/avatars/get-browser.md new file mode 100644 index 000000000..adb7e9e05 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-browser.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/browsers/{code} HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-credit-card.md b/examples/2.0.x/server-rest/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..231313784 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-credit-card.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/credit-cards/{code} HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-favicon.md b/examples/2.0.x/server-rest/examples/avatars/get-favicon.md new file mode 100644 index 000000000..992b27fea --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-favicon.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/favicon HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-flag.md b/examples/2.0.x/server-rest/examples/avatars/get-flag.md new file mode 100644 index 000000000..757490c64 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-flag.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/flags/{code} HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-image.md b/examples/2.0.x/server-rest/examples/avatars/get-image.md new file mode 100644 index 000000000..9a459b65f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-image.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/image HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-initials.md b/examples/2.0.x/server-rest/examples/avatars/get-initials.md new file mode 100644 index 000000000..ac4620ba5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-initials.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/initials HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-photo.md b/examples/2.0.x/server-rest/examples/avatars/get-photo.md new file mode 100644 index 000000000..1b7340662 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-photo.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/photo HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-qr.md b/examples/2.0.x/server-rest/examples/avatars/get-qr.md new file mode 100644 index 000000000..68211b899 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-qr.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/qr HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/avatars/get-screenshot.md b/examples/2.0.x/server-rest/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..1663cbe5c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/avatars/get-screenshot.md @@ -0,0 +1,7 @@ +```http +GET /v1/avatars/screenshots HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/png +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..98ae6ef26 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-big-int-attribute.md @@ -0,0 +1,17 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/bigint HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "min": 0, + "max": 1000000, + "default": 0, + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..df9325c8a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-boolean-attribute.md @@ -0,0 +1,15 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/boolean HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": false, + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-collection.md b/examples/2.0.x/server-rest/examples/databases/create-collection.md new file mode 100644 index 000000000..b2f7b06fa --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-collection.md @@ -0,0 +1,18 @@ +```http +POST /v1/databases/{databaseId}/collections HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "collectionId": "<COLLECTION_ID>", + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "documentSecurity": false, + "enabled": false, + "attributes": [], + "indexes": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..cd33a5bc6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-datetime-attribute.md @@ -0,0 +1,15 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/datetime HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "2020-10-15T06:38:00.000+00:00", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-document.md b/examples/2.0.x/server-rest/examples/databases/create-document.md new file mode 100644 index 000000000..6223bba6f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-document.md @@ -0,0 +1,21 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documentId": "<DOCUMENT_ID>", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-documents.md b/examples/2.0.x/server-rest/examples/databases/create-documents.md new file mode 100644 index 000000000..3b5740566 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-documents.md @@ -0,0 +1,13 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documents": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-email-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..d50145220 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-email-attribute.md @@ -0,0 +1,15 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "email@example.com", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..d4475699d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-enum-attribute.md @@ -0,0 +1,16 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/enum HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "elements": ["active", "inactive"], + "required": false, + "default": "active", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-float-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..9803275e1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-float-attribute.md @@ -0,0 +1,17 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/float HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "min": 0, + "max": 100, + "default": 10.5, + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-index.md b/examples/2.0.x/server-rest/examples/databases/create-index.md new file mode 100644 index 000000000..8950e9160 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-index.md @@ -0,0 +1,16 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "type": "key", + "attributes": [], + "orders": [], + "lengths": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..498c4eaf8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-integer-attribute.md @@ -0,0 +1,17 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/integer HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "min": 0, + "max": 100, + "default": 10, + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..f546028c1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-ip-attribute.md @@ -0,0 +1,15 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/ip HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "192.0.2.0", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-line-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..966bfc6e6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-line-attribute.md @@ -0,0 +1,14 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/line HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": [[1, 2], [3, 4], [5, 6]] +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..20aa9518e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-longtext-attribute.md @@ -0,0 +1,16 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/longtext HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..bfc49dda6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,16 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-operations.md b/examples/2.0.x/server-rest/examples/databases/create-operations.md new file mode 100644 index 000000000..b493a86ad --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/databases/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "operations": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-point-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..87738ac92 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-point-attribute.md @@ -0,0 +1,14 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/point HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": [1, 2] +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..d59c3d8b5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-polygon-attribute.md @@ -0,0 +1,14 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/polygon HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": [[[1, 2], [3, 4], [5, 6], [1, 2]]] +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..e555bdb6e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-relationship-attribute.md @@ -0,0 +1,17 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/relationship HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "relatedCollectionId": "<RELATED_COLLECTION_ID>", + "type": "oneToOne", + "twoWay": false, + "key": "<KEY>", + "twoWayKey": "<TWO_WAY_KEY>", + "onDelete": "cascade" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-string-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..041f700ed --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-string-attribute.md @@ -0,0 +1,17 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/string HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "size": 1, + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-text-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..e6441109d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-text-attribute.md @@ -0,0 +1,16 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/text HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-transaction.md b/examples/2.0.x/server-rest/examples/databases/create-transaction.md new file mode 100644 index 000000000..f6373fb35 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/databases/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-url-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..1f96b045d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-url-attribute.md @@ -0,0 +1,15 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "https://example.com", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-rest/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..e45621300 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create-varchar-attribute.md @@ -0,0 +1,17 @@ +```http +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/varchar HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "size": 1, + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/create.md b/examples/2.0.x/server-rest/examples/databases/create.md new file mode 100644 index 000000000..67345f4a7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/create.md @@ -0,0 +1,14 @@ +```http +POST /v1/databases HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "databaseId": "<DATABASE_ID>", + "name": "<NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-rest/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..d0a33a2b7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/decrement-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "value": 1, + "min": 0, + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/delete-attribute.md b/examples/2.0.x/server-rest/examples/databases/delete-attribute.md new file mode 100644 index 000000000..76245034e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/delete-attribute.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/databases/{databaseId}/collections/{collectionId}/attributes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/databases/delete-collection.md b/examples/2.0.x/server-rest/examples/databases/delete-collection.md new file mode 100644 index 000000000..e67adb76c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/delete-collection.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/databases/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/databases/delete-document.md b/examples/2.0.x/server-rest/examples/databases/delete-document.md new file mode 100644 index 000000000..e6a63d179 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/delete-document.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/databases/delete-documents.md b/examples/2.0.x/server-rest/examples/databases/delete-documents.md new file mode 100644 index 000000000..6b9b773de --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/delete-documents.md @@ -0,0 +1,9 @@ +```http +DELETE /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/databases/delete-index.md b/examples/2.0.x/server-rest/examples/databases/delete-index.md new file mode 100644 index 000000000..faf8c77ad --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/delete-index.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/databases/{databaseId}/collections/{collectionId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/databases/delete-transaction.md b/examples/2.0.x/server-rest/examples/databases/delete-transaction.md new file mode 100644 index 000000000..3b1d23f48 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/databases/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/databases/delete.md b/examples/2.0.x/server-rest/examples/databases/delete.md new file mode 100644 index 000000000..88a928a82 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/databases/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/databases/get-attribute.md b/examples/2.0.x/server-rest/examples/databases/get-attribute.md new file mode 100644 index 000000000..1f0a32e37 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/get-attribute.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId}/attributes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/get-collection.md b/examples/2.0.x/server-rest/examples/databases/get-collection.md new file mode 100644 index 000000000..83123fae9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/get-collection.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/get-document.md b/examples/2.0.x/server-rest/examples/databases/get-document.md new file mode 100644 index 000000000..61d3e7135 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/get-document.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/get-index.md b/examples/2.0.x/server-rest/examples/databases/get-index.md new file mode 100644 index 000000000..d59356b55 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/get-index.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/get-transaction.md b/examples/2.0.x/server-rest/examples/databases/get-transaction.md new file mode 100644 index 000000000..aaf5dca7a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/get.md b/examples/2.0.x/server-rest/examples/databases/get.md new file mode 100644 index 000000000..c0e6ee453 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-rest/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..4beabd693 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/increment-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "value": 1, + "max": 100, + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/list-attributes.md b/examples/2.0.x/server-rest/examples/databases/list-attributes.md new file mode 100644 index 000000000..541397261 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/list-attributes.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId}/attributes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/list-collections.md b/examples/2.0.x/server-rest/examples/databases/list-collections.md new file mode 100644 index 000000000..6b97db935 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/list-collections.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/list-documents.md b/examples/2.0.x/server-rest/examples/databases/list-documents.md new file mode 100644 index 000000000..5a5e34f17 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/list-documents.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/list-indexes.md b/examples/2.0.x/server-rest/examples/databases/list-indexes.md new file mode 100644 index 000000000..a019a6cc9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/list-indexes.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/{databaseId}/collections/{collectionId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/list-transactions.md b/examples/2.0.x/server-rest/examples/databases/list-transactions.md new file mode 100644 index 000000000..7672296f8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/list.md b/examples/2.0.x/server-rest/examples/databases/list.md new file mode 100644 index 000000000..c2a2f195e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/databases HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..cb9644fd1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-big-int-attribute.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/bigint/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "min": 0, + "max": 1000000, + "default": 0, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..ec5dbfd3c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-boolean-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": false, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-collection.md b/examples/2.0.x/server-rest/examples/databases/update-collection.md new file mode 100644 index 000000000..851274471 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-collection.md @@ -0,0 +1,16 @@ +```http +PUT /v1/databases/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "documentSecurity": false, + "enabled": false, + "purge": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..63c30ddf1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-datetime-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "2020-10-15T06:38:00.000+00:00", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-document.md b/examples/2.0.x/server-rest/examples/databases/update-document.md new file mode 100644 index 000000000..804f30e35 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-document.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-documents.md b/examples/2.0.x/server-rest/examples/databases/update-documents.md new file mode 100644 index 000000000..f8d257bba --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-documents.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, + "queries": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-email-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..40755a006 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-email-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/email/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "email@example.com", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..a256e913c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-enum-attribute.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "elements": ["active", "inactive"], + "required": false, + "default": "active", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-float-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..e78cc686f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-float-attribute.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/float/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "min": 0, + "max": 100, + "default": 10.5, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..2fbf3a60b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-integer-attribute.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "min": 0, + "max": 100, + "default": 10, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..7541e10a9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-ip-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "192.0.2.0", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-line-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..2e2b7c917 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-line-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/line/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": [[1, 2], [3, 4], [5, 6]], + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..9c9da3964 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-longtext-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..24cb4e22a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-point-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..fd8393021 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-point-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/point/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": [1, 2], + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..5102bc667 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-polygon-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": [[[1, 2], [3, 4], [5, 6], [1, 2]]], + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..74de82077 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-relationship-attribute.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "onDelete": "cascade", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-string-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..7eb7c4216 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-string-attribute.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/string/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "size": 1, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-text-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..871b379f9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-text-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/text/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-transaction.md b/examples/2.0.x/server-rest/examples/databases/update-transaction.md new file mode 100644 index 000000000..bf8d85ac0 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/databases/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-url-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..d7c189475 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-url-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/url/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "https://example.com", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-rest/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..dbc6e8a0f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update-varchar-attribute.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "size": 1, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/update.md b/examples/2.0.x/server-rest/examples/databases/update.md new file mode 100644 index 000000000..c61807666 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/update.md @@ -0,0 +1,13 @@ +```http +PUT /v1/databases/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/upsert-document.md b/examples/2.0.x/server-rest/examples/databases/upsert-document.md new file mode 100644 index 000000000..509973400 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/upsert-document.md @@ -0,0 +1,20 @@ +```http +PUT /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/databases/upsert-documents.md b/examples/2.0.x/server-rest/examples/databases/upsert-documents.md new file mode 100644 index 000000000..8ae245127 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/databases/upsert-documents.md @@ -0,0 +1,13 @@ +```http +PUT /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documents": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/create-collection.md b/examples/2.0.x/server-rest/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..cb373c273 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/create-collection.md @@ -0,0 +1,18 @@ +```http +POST /v1/documentsdb/{databaseId}/collections HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "collectionId": "<COLLECTION_ID>", + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "documentSecurity": false, + "enabled": false, + "attributes": [], + "indexes": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/create-document.md b/examples/2.0.x/server-rest/examples/documentsdb/create-document.md new file mode 100644 index 000000000..52d8070c5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/create-document.md @@ -0,0 +1,21 @@ +```http +POST /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documentId": "<DOCUMENT_ID>", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/create-documents.md b/examples/2.0.x/server-rest/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..eaabe5614 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/create-documents.md @@ -0,0 +1,13 @@ +```http +POST /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documents": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/create-index.md b/examples/2.0.x/server-rest/examples/documentsdb/create-index.md new file mode 100644 index 000000000..8040045d6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/create-index.md @@ -0,0 +1,16 @@ +```http +POST /v1/documentsdb/{databaseId}/collections/{collectionId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "type": "key", + "attributes": [], + "orders": [], + "lengths": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/create-operations.md b/examples/2.0.x/server-rest/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..1dcd46628 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/documentsdb/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "operations": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-rest/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..0bfd5284d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/documentsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/create.md b/examples/2.0.x/server-rest/examples/documentsdb/create.md new file mode 100644 index 000000000..989d7e9e2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/create.md @@ -0,0 +1,14 @@ +```http +POST /v1/documentsdb HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "databaseId": "<DATABASE_ID>", + "name": "<NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-rest/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..14814b79b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "value": 1, + "min": 0, + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-rest/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..f60e013af --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/delete-collection.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/delete-document.md b/examples/2.0.x/server-rest/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..e22b30f85 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/delete-document.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-rest/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..f80979473 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/delete-documents.md @@ -0,0 +1,9 @@ +```http +DELETE /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/delete-index.md b/examples/2.0.x/server-rest/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..2b79fe895 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/delete-index.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-rest/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..a8458e709 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/delete.md b/examples/2.0.x/server-rest/examples/documentsdb/delete.md new file mode 100644 index 000000000..b40acc819 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/documentsdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/get-collection.md b/examples/2.0.x/server-rest/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..2fb219d2b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/get-collection.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/get-document.md b/examples/2.0.x/server-rest/examples/documentsdb/get-document.md new file mode 100644 index 000000000..179693312 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/get-document.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/get-index.md b/examples/2.0.x/server-rest/examples/documentsdb/get-index.md new file mode 100644 index 000000000..8a8c10c1b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/get-index.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-rest/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..9495d52d2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/get.md b/examples/2.0.x/server-rest/examples/documentsdb/get.md new file mode 100644 index 000000000..74869a2bf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-rest/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..22e65a9ec --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "value": 1, + "max": 100, + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/list-collections.md b/examples/2.0.x/server-rest/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..4e5f24fd2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/list-collections.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/list-documents.md b/examples/2.0.x/server-rest/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..e9e706462 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/list-documents.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-rest/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..cb196a629 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/list-indexes.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/{databaseId}/collections/{collectionId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-rest/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..c030724dd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/list.md b/examples/2.0.x/server-rest/examples/documentsdb/list.md new file mode 100644 index 000000000..07cd1f01b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/documentsdb HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/update-collection.md b/examples/2.0.x/server-rest/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..7ccf4b924 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/update-collection.md @@ -0,0 +1,16 @@ +```http +PUT /v1/documentsdb/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "documentSecurity": false, + "enabled": false, + "purge": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/update-document.md b/examples/2.0.x/server-rest/examples/documentsdb/update-document.md new file mode 100644 index 000000000..5b4583400 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/update-document.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/update-documents.md b/examples/2.0.x/server-rest/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..4cef54967 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/update-documents.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": {}, + "queries": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-rest/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..b23d949bb --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/documentsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/update.md b/examples/2.0.x/server-rest/examples/documentsdb/update.md new file mode 100644 index 000000000..95e86a212 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/update.md @@ -0,0 +1,13 @@ +```http +PUT /v1/documentsdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-rest/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..378f7c20b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/upsert-document.md @@ -0,0 +1,14 @@ +```http +PUT /v1/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-rest/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..86e1fa594 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/documentsdb/upsert-documents.md @@ -0,0 +1,13 @@ +```http +PUT /v1/documentsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documents": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-rest/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..51fc8ddcb --- /dev/null +++ b/examples/2.0.x/server-rest/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,13 @@ +```http +POST /v1/embeddings/text HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "texts": [], + "model": "nomic-embed-text" +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/create-deployment.md b/examples/2.0.x/server-rest/examples/functions/create-deployment.md new file mode 100644 index 000000000..6e68254ea --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/create-deployment.md @@ -0,0 +1,31 @@ +```http +POST /v1/functions/{functionId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="entrypoint" + +"<ENTRYPOINT>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="commands" + +"<COMMANDS>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="code" + +cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16... + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="activate" + +false + +--cec8e8123c05ba25-- +``` diff --git a/examples/2.0.x/server-rest/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-rest/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..fa0b531ab --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,13 @@ +```http +POST /v1/functions/{functionId}/deployments/duplicate HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "deploymentId": "<DEPLOYMENT_ID>", + "buildId": "<BUILD_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/create-execution.md b/examples/2.0.x/server-rest/examples/functions/create-execution.md new file mode 100644 index 000000000..9ca901db6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/create-execution.md @@ -0,0 +1,17 @@ +```http +POST /v1/functions/{functionId}/executions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "body": "<BODY>", + "async": false, + "path": "<PATH>", + "method": "GET", + "headers": {}, + "scheduledAt": "<SCHEDULED_AT>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/create-template-deployment.md b/examples/2.0.x/server-rest/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..50dc075f6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/create-template-deployment.md @@ -0,0 +1,17 @@ +```http +POST /v1/functions/{functionId}/deployments/template HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "repository": "<REPOSITORY>", + "owner": "<OWNER>", + "rootDirectory": "<ROOT_DIRECTORY>", + "type": "commit", + "reference": "<REFERENCE>", + "activate": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/create-variable.md b/examples/2.0.x/server-rest/examples/functions/create-variable.md new file mode 100644 index 000000000..483bf209d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/create-variable.md @@ -0,0 +1,15 @@ +```http +POST /v1/functions/{functionId}/variables HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "variableId": "<VARIABLE_ID>", + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-rest/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..e9182eff3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/create-vcs-deployment.md @@ -0,0 +1,14 @@ +```http +POST /v1/functions/{functionId}/deployments/vcs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "type": "branch", + "reference": "<REFERENCE>", + "activate": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/create.md b/examples/2.0.x/server-rest/examples/functions/create.md new file mode 100644 index 000000000..ea84be987 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/create.md @@ -0,0 +1,33 @@ +```http +POST /v1/functions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "functionId": "<FUNCTION_ID>", + "name": "<NAME>", + "runtime": "node-14.5", + "execute": ["any"], + "events": [], + "schedule": "0 0 * * *", + "timeout": 1, + "enabled": false, + "logging": false, + "entrypoint": "<ENTRYPOINT>", + "commands": "<COMMANDS>", + "scopes": [], + "installationId": "<INSTALLATION_ID>", + "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", + "providerBranch": "<PROVIDER_BRANCH>", + "providerSilentMode": false, + "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", + "providerBranches": [], + "providerPaths": [], + "buildSpecification": "s-1vcpu-512mb", + "runtimeSpecification": "s-1vcpu-512mb", + "deploymentRetention": 0 +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/delete-deployment.md b/examples/2.0.x/server-rest/examples/functions/delete-deployment.md new file mode 100644 index 000000000..08b2394d3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/delete-deployment.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/functions/{functionId}/deployments/{deploymentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/functions/delete-execution.md b/examples/2.0.x/server-rest/examples/functions/delete-execution.md new file mode 100644 index 000000000..79e81423a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/delete-execution.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/functions/{functionId}/executions/{executionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/functions/delete-variable.md b/examples/2.0.x/server-rest/examples/functions/delete-variable.md new file mode 100644 index 000000000..6eee722be --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/delete-variable.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/functions/{functionId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/functions/delete.md b/examples/2.0.x/server-rest/examples/functions/delete.md new file mode 100644 index 000000000..44c93ffcc --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/functions/{functionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/functions/get-deployment-download.md b/examples/2.0.x/server-rest/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..51e38904a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/get-deployment-download.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/deployments/{deploymentId}/download HTTP/1.1 +Host: cloud.appwrite.io +Accept: */* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/get-deployment.md b/examples/2.0.x/server-rest/examples/functions/get-deployment.md new file mode 100644 index 000000000..0c7527d7a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/get-deployment.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/deployments/{deploymentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/get-execution.md b/examples/2.0.x/server-rest/examples/functions/get-execution.md new file mode 100644 index 000000000..84d9079f1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/get-execution.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/executions/{executionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/get-variable.md b/examples/2.0.x/server-rest/examples/functions/get-variable.md new file mode 100644 index 000000000..51e405513 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/get-variable.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/get.md b/examples/2.0.x/server-rest/examples/functions/get.md new file mode 100644 index 000000000..58641637e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/list-deployments.md b/examples/2.0.x/server-rest/examples/functions/list-deployments.md new file mode 100644 index 000000000..a345d4326 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/list-deployments.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/list-executions.md b/examples/2.0.x/server-rest/examples/functions/list-executions.md new file mode 100644 index 000000000..38c3c32ee --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/list-executions.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/executions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/list-runtimes.md b/examples/2.0.x/server-rest/examples/functions/list-runtimes.md new file mode 100644 index 000000000..ee96e25a4 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/list-runtimes.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/runtimes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/list-specifications.md b/examples/2.0.x/server-rest/examples/functions/list-specifications.md new file mode 100644 index 000000000..efcd7bb44 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/list-specifications.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/specifications HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/list-variables.md b/examples/2.0.x/server-rest/examples/functions/list-variables.md new file mode 100644 index 000000000..449c75a1e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/list-variables.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions/{functionId}/variables HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/list.md b/examples/2.0.x/server-rest/examples/functions/list.md new file mode 100644 index 000000000..afaa87d8d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/functions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/functions/update-deployment-status.md b/examples/2.0.x/server-rest/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..8fe9ad4de --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/update-deployment-status.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/functions/{functionId}/deployments/{deploymentId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/functions/update-function-deployment.md b/examples/2.0.x/server-rest/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..10ca194fa --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/update-function-deployment.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/functions/{functionId}/deployment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "deploymentId": "<DEPLOYMENT_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/update-variable.md b/examples/2.0.x/server-rest/examples/functions/update-variable.md new file mode 100644 index 000000000..3b3cc4292 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/update-variable.md @@ -0,0 +1,14 @@ +```http +PUT /v1/functions/{functionId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/functions/update.md b/examples/2.0.x/server-rest/examples/functions/update.md new file mode 100644 index 000000000..972b9524b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/functions/update.md @@ -0,0 +1,32 @@ +```http +PUT /v1/functions/{functionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "runtime": "node-14.5", + "execute": ["any"], + "events": [], + "schedule": "0 0 * * *", + "timeout": 1, + "enabled": false, + "logging": false, + "entrypoint": "<ENTRYPOINT>", + "commands": "<COMMANDS>", + "scopes": [], + "installationId": "<INSTALLATION_ID>", + "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", + "providerBranch": "<PROVIDER_BRANCH>", + "providerSilentMode": false, + "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", + "providerBranches": [], + "providerPaths": [], + "buildSpecification": "s-1vcpu-512mb", + "runtimeSpecification": "s-1vcpu-512mb", + "deploymentRetention": 0 +} +``` diff --git a/examples/2.0.x/server-rest/examples/graphql/mutation.md b/examples/2.0.x/server-rest/examples/graphql/mutation.md new file mode 100644 index 000000000..a51586e9d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +```http +POST /v1/graphql/mutation HTTP/1.1 +Host: cloud.appwrite.io +X-Sdk-Graphql: true +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "query": {} +} +``` diff --git a/examples/2.0.x/server-rest/examples/graphql/query.md b/examples/2.0.x/server-rest/examples/graphql/query.md new file mode 100644 index 000000000..5029a563a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/graphql/query.md @@ -0,0 +1,13 @@ +```http +POST /v1/graphql HTTP/1.1 +Host: cloud.appwrite.io +X-Sdk-Graphql: true +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "query": {} +} +``` diff --git a/examples/2.0.x/server-rest/examples/locale/get.md b/examples/2.0.x/server-rest/examples/locale/get.md new file mode 100644 index 000000000..1cfc91844 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/locale/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/locale/list-codes.md b/examples/2.0.x/server-rest/examples/locale/list-codes.md new file mode 100644 index 000000000..2ecd3d7ef --- /dev/null +++ b/examples/2.0.x/server-rest/examples/locale/list-codes.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/codes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/locale/list-continents.md b/examples/2.0.x/server-rest/examples/locale/list-continents.md new file mode 100644 index 000000000..7360f173d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/locale/list-continents.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/continents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/locale/list-countries-eu.md b/examples/2.0.x/server-rest/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..2038e634f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/locale/list-countries-eu.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/countries/eu HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/locale/list-countries-phones.md b/examples/2.0.x/server-rest/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..268286470 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/locale/list-countries-phones.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/countries/phones HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/locale/list-countries.md b/examples/2.0.x/server-rest/examples/locale/list-countries.md new file mode 100644 index 000000000..b59569e66 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/locale/list-countries.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/countries HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/locale/list-currencies.md b/examples/2.0.x/server-rest/examples/locale/list-currencies.md new file mode 100644 index 000000000..d4fe982d1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/locale/list-currencies.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/currencies HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/locale/list-languages.md b/examples/2.0.x/server-rest/examples/locale/list-languages.md new file mode 100644 index 000000000..919c40e45 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/locale/list-languages.md @@ -0,0 +1,7 @@ +```http +GET /v1/locale/languages HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..b81e80b3c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-apns-provider.md @@ -0,0 +1,19 @@ +```http +POST /v1/messaging/providers/apns HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "authKey": "<AUTH_KEY>", + "authKeyId": "<AUTH_KEY_ID>", + "teamId": "<TEAM_ID>", + "bundleId": "<BUNDLE_ID>", + "sandbox": false, + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-email.md b/examples/2.0.x/server-rest/examples/messaging/create-email.md new file mode 100644 index 000000000..8b8846e7e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-email.md @@ -0,0 +1,23 @@ +```http +POST /v1/messaging/messages/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "messageId": "<MESSAGE_ID>", + "subject": "<SUBJECT>", + "content": "<CONTENT>", + "topics": [], + "users": [], + "targets": [], + "cc": [], + "bcc": [], + "attachments": [], + "draft": false, + "html": false, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..78dc807ea --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-fcm-provider.md @@ -0,0 +1,15 @@ +```http +POST /v1/messaging/providers/fcm HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "serviceAccountJSON": {}, + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..869659757 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,21 @@ +```http +POST /v1/messaging/providers/mailgun HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "apiKey": "<API_KEY>", + "domain": "example.com", + "isEuRegion": false, + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "email@example.com", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..deba611bc --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,17 @@ +```http +POST /v1/messaging/providers/msg91 HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "templateId": "<TEMPLATE_ID>", + "senderId": "<SENDER_ID>", + "authKey": "<AUTH_KEY>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-push.md b/examples/2.0.x/server-rest/examples/messaging/create-push.md new file mode 100644 index 000000000..58d1875a6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-push.md @@ -0,0 +1,30 @@ +```http +POST /v1/messaging/messages/push HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "messageId": "<MESSAGE_ID>", + "title": "<TITLE>", + "body": "<BODY>", + "topics": [], + "users": [], + "targets": [], + "data": {}, + "action": "<ACTION>", + "image": "<ID1:ID2>", + "icon": "<ICON>", + "sound": "<SOUND>", + "color": "<COLOR>", + "tag": "<TAG>", + "badge": 1, + "draft": false, + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "contentAvailable": false, + "critical": false, + "priority": "normal" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..7326ad324 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-resend-provider.md @@ -0,0 +1,19 @@ +```http +POST /v1/messaging/providers/resend HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "apiKey": "<API_KEY>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "email@example.com", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..57ccc4889 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,19 @@ +```http +POST /v1/messaging/providers/sendgrid HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "apiKey": "<API_KEY>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "email@example.com", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..b42d60c45 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-ses-provider.md @@ -0,0 +1,21 @@ +```http +POST /v1/messaging/providers/ses HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "accessKey": "<ACCESS_KEY>", + "secretKey": "<SECRET_KEY>", + "region": "<REGION>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "email@example.com", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-sms.md b/examples/2.0.x/server-rest/examples/messaging/create-sms.md new file mode 100644 index 000000000..c19ff73f6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-sms.md @@ -0,0 +1,18 @@ +```http +POST /v1/messaging/messages/sms HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "messageId": "<MESSAGE_ID>", + "content": "<CONTENT>", + "topics": [], + "users": [], + "targets": [], + "draft": false, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..c1eea868f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-smtp-provider.md @@ -0,0 +1,25 @@ +```http +POST /v1/messaging/providers/smtp HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "host": "<HOST>", + "port": 587, + "username": "<USERNAME>", + "password": "password", + "encryption": "none", + "autoTLS": false, + "mailer": "<MAILER>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "email@example.com", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-subscriber.md b/examples/2.0.x/server-rest/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..dd3801b41 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-subscriber.md @@ -0,0 +1,13 @@ +```http +POST /v1/messaging/topics/{topicId}/subscribers HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "subscriberId": "<SUBSCRIBER_ID>", + "targetId": "<TARGET_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..d46d5743c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-telesign-provider.md @@ -0,0 +1,17 @@ +```http +POST /v1/messaging/providers/telesign HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "from": "+12065550100", + "customerId": "<CUSTOMER_ID>", + "apiKey": "<API_KEY>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..dff6ac04f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,17 @@ +```http +POST /v1/messaging/providers/textmagic HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "from": "+12065550100", + "username": "<USERNAME>", + "apiKey": "<API_KEY>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-topic.md b/examples/2.0.x/server-rest/examples/messaging/create-topic.md new file mode 100644 index 000000000..ff4a9ef95 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-topic.md @@ -0,0 +1,14 @@ +```http +POST /v1/messaging/topics HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "topicId": "<TOPIC_ID>", + "name": "<NAME>", + "subscribe": ["any"] +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..bd0034686 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-twilio-provider.md @@ -0,0 +1,17 @@ +```http +POST /v1/messaging/providers/twilio HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "from": "+12065550100", + "accountSid": "<ACCOUNT_SID>", + "authToken": "<AUTH_TOKEN>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-rest/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..89b085f43 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/create-vonage-provider.md @@ -0,0 +1,17 @@ +```http +POST /v1/messaging/providers/vonage HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "from": "+12065550100", + "apiKey": "<API_KEY>", + "apiSecret": "<API_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/delete-provider.md b/examples/2.0.x/server-rest/examples/messaging/delete-provider.md new file mode 100644 index 000000000..7a45ef854 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/delete-provider.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/messaging/providers/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-rest/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..782dfc4a7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/delete-subscriber.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/messaging/topics/{topicId}/subscribers/{subscriberId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/delete-topic.md b/examples/2.0.x/server-rest/examples/messaging/delete-topic.md new file mode 100644 index 000000000..520b741af --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/delete-topic.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/messaging/topics/{topicId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/delete.md b/examples/2.0.x/server-rest/examples/messaging/delete.md new file mode 100644 index 000000000..2ebfd8c53 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/messaging/messages/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/get-message.md b/examples/2.0.x/server-rest/examples/messaging/get-message.md new file mode 100644 index 000000000..14e5448a3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/get-message.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/messages/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/get-provider.md b/examples/2.0.x/server-rest/examples/messaging/get-provider.md new file mode 100644 index 000000000..078b23523 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/get-provider.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/providers/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/get-subscriber.md b/examples/2.0.x/server-rest/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..1e0fc60c8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/get-subscriber.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/topics/{topicId}/subscribers/{subscriberId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/get-topic.md b/examples/2.0.x/server-rest/examples/messaging/get-topic.md new file mode 100644 index 000000000..688f05de3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/get-topic.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/topics/{topicId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/list-messages.md b/examples/2.0.x/server-rest/examples/messaging/list-messages.md new file mode 100644 index 000000000..398aa30a2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/list-messages.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/messages HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/list-providers.md b/examples/2.0.x/server-rest/examples/messaging/list-providers.md new file mode 100644 index 000000000..b99af1b17 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/list-providers.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/providers HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/list-subscribers.md b/examples/2.0.x/server-rest/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..7407c7276 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/list-subscribers.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/topics/{topicId}/subscribers HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/list-targets.md b/examples/2.0.x/server-rest/examples/messaging/list-targets.md new file mode 100644 index 000000000..cb8c76080 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/list-targets.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/messages/{messageId}/targets HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/list-topics.md b/examples/2.0.x/server-rest/examples/messaging/list-topics.md new file mode 100644 index 000000000..3adf4b2af --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/list-topics.md @@ -0,0 +1,7 @@ +```http +GET /v1/messaging/topics HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..bfc93d553 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-apns-provider.md @@ -0,0 +1,18 @@ +```http +PATCH /v1/messaging/providers/apns/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "authKey": "<AUTH_KEY>", + "authKeyId": "<AUTH_KEY_ID>", + "teamId": "<TEAM_ID>", + "bundleId": "<BUNDLE_ID>", + "sandbox": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-email.md b/examples/2.0.x/server-rest/examples/messaging/update-email.md new file mode 100644 index 000000000..328797562 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-email.md @@ -0,0 +1,22 @@ +```http +PATCH /v1/messaging/messages/email/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "topics": [], + "users": [], + "targets": [], + "subject": "<SUBJECT>", + "content": "<CONTENT>", + "draft": false, + "html": false, + "cc": [], + "bcc": [], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "attachments": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..1969a30d2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-fcm-provider.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/messaging/providers/fcm/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "serviceAccountJSON": {} +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..5f8c1908a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/messaging/providers/mailgun/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "apiKey": "<API_KEY>", + "domain": "example.com", + "isEuRegion": false, + "enabled": false, + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "<REPLY_TO_EMAIL>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..a06fc1ea8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/messaging/providers/msg91/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "templateId": "<TEMPLATE_ID>", + "senderId": "<SENDER_ID>", + "authKey": "<AUTH_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-push.md b/examples/2.0.x/server-rest/examples/messaging/update-push.md new file mode 100644 index 000000000..c91be4e46 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-push.md @@ -0,0 +1,29 @@ +```http +PATCH /v1/messaging/messages/push/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "topics": [], + "users": [], + "targets": [], + "title": "<TITLE>", + "body": "<BODY>", + "data": {}, + "action": "<ACTION>", + "image": "<ID1:ID2>", + "icon": "<ICON>", + "sound": "<SOUND>", + "color": "<COLOR>", + "tag": "<TAG>", + "badge": 1, + "draft": false, + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "contentAvailable": false, + "critical": false, + "priority": "normal" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..09c7e0a0f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-resend-provider.md @@ -0,0 +1,18 @@ +```http +PATCH /v1/messaging/providers/resend/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "apiKey": "<API_KEY>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "<REPLY_TO_EMAIL>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..1335f939d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,18 @@ +```http +PATCH /v1/messaging/providers/sendgrid/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "apiKey": "<API_KEY>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "<REPLY_TO_EMAIL>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..d5b0beaec --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-ses-provider.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/messaging/providers/ses/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "accessKey": "<ACCESS_KEY>", + "secretKey": "<SECRET_KEY>", + "region": "<REGION>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "<REPLY_TO_EMAIL>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-sms.md b/examples/2.0.x/server-rest/examples/messaging/update-sms.md new file mode 100644 index 000000000..9f5457eee --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-sms.md @@ -0,0 +1,17 @@ +```http +PATCH /v1/messaging/messages/sms/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "topics": [], + "users": [], + "targets": [], + "content": "<CONTENT>", + "draft": false, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..01cf8bf76 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-smtp-provider.md @@ -0,0 +1,24 @@ +```http +PATCH /v1/messaging/providers/smtp/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "host": "<HOST>", + "port": 1, + "username": "<USERNAME>", + "password": "password", + "encryption": "none", + "autoTLS": false, + "mailer": "<MAILER>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "<REPLY_TO_EMAIL>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..c3a918c0c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-telesign-provider.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/messaging/providers/telesign/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "customerId": "<CUSTOMER_ID>", + "apiKey": "<API_KEY>", + "from": "<FROM>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..ddba1b294 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/messaging/providers/textmagic/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "username": "<USERNAME>", + "apiKey": "<API_KEY>", + "from": "<FROM>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-topic.md b/examples/2.0.x/server-rest/examples/messaging/update-topic.md new file mode 100644 index 000000000..fb66a521b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-topic.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/messaging/topics/{topicId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "subscribe": ["any"] +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..6d38c9178 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-twilio-provider.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/messaging/providers/twilio/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "accountSid": "<ACCOUNT_SID>", + "authToken": "<AUTH_TOKEN>", + "from": "<FROM>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-rest/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..5511690b2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/messaging/update-vonage-provider.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/messaging/providers/vonage/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false, + "apiKey": "<API_KEY>", + "apiSecret": "<API_SECRET>", + "from": "<FROM>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/organization/create-project.md b/examples/2.0.x/server-rest/examples/organization/create-project.md new file mode 100644 index 000000000..c8b963794 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/organization/create-project.md @@ -0,0 +1,14 @@ +```http +POST /v1/organization/projects HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "projectId": "<PROJECT_ID>", + "name": "<NAME>", + "region": "default" +} +``` diff --git a/examples/2.0.x/server-rest/examples/organization/delete-project.md b/examples/2.0.x/server-rest/examples/organization/delete-project.md new file mode 100644 index 000000000..8bd431a35 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/organization/delete-project.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/organization/projects/{projectId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/organization/get-project.md b/examples/2.0.x/server-rest/examples/organization/get-project.md new file mode 100644 index 000000000..6e3e80e3b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/organization/get-project.md @@ -0,0 +1,6 @@ +```http +GET /v1/organization/projects/{projectId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/organization/list-projects.md b/examples/2.0.x/server-rest/examples/organization/list-projects.md new file mode 100644 index 000000000..e88503452 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/organization/list-projects.md @@ -0,0 +1,7 @@ +```http +GET /v1/organization/projects HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/organization/update-project.md b/examples/2.0.x/server-rest/examples/organization/update-project.md new file mode 100644 index 000000000..ead09d6af --- /dev/null +++ b/examples/2.0.x/server-rest/examples/organization/update-project.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/organization/projects/{projectId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/presences/delete.md b/examples/2.0.x/server-rest/examples/presences/delete.md new file mode 100644 index 000000000..933945dd4 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/presences/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/presences/{presenceId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/presences/get.md b/examples/2.0.x/server-rest/examples/presences/get.md new file mode 100644 index 000000000..64e28d426 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/presences/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/presences/{presenceId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/presences/list.md b/examples/2.0.x/server-rest/examples/presences/list.md new file mode 100644 index 000000000..c0a41e001 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/presences/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/presences HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/presences/update.md b/examples/2.0.x/server-rest/examples/presences/update.md new file mode 100644 index 000000000..c8fd502c2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/presences/update.md @@ -0,0 +1,17 @@ +```http +PATCH /v1/presences/{presenceId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "status": "<STATUS>", + "expiresAt": "2020-10-15T06:38:00.000+00:00", + "metadata": {}, + "permissions": ["read(\"any\")"], + "purge": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/presences/upsert.md b/examples/2.0.x/server-rest/examples/presences/upsert.md new file mode 100644 index 000000000..cb12223be --- /dev/null +++ b/examples/2.0.x/server-rest/examples/presences/upsert.md @@ -0,0 +1,16 @@ +```http +PUT /v1/presences/{presenceId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "status": "<STATUS>", + "permissions": ["read(\"any\")"], + "expiresAt": "2020-10-15T06:38:00.000+00:00", + "metadata": {} +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-android-platform.md b/examples/2.0.x/server-rest/examples/project/create-android-platform.md new file mode 100644 index 000000000..885429038 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-android-platform.md @@ -0,0 +1,14 @@ +```http +POST /v1/project/platforms/android HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "platformId": "<PLATFORM_ID>", + "name": "<NAME>", + "applicationId": "<APPLICATION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-apple-platform.md b/examples/2.0.x/server-rest/examples/project/create-apple-platform.md new file mode 100644 index 000000000..36e1cb72c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-apple-platform.md @@ -0,0 +1,14 @@ +```http +POST /v1/project/platforms/apple HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "platformId": "<PLATFORM_ID>", + "name": "<NAME>", + "bundleIdentifier": "<BUNDLE_IDENTIFIER>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-rest/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..635d7ab6d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-ephemeral-key.md @@ -0,0 +1,13 @@ +```http +POST /v1/project/keys/ephemeral HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "scopes": [], + "duration": 600 +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-linux-platform.md b/examples/2.0.x/server-rest/examples/project/create-linux-platform.md new file mode 100644 index 000000000..6a07c4f73 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-linux-platform.md @@ -0,0 +1,14 @@ +```http +POST /v1/project/platforms/linux HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "platformId": "<PLATFORM_ID>", + "name": "<NAME>", + "packageName": "<PACKAGE_NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-mock-phone.md b/examples/2.0.x/server-rest/examples/project/create-mock-phone.md new file mode 100644 index 000000000..d81ca6c08 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-mock-phone.md @@ -0,0 +1,13 @@ +```http +POST /v1/project/mock-phones HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "number": "+12065550100", + "otp": "<OTP>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-smtp-test.md b/examples/2.0.x/server-rest/examples/project/create-smtp-test.md new file mode 100644 index 000000000..57498a09c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-smtp-test.md @@ -0,0 +1,11 @@ +```http +POST /v1/project/smtp/tests HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "emails": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-variable.md b/examples/2.0.x/server-rest/examples/project/create-variable.md new file mode 100644 index 000000000..5407c5286 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-variable.md @@ -0,0 +1,15 @@ +```http +POST /v1/project/variables HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "variableId": "<VARIABLE_ID>", + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-web-platform.md b/examples/2.0.x/server-rest/examples/project/create-web-platform.md new file mode 100644 index 000000000..9ac6ad642 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-web-platform.md @@ -0,0 +1,14 @@ +```http +POST /v1/project/platforms/web HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "platformId": "<PLATFORM_ID>", + "name": "<NAME>", + "hostname": "app.example.com" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/create-windows-platform.md b/examples/2.0.x/server-rest/examples/project/create-windows-platform.md new file mode 100644 index 000000000..c3e9c66b2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/create-windows-platform.md @@ -0,0 +1,14 @@ +```http +POST /v1/project/platforms/windows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "platformId": "<PLATFORM_ID>", + "name": "<NAME>", + "packageIdentifierName": "<PACKAGE_IDENTIFIER_NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/delete-key.md b/examples/2.0.x/server-rest/examples/project/delete-key.md new file mode 100644 index 000000000..2fb1e7847 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/delete-key.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/project/keys/{keyId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/project/delete-mock-phone.md b/examples/2.0.x/server-rest/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..03fd7afdc --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/delete-mock-phone.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/project/mock-phones/{number} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/project/delete-platform.md b/examples/2.0.x/server-rest/examples/project/delete-platform.md new file mode 100644 index 000000000..05493da85 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/delete-platform.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/project/platforms/{platformId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/project/delete-variable.md b/examples/2.0.x/server-rest/examples/project/delete-variable.md new file mode 100644 index 000000000..e94cfaf6c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/delete-variable.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/project/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/project/delete.md b/examples/2.0.x/server-rest/examples/project/delete.md new file mode 100644 index 000000000..88943ee25 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/project HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/project/get-email-template.md b/examples/2.0.x/server-rest/examples/project/get-email-template.md new file mode 100644 index 000000000..55e0b236e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/get-email-template.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/templates/email/{templateId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/get-key.md b/examples/2.0.x/server-rest/examples/project/get-key.md new file mode 100644 index 000000000..1e40d4656 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/get-key.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/keys/{keyId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/get-mock-phone.md b/examples/2.0.x/server-rest/examples/project/get-mock-phone.md new file mode 100644 index 000000000..0633b0278 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/get-mock-phone.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/mock-phones/{number} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-rest/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..1c0e86e5b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/oauth2/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/get-platform.md b/examples/2.0.x/server-rest/examples/project/get-platform.md new file mode 100644 index 000000000..ce7dd55b8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/get-platform.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/platforms/{platformId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/get-policy.md b/examples/2.0.x/server-rest/examples/project/get-policy.md new file mode 100644 index 000000000..9a91114f3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/get-policy.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/policies/{policyId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/get-variable.md b/examples/2.0.x/server-rest/examples/project/get-variable.md new file mode 100644 index 000000000..2d8d6abac --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/get-variable.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/get.md b/examples/2.0.x/server-rest/examples/project/get.md new file mode 100644 index 000000000..bd250317f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/get.md @@ -0,0 +1,6 @@ +```http +GET /v1/project HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/list-email-templates.md b/examples/2.0.x/server-rest/examples/project/list-email-templates.md new file mode 100644 index 000000000..589c90b1c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/list-email-templates.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/templates/email HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/list-keys.md b/examples/2.0.x/server-rest/examples/project/list-keys.md new file mode 100644 index 000000000..59862a959 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/list-keys.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/keys HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/list-mock-phones.md b/examples/2.0.x/server-rest/examples/project/list-mock-phones.md new file mode 100644 index 000000000..802d9c849 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/list-mock-phones.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/mock-phones HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-rest/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..43640d838 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/oauth2 HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/list-platforms.md b/examples/2.0.x/server-rest/examples/project/list-platforms.md new file mode 100644 index 000000000..54a572720 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/list-platforms.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/platforms HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/list-policies.md b/examples/2.0.x/server-rest/examples/project/list-policies.md new file mode 100644 index 000000000..6af55b9da --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/list-policies.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/policies HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/list-variables.md b/examples/2.0.x/server-rest/examples/project/list-variables.md new file mode 100644 index 000000000..92b42f234 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/list-variables.md @@ -0,0 +1,7 @@ +```http +GET /v1/project/variables HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-android-platform.md b/examples/2.0.x/server-rest/examples/project/update-android-platform.md new file mode 100644 index 000000000..d9705b04e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-android-platform.md @@ -0,0 +1,13 @@ +```http +PUT /v1/project/platforms/android/{platformId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "applicationId": "<APPLICATION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-apple-platform.md b/examples/2.0.x/server-rest/examples/project/update-apple-platform.md new file mode 100644 index 000000000..f9a3fc110 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-apple-platform.md @@ -0,0 +1,13 @@ +```http +PUT /v1/project/platforms/apple/{platformId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "bundleIdentifier": "<BUNDLE_IDENTIFIER>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-auth-method.md b/examples/2.0.x/server-rest/examples/project/update-auth-method.md new file mode 100644 index 000000000..524e366e6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-auth-method.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/auth-methods/{methodId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-email-template.md b/examples/2.0.x/server-rest/examples/project/update-email-template.md new file mode 100644 index 000000000..fa669a505 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-email-template.md @@ -0,0 +1,19 @@ +```http +PATCH /v1/project/templates/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "templateId": "verification", + "locale": "af", + "subject": "<SUBJECT>", + "message": "<MESSAGE>", + "senderName": "<SENDER_NAME>", + "senderEmail": "email@example.com", + "replyToEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-key.md b/examples/2.0.x/server-rest/examples/project/update-key.md new file mode 100644 index 000000000..6da6a8dce --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-key.md @@ -0,0 +1,14 @@ +```http +PUT /v1/project/keys/{keyId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "scopes": [], + "expire": "2020-10-15T06:38:00.000+00:00" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-labels.md b/examples/2.0.x/server-rest/examples/project/update-labels.md new file mode 100644 index 000000000..715b1041e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-labels.md @@ -0,0 +1,12 @@ +```http +PUT /v1/project/labels HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "labels": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-linux-platform.md b/examples/2.0.x/server-rest/examples/project/update-linux-platform.md new file mode 100644 index 000000000..0b691449a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-linux-platform.md @@ -0,0 +1,13 @@ +```http +PUT /v1/project/platforms/linux/{platformId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "packageName": "<PACKAGE_NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-rest/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..8d59f4b6b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,17 @@ +```http +PATCH /v1/project/policies/membership-privacy HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": false, + "userEmail": false, + "userPhone": false, + "userName": false, + "userMFA": false, + "userAccessedAt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-rest/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..d11d90231 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/project/policies/mfa-factors HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "totp": false, + "email": false, + "phone": false, + "custom": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-mock-phone.md b/examples/2.0.x/server-rest/examples/project/update-mock-phone.md new file mode 100644 index 000000000..f770efd63 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-mock-phone.md @@ -0,0 +1,12 @@ +```http +PUT /v1/project/mock-phones/{number} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "otp": "<OTP>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..e2a8c85b9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/amazon HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..95e985236 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/project/oauth2/apple HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "serviceId": "<SERVICE_ID>", + "keyId": "<KEY_ID>", + "teamId": "<TEAM_ID>", + "p8File": "<P8_FILE>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..2427f1db1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/appwrite HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..e9db2510c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/project/oauth2/auth0 HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "endpoint": "<ENDPOINT>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..bffbf5c0f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/project/oauth2/authentik HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "endpoint": "<ENDPOINT>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..58208638f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/autodesk HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..bc9842fa9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/bitbucket HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "secret": "<SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..75de99c38 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/bitly HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..620db0de2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-box.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/box HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..f7b70deb1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/cloudflare HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..84ba3ff6d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/dailymotion HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "apiKey": "<API_KEY>", + "apiSecret": "<API_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..a09672016 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/discord HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..204a9a48a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/disqus HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "publicKey": "<PUBLIC_KEY>", + "secretKey": "<SECRET_KEY>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..819602d41 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/dropbox HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "appKey": "<APP_KEY>", + "appSecret": "<APP_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..52e39d1f2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/etsy HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "keyString": "<KEY_STRING>", + "sharedSecret": "<SHARED_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..9bbf870bd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/facebook HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "appId": "<APP_ID>", + "appSecret": "<APP_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..130dba6ab --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/figma HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..0a8a5db4e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/project/oauth2/fusionauth HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "endpoint": "<ENDPOINT>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..ef25514fb --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/github HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..9ef6e8d65 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/project/oauth2/gitlab HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "applicationId": "<APPLICATION_ID>", + "secret": "<SECRET>", + "endpoint": "https://example.com", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..1cbedec80 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-google.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/project/oauth2/google HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "prompt": [], + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..b92c5d81c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/huggingface HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..a6ebe0d00 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/project/oauth2/keycloak HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "endpoint": "<ENDPOINT>", + "realmName": "<REALM_NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..3a7c058a9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/kick HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..c05c66584 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/linkedin HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "primaryClientSecret": "<PRIMARY_CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..b7cb7c926 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/project/oauth2/microsoft HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "applicationId": "<APPLICATION_ID>", + "applicationSecret": "<APPLICATION_SECRET>", + "tenant": "<TENANT>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..30ff77b4a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/notion HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "oauthClientId": "<OAUTH_CLIENT_ID>", + "oauthClientSecret": "<OAUTH_CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..ac428416b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/project/oauth2/oidc HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "wellKnownURL": "https://example.com", + "authorizationURL": "https://example.com", + "tokenURL": "https://example.com", + "userInfoURL": "https://example.com", + "prompt": [], + "maxAge": 0, + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..9d3db4953 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/project/oauth2/okta HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "domain": "example.com", + "authorizationServerId": "<AUTHORIZATION_SERVER_ID>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..4da025290 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/paypalSandbox HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "secretKey": "<SECRET_KEY>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..1f568aa5b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/paypal HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "secretKey": "<SECRET_KEY>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..a846b4604 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/podio HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..c40320483 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/resend HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..05271c3cf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/salesforce HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "customerKey": "<CUSTOMER_KEY>", + "customerSecret": "<CUSTOMER_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..dd71cda3e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/slack HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..fa7063a27 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/spotify HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..3a052de97 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/stripe HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "apiSecretKey": "<API_SECRET_KEY>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..20a2c2dff --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/tradeshiftBox HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "oauth2ClientId": "<OAUTH2_CLIENT_ID>", + "oauth2ClientSecret": "<OAUTH2_CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..294b8f7da --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/tradeshift HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "oauth2ClientId": "<OAUTH2_CLIENT_ID>", + "oauth2ClientSecret": "<OAUTH2_CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..4e57c9fce --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/twitch HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..caf8fd89c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/wordpress HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..28db9bcc2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/yahoo HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..4b73e13c2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/yandex HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..7d59960ce --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/zoho HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..7e17d9b5d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/zoom HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "clientId": "<CLIENT_ID>", + "clientSecret": "<CLIENT_SECRET>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-rest/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..e927b1ee3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-o-auth-2x.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/project/oauth2/x HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "customerKey": "<CUSTOMER_KEY>", + "secretKey": "<SECRET_KEY>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-rest/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..ea14908f9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/policies/password-dictionary HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-password-history-policy.md b/examples/2.0.x/server-rest/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..200073d86 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-password-history-policy.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/policies/password-history HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "total": 1 +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-rest/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..7ae0d5e8b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/policies/password-personal-data HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-rest/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..7c61c801f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-password-strength-policy.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/project/policies/password-strength HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "min": 8, + "uppercase": false, + "lowercase": false, + "number": false, + "symbols": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-protocol.md b/examples/2.0.x/server-rest/examples/project/update-protocol.md new file mode 100644 index 000000000..80a8612c4 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-protocol.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/protocols/{protocolId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-service.md b/examples/2.0.x/server-rest/examples/project/update-service.md new file mode 100644 index 000000000..865a0ffc6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-service.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/services/{serviceId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-rest/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..f11f0ed9d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-session-alert-policy.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/policies/session-alert HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-rest/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..a958387b1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-session-duration-policy.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/policies/session-duration HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "duration": 60 +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-rest/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..2f2e36a3a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/policies/session-invalidation HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-rest/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..a979681ef --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-session-limit-policy.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/policies/session-limit HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "total": 1 +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-smtp.md b/examples/2.0.x/server-rest/examples/project/update-smtp.md new file mode 100644 index 000000000..d16a984a8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-smtp.md @@ -0,0 +1,21 @@ +```http +PATCH /v1/project/smtp HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "host": "example.com", + "port": 587, + "username": "<USERNAME>", + "password": "password", + "senderEmail": "email@example.com", + "senderName": "<SENDER_NAME>", + "replyToEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "secure": "tls", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-rest/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..63f08f078 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-user-limit-policy.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/project/policies/user-limit HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "total": 0 +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-variable.md b/examples/2.0.x/server-rest/examples/project/update-variable.md new file mode 100644 index 000000000..d93dc0b3e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-variable.md @@ -0,0 +1,14 @@ +```http +PUT /v1/project/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-web-platform.md b/examples/2.0.x/server-rest/examples/project/update-web-platform.md new file mode 100644 index 000000000..b8ed256f2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-web-platform.md @@ -0,0 +1,13 @@ +```http +PUT /v1/project/platforms/web/{platformId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "hostname": "app.example.com" +} +``` diff --git a/examples/2.0.x/server-rest/examples/project/update-windows-platform.md b/examples/2.0.x/server-rest/examples/project/update-windows-platform.md new file mode 100644 index 000000000..91626322e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/project/update-windows-platform.md @@ -0,0 +1,13 @@ +```http +PUT /v1/project/platforms/windows/{platformId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "packageIdentifierName": "<PACKAGE_IDENTIFIER_NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/proxy/create-api-rule.md b/examples/2.0.x/server-rest/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..c7800c654 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/proxy/create-api-rule.md @@ -0,0 +1,12 @@ +```http +POST /v1/proxy/rules/api HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "domain": "example.com" +} +``` diff --git a/examples/2.0.x/server-rest/examples/proxy/create-function-rule.md b/examples/2.0.x/server-rest/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..1c2698352 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/proxy/create-function-rule.md @@ -0,0 +1,14 @@ +```http +POST /v1/proxy/rules/function HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "domain": "example.com", + "functionId": "<FUNCTION_ID>", + "branch": "<BRANCH>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-rest/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..1302f6d91 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/proxy/create-redirect-rule.md @@ -0,0 +1,16 @@ +```http +POST /v1/proxy/rules/redirect HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "domain": "example.com", + "url": "https://example.com", + "statusCode": "301", + "resourceId": "<RESOURCE_ID>", + "resourceType": "site" +} +``` diff --git a/examples/2.0.x/server-rest/examples/proxy/create-site-rule.md b/examples/2.0.x/server-rest/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..50d983230 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/proxy/create-site-rule.md @@ -0,0 +1,14 @@ +```http +POST /v1/proxy/rules/site HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "domain": "example.com", + "siteId": "<SITE_ID>", + "branch": "<BRANCH>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/proxy/delete-rule.md b/examples/2.0.x/server-rest/examples/proxy/delete-rule.md new file mode 100644 index 000000000..9f7486203 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/proxy/delete-rule.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/proxy/rules/{ruleId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/proxy/get-rule.md b/examples/2.0.x/server-rest/examples/proxy/get-rule.md new file mode 100644 index 000000000..3a3ff04fc --- /dev/null +++ b/examples/2.0.x/server-rest/examples/proxy/get-rule.md @@ -0,0 +1,7 @@ +```http +GET /v1/proxy/rules/{ruleId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/proxy/list-rules.md b/examples/2.0.x/server-rest/examples/proxy/list-rules.md new file mode 100644 index 000000000..8ec7c403b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/proxy/list-rules.md @@ -0,0 +1,7 @@ +```http +GET /v1/proxy/rules HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/proxy/update-rule-status.md b/examples/2.0.x/server-rest/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..1d7299cdf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/proxy/update-rule-status.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/proxy/rules/{ruleId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/sites/create-deployment.md b/examples/2.0.x/server-rest/examples/sites/create-deployment.md new file mode 100644 index 000000000..d54597877 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/create-deployment.md @@ -0,0 +1,36 @@ +```http +POST /v1/sites/{siteId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="installCommand" + +"<INSTALL_COMMAND>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="buildCommand" + +"<BUILD_COMMAND>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="outputDirectory" + +"<OUTPUT_DIRECTORY>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="code" + +cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16... + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="activate" + +false + +--cec8e8123c05ba25-- +``` diff --git a/examples/2.0.x/server-rest/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-rest/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..7e73ea8fb --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,12 @@ +```http +POST /v1/sites/{siteId}/deployments/duplicate HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "deploymentId": "<DEPLOYMENT_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/sites/create-template-deployment.md b/examples/2.0.x/server-rest/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..3edd0bd07 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/create-template-deployment.md @@ -0,0 +1,17 @@ +```http +POST /v1/sites/{siteId}/deployments/template HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "repository": "<REPOSITORY>", + "owner": "<OWNER>", + "rootDirectory": "<ROOT_DIRECTORY>", + "type": "branch", + "reference": "<REFERENCE>", + "activate": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/sites/create-variable.md b/examples/2.0.x/server-rest/examples/sites/create-variable.md new file mode 100644 index 000000000..40add5fe2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/create-variable.md @@ -0,0 +1,15 @@ +```http +POST /v1/sites/{siteId}/variables HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "variableId": "<VARIABLE_ID>", + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-rest/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..732e270d5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/create-vcs-deployment.md @@ -0,0 +1,14 @@ +```http +POST /v1/sites/{siteId}/deployments/vcs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "type": "branch", + "reference": "<REFERENCE>", + "activate": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/sites/create.md b/examples/2.0.x/server-rest/examples/sites/create.md new file mode 100644 index 000000000..1327f3c76 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/create.md @@ -0,0 +1,35 @@ +```http +POST /v1/sites HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "siteId": "<SITE_ID>", + "name": "<NAME>", + "framework": "analog", + "enabled": false, + "logging": false, + "timeout": 1, + "installCommand": "<INSTALL_COMMAND>", + "buildCommand": "<BUILD_COMMAND>", + "startCommand": "<START_COMMAND>", + "outputDirectory": "<OUTPUT_DIRECTORY>", + "buildRuntime": "node-14.5", + "adapter": "static", + "installationId": "<INSTALLATION_ID>", + "fallbackFile": "<FALLBACK_FILE>", + "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", + "providerBranch": "<PROVIDER_BRANCH>", + "providerSilentMode": false, + "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", + "providerBranches": [], + "providerPaths": [], + "buildSpecification": "s-1vcpu-512mb", + "runtimeSpecification": "s-1vcpu-512mb", + "deploymentRetention": 0, + "scopes": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/sites/delete-deployment.md b/examples/2.0.x/server-rest/examples/sites/delete-deployment.md new file mode 100644 index 000000000..cba444ddc --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/delete-deployment.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/sites/{siteId}/deployments/{deploymentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/sites/delete-log.md b/examples/2.0.x/server-rest/examples/sites/delete-log.md new file mode 100644 index 000000000..466a42ecf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/delete-log.md @@ -0,0 +1,9 @@ +```http +DELETE /v1/sites/{siteId}/logs/{logId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/sites/delete-variable.md b/examples/2.0.x/server-rest/examples/sites/delete-variable.md new file mode 100644 index 000000000..5f272d443 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/delete-variable.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/sites/{siteId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/sites/delete.md b/examples/2.0.x/server-rest/examples/sites/delete.md new file mode 100644 index 000000000..af2058f55 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/sites/{siteId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/sites/get-deployment-download.md b/examples/2.0.x/server-rest/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..e3ce14068 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/get-deployment-download.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/{siteId}/deployments/{deploymentId}/download HTTP/1.1 +Host: cloud.appwrite.io +Accept: */* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/get-deployment.md b/examples/2.0.x/server-rest/examples/sites/get-deployment.md new file mode 100644 index 000000000..03a89e9aa --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/get-deployment.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/{siteId}/deployments/{deploymentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/get-log.md b/examples/2.0.x/server-rest/examples/sites/get-log.md new file mode 100644 index 000000000..31e04e371 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/get-log.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/{siteId}/logs/{logId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/get-variable.md b/examples/2.0.x/server-rest/examples/sites/get-variable.md new file mode 100644 index 000000000..d03c4a02e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/get-variable.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/{siteId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/get.md b/examples/2.0.x/server-rest/examples/sites/get.md new file mode 100644 index 000000000..f74c0c02f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/{siteId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/list-deployments.md b/examples/2.0.x/server-rest/examples/sites/list-deployments.md new file mode 100644 index 000000000..50da70e52 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/list-deployments.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/{siteId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/list-frameworks.md b/examples/2.0.x/server-rest/examples/sites/list-frameworks.md new file mode 100644 index 000000000..eec6a9c4e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/list-frameworks.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/frameworks HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/list-logs.md b/examples/2.0.x/server-rest/examples/sites/list-logs.md new file mode 100644 index 000000000..f968f26ba --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/list-logs.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/{siteId}/logs HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/list-specifications.md b/examples/2.0.x/server-rest/examples/sites/list-specifications.md new file mode 100644 index 000000000..95b9ea7cd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/list-specifications.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/specifications HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/list-variables.md b/examples/2.0.x/server-rest/examples/sites/list-variables.md new file mode 100644 index 000000000..e484e1f52 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/list-variables.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites/{siteId}/variables HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/list.md b/examples/2.0.x/server-rest/examples/sites/list.md new file mode 100644 index 000000000..b486afdb3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/sites HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/sites/update-deployment-status.md b/examples/2.0.x/server-rest/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..5766df17b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/update-deployment-status.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/sites/{siteId}/deployments/{deploymentId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/sites/update-site-deployment.md b/examples/2.0.x/server-rest/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..b3e7ff0b1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/update-site-deployment.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/sites/{siteId}/deployment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "deploymentId": "<DEPLOYMENT_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/sites/update-variable.md b/examples/2.0.x/server-rest/examples/sites/update-variable.md new file mode 100644 index 000000000..b89190311 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/update-variable.md @@ -0,0 +1,14 @@ +```http +PUT /v1/sites/{siteId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/sites/update.md b/examples/2.0.x/server-rest/examples/sites/update.md new file mode 100644 index 000000000..ca6bbba9d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/sites/update.md @@ -0,0 +1,34 @@ +```http +PUT /v1/sites/{siteId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "framework": "analog", + "enabled": false, + "logging": false, + "timeout": 1, + "installCommand": "<INSTALL_COMMAND>", + "buildCommand": "<BUILD_COMMAND>", + "startCommand": "<START_COMMAND>", + "outputDirectory": "<OUTPUT_DIRECTORY>", + "buildRuntime": "node-14.5", + "adapter": "static", + "fallbackFile": "<FALLBACK_FILE>", + "installationId": "<INSTALLATION_ID>", + "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", + "providerBranch": "<PROVIDER_BRANCH>", + "providerSilentMode": false, + "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", + "providerBranches": [], + "providerPaths": [], + "buildSpecification": "s-1vcpu-512mb", + "runtimeSpecification": "s-1vcpu-512mb", + "deploymentRetention": 0, + "scopes": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/storage/create-bucket.md b/examples/2.0.x/server-rest/examples/storage/create-bucket.md new file mode 100644 index 000000000..65c595d2d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/create-bucket.md @@ -0,0 +1,22 @@ +```http +POST /v1/storage/buckets HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "bucketId": "<BUCKET_ID>", + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "fileSecurity": false, + "enabled": false, + "maximumFileSize": 1, + "allowedFileExtensions": [], + "compression": "none", + "encryption": false, + "antivirus": false, + "transformations": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/storage/create-file.md b/examples/2.0.x/server-rest/examples/storage/create-file.md new file mode 100644 index 000000000..ce3b0ba6e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/create-file.md @@ -0,0 +1,31 @@ +```http +POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="fileId" + +"<FILE_ID>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="file" + +cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16... + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="permissions[]" + +["read(\"any\")"] + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="folder" + +"photos/2026" + +--cec8e8123c05ba25-- +``` diff --git a/examples/2.0.x/server-rest/examples/storage/delete-bucket.md b/examples/2.0.x/server-rest/examples/storage/delete-bucket.md new file mode 100644 index 000000000..8c3206096 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/delete-bucket.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/storage/buckets/{bucketId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/storage/delete-file.md b/examples/2.0.x/server-rest/examples/storage/delete-file.md new file mode 100644 index 000000000..b39bc4e41 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/delete-file.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/storage/get-bucket.md b/examples/2.0.x/server-rest/examples/storage/get-bucket.md new file mode 100644 index 000000000..0ab147f32 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/get-bucket.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/storage/get-file-download.md b/examples/2.0.x/server-rest/examples/storage/get-file-download.md new file mode 100644 index 000000000..7c754bf4a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/get-file-download.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files/{fileId}/download HTTP/1.1 +Host: cloud.appwrite.io +Accept: */* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/storage/get-file-preview.md b/examples/2.0.x/server-rest/examples/storage/get-file-preview.md new file mode 100644 index 000000000..66b6f4375 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/get-file-preview.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files/{fileId}/preview HTTP/1.1 +Host: cloud.appwrite.io +Accept: image/* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/storage/get-file-view.md b/examples/2.0.x/server-rest/examples/storage/get-file-view.md new file mode 100644 index 000000000..74f391013 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/get-file-view.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files/{fileId}/view HTTP/1.1 +Host: cloud.appwrite.io +Accept: */* +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/storage/get-file.md b/examples/2.0.x/server-rest/examples/storage/get-file.md new file mode 100644 index 000000000..a2bbc4b2d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/get-file.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/storage/list-buckets.md b/examples/2.0.x/server-rest/examples/storage/list-buckets.md new file mode 100644 index 000000000..d8dfb11ff --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/list-buckets.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/storage/list-files.md b/examples/2.0.x/server-rest/examples/storage/list-files.md new file mode 100644 index 000000000..3a4635c25 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/list-files.md @@ -0,0 +1,7 @@ +```http +GET /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/storage/update-bucket.md b/examples/2.0.x/server-rest/examples/storage/update-bucket.md new file mode 100644 index 000000000..2280b7066 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/update-bucket.md @@ -0,0 +1,21 @@ +```http +PUT /v1/storage/buckets/{bucketId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "fileSecurity": false, + "enabled": false, + "maximumFileSize": 1, + "allowedFileExtensions": [], + "compression": "none", + "encryption": false, + "antivirus": false, + "transformations": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/storage/update-file.md b/examples/2.0.x/server-rest/examples/storage/update-file.md new file mode 100644 index 000000000..1d3f64af4 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/storage/update-file.md @@ -0,0 +1,13 @@ +```http +PUT /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"] +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..4d5bdf593 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,17 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/bigint HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "min": 0, + "max": 1000000, + "default": 0, + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..f7010057b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,15 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/boolean HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": false, + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..8bbace742 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,15 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/datetime HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "2020-10-15T06:38:00.000+00:00", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..9f7c0e17d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-email-column.md @@ -0,0 +1,15 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "email@example.com", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..1f75d0de6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-enum-column.md @@ -0,0 +1,16 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/enum HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "elements": ["active", "inactive"], + "required": false, + "default": "active", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..b327c7a39 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-float-column.md @@ -0,0 +1,17 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/float HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "min": 0, + "max": 100, + "default": 10.5, + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-index.md b/examples/2.0.x/server-rest/examples/tablesdb/create-index.md new file mode 100644 index 000000000..f9746f9a7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-index.md @@ -0,0 +1,16 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "type": "key", + "columns": [], + "orders": [], + "lengths": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..39cd3f1f6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-integer-column.md @@ -0,0 +1,17 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/integer HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "min": 0, + "max": 100, + "default": 10, + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..98bae94ba --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-ip-column.md @@ -0,0 +1,15 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/ip HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "192.0.2.0", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..03a9277ed --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-line-column.md @@ -0,0 +1,14 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/line HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": [[1, 2], [3, 4], [5, 6]] +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..6cbed86e6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,16 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/longtext HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..44b5667ef --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,16 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-operations.md b/examples/2.0.x/server-rest/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..bce829213 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/tablesdb/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "operations": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..1c0de4c80 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-point-column.md @@ -0,0 +1,14 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/point HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": [1, 2] +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..0e86f7cd9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,14 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/polygon HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": [[[1, 2], [3, 4], [5, 6], [1, 2]]] +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..54e82f328 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,17 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/relationship HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "relatedTableId": "<RELATED_TABLE_ID>", + "type": "oneToOne", + "twoWay": false, + "key": "<KEY>", + "twoWayKey": "<TWO_WAY_KEY>", + "onDelete": "cascade" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-row.md b/examples/2.0.x/server-rest/examples/tablesdb/create-row.md new file mode 100644 index 000000000..6d600f4be --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-row.md @@ -0,0 +1,21 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "rowId": "<ROW_ID>", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-rows.md b/examples/2.0.x/server-rest/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..e2c0acf0c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-rows.md @@ -0,0 +1,13 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "rows": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..0bf54ffe4 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-string-column.md @@ -0,0 +1,17 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/string HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "size": 1, + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-table.md b/examples/2.0.x/server-rest/examples/tablesdb/create-table.md new file mode 100644 index 000000000..276db9548 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-table.md @@ -0,0 +1,18 @@ +```http +POST /v1/tablesdb/{databaseId}/tables HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "tableId": "<TABLE_ID>", + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "rowSecurity": false, + "enabled": false, + "columns": [], + "indexes": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..5ff6a7ce2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-text-column.md @@ -0,0 +1,16 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/text HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-rest/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..3c3b850e1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/tablesdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..8ecad25cf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-url-column.md @@ -0,0 +1,15 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "required": false, + "default": "https://example.com", + "array": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-rest/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..2fc35e84d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,17 @@ +```http +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/varchar HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "size": 1, + "required": false, + "default": "Hello World", + "array": false, + "encrypt": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/create.md b/examples/2.0.x/server-rest/examples/tablesdb/create.md new file mode 100644 index 000000000..b7c38d4ed --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/create.md @@ -0,0 +1,14 @@ +```http +POST /v1/tablesdb HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "databaseId": "<DATABASE_ID>", + "name": "<NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-rest/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..9e82b17b6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "value": 1, + "min": 0, + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/delete-column.md b/examples/2.0.x/server-rest/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..8990d3547 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/delete-column.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/columns/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/delete-index.md b/examples/2.0.x/server-rest/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..f10e36757 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/delete-index.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/delete-row.md b/examples/2.0.x/server-rest/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..92055773a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/delete-row.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-rest/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..c8cc91bfd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/delete-rows.md @@ -0,0 +1,9 @@ +```http +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/delete-table.md b/examples/2.0.x/server-rest/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..205a6e2cc --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/delete-table.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tablesdb/{databaseId}/tables/{tableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-rest/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..cb4f8e8c5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tablesdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/delete.md b/examples/2.0.x/server-rest/examples/tablesdb/delete.md new file mode 100644 index 000000000..a7bb5d7f4 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tablesdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/get-column.md b/examples/2.0.x/server-rest/examples/tablesdb/get-column.md new file mode 100644 index 000000000..7cd6b5edd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/get-column.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId}/columns/{key} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/get-index.md b/examples/2.0.x/server-rest/examples/tablesdb/get-index.md new file mode 100644 index 000000000..0b909c619 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/get-index.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/get-row.md b/examples/2.0.x/server-rest/examples/tablesdb/get-row.md new file mode 100644 index 000000000..3c4a3218b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/get-row.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/get-table.md b/examples/2.0.x/server-rest/examples/tablesdb/get-table.md new file mode 100644 index 000000000..7316946f8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/get-table.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-rest/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..1a80ec09d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/get.md b/examples/2.0.x/server-rest/examples/tablesdb/get.md new file mode 100644 index 000000000..cee820603 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-rest/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..964d0187f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/increment-row-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "value": 1, + "max": 100, + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/list-columns.md b/examples/2.0.x/server-rest/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..374b53635 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/list-columns.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId}/columns HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-rest/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..31cb73d9a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/list-indexes.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/list-rows.md b/examples/2.0.x/server-rest/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..b9ac91c06 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/list-rows.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/list-tables.md b/examples/2.0.x/server-rest/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..18ccdb3f5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/list-tables.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/{databaseId}/tables HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-rest/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..3358791af --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/list.md b/examples/2.0.x/server-rest/examples/tablesdb/list.md new file mode 100644 index 000000000..29c0ff68a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/tablesdb HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..39eb249dd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/bigint/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "min": 0, + "max": 1000000, + "default": 0, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..fc469910d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": false, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..f45f3bff0 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "2020-10-15T06:38:00.000+00:00", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..9c18006f3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-email-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "email@example.com", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..02a2bafef --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-enum-column.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "elements": ["active", "inactive"], + "required": false, + "default": "active", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..f634dfbf3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-float-column.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "min": 0, + "max": 100, + "default": 10.5, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..06bdc04bf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-integer-column.md @@ -0,0 +1,16 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "min": 0, + "max": 100, + "default": 10, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..c92bc86c7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-ip-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "192.0.2.0", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..7562bd7e0 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-line-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": [[1, 2], [3, 4], [5, 6]], + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..0a1ad8d8d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/longtext/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..d20488889 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..2f288dd37 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-point-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": [1, 2], + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..e23013db2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": [[[1, 2], [3, 4], [5, 6], [1, 2]]], + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..88f1e84ff --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "onDelete": "cascade", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-row.md b/examples/2.0.x/server-rest/examples/tablesdb/update-row.md new file mode 100644 index 000000000..38b7a5429 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-row.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-rows.md b/examples/2.0.x/server-rest/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..2cd5e8ca1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-rows.md @@ -0,0 +1,20 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, + "queries": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..e9c55f1bf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-string-column.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "size": 1, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-table.md b/examples/2.0.x/server-rest/examples/tablesdb/update-table.md new file mode 100644 index 000000000..2fb75318a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-table.md @@ -0,0 +1,16 @@ +```http +PUT /v1/tablesdb/{databaseId}/tables/{tableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "rowSecurity": false, + "enabled": false, + "purge": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..4cab6577f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-text-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/text/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-rest/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..41b92502d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/tablesdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..e386bcd82 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-url-column.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "https://example.com", + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-rest/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..4c1c0785c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,15 @@ +```http +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/varchar/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "required": false, + "default": "Hello World", + "size": 1, + "newKey": "<NEW_KEY>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/update.md b/examples/2.0.x/server-rest/examples/tablesdb/update.md new file mode 100644 index 000000000..e20ba6454 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/update.md @@ -0,0 +1,13 @@ +```http +PUT /v1/tablesdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-rest/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..58e59c123 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/upsert-row.md @@ -0,0 +1,20 @@ +```http +PUT /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-rest/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..1420d99cf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tablesdb/upsert-rows.md @@ -0,0 +1,13 @@ +```http +PUT /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "rows": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/teams/create-membership.md b/examples/2.0.x/server-rest/examples/teams/create-membership.md new file mode 100644 index 000000000..acbb9d24c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/create-membership.md @@ -0,0 +1,17 @@ +```http +POST /v1/teams/{teamId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "email": "email@example.com", + "userId": "<USER_ID>", + "phone": "+12065550100", + "roles": [], + "url": "https://example.com", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/teams/create.md b/examples/2.0.x/server-rest/examples/teams/create.md new file mode 100644 index 000000000..0cac39156 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/create.md @@ -0,0 +1,14 @@ +```http +POST /v1/teams HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "teamId": "<TEAM_ID>", + "name": "<NAME>", + "roles": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/teams/delete-membership.md b/examples/2.0.x/server-rest/examples/teams/delete-membership.md new file mode 100644 index 000000000..4867caf91 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/delete-membership.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/teams/delete.md b/examples/2.0.x/server-rest/examples/teams/delete.md new file mode 100644 index 000000000..230618bce --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/teams/get-membership.md b/examples/2.0.x/server-rest/examples/teams/get-membership.md new file mode 100644 index 000000000..c6ce455b5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/get-membership.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/teams/get-prefs.md b/examples/2.0.x/server-rest/examples/teams/get-prefs.md new file mode 100644 index 000000000..d095e5a09 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/get-prefs.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams/{teamId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/teams/get.md b/examples/2.0.x/server-rest/examples/teams/get.md new file mode 100644 index 000000000..196fec42a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/teams/list-memberships.md b/examples/2.0.x/server-rest/examples/teams/list-memberships.md new file mode 100644 index 000000000..aab0c9d4c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/list-memberships.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams/{teamId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/teams/list.md b/examples/2.0.x/server-rest/examples/teams/list.md new file mode 100644 index 000000000..acfa096fd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/teams HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/teams/update-membership-status.md b/examples/2.0.x/server-rest/examples/teams/update-membership-status.md new file mode 100644 index 000000000..f185b0197 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/update-membership-status.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/teams/{teamId}/memberships/{membershipId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/teams/update-membership.md b/examples/2.0.x/server-rest/examples/teams/update-membership.md new file mode 100644 index 000000000..2e7725816 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/update-membership.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "roles": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/teams/update-name.md b/examples/2.0.x/server-rest/examples/teams/update-name.md new file mode 100644 index 000000000..91fb4b145 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/update-name.md @@ -0,0 +1,12 @@ +```http +PUT /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/teams/update-prefs.md b/examples/2.0.x/server-rest/examples/teams/update-prefs.md new file mode 100644 index 000000000..b75b21f25 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/teams/update-prefs.md @@ -0,0 +1,12 @@ +```http +PUT /v1/teams/{teamId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "prefs": {} +} +``` diff --git a/examples/2.0.x/server-rest/examples/tokens/create-file-token.md b/examples/2.0.x/server-rest/examples/tokens/create-file-token.md new file mode 100644 index 000000000..54d76cfb0 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tokens/create-file-token.md @@ -0,0 +1,12 @@ +```http +POST /v1/tokens/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "expire": "2020-10-15T06:38:00.000+00:00" +} +``` diff --git a/examples/2.0.x/server-rest/examples/tokens/delete.md b/examples/2.0.x/server-rest/examples/tokens/delete.md new file mode 100644 index 000000000..ac054cfb5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tokens/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/tokens/{tokenId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/tokens/get.md b/examples/2.0.x/server-rest/examples/tokens/get.md new file mode 100644 index 000000000..548894e01 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tokens/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/tokens/{tokenId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tokens/list.md b/examples/2.0.x/server-rest/examples/tokens/list.md new file mode 100644 index 000000000..0792d2c35 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tokens/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/tokens/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/tokens/update.md b/examples/2.0.x/server-rest/examples/tokens/update.md new file mode 100644 index 000000000..ab34ca0d1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/tokens/update.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/tokens/{tokenId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "expire": "2020-10-15T06:38:00.000+00:00" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-argon-2-user.md b/examples/2.0.x/server-rest/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..8aa34489e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-argon-2-user.md @@ -0,0 +1,15 @@ +```http +POST /v1/users/argon2 HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-rest/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..33a7f7a06 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-bcrypt-user.md @@ -0,0 +1,15 @@ +```http +POST /v1/users/bcrypt HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-jwt.md b/examples/2.0.x/server-rest/examples/users/create-jwt.md new file mode 100644 index 000000000..7041c665d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-jwt.md @@ -0,0 +1,13 @@ +```http +POST /v1/users/{userId}/jwts HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "sessionId": "recent()", + "duration": 0 +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-md-5-user.md b/examples/2.0.x/server-rest/examples/users/create-md-5-user.md new file mode 100644 index 000000000..1cb1301e6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-md-5-user.md @@ -0,0 +1,15 @@ +```http +POST /v1/users/md5 HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-rest/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..fcbb79b06 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```http +PATCH /v1/users/{userId}/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-rest/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..9de23041a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-ph-pass-user.md @@ -0,0 +1,15 @@ +```http +POST /v1/users/phpass HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-rest/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..9ac648aea --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,18 @@ +```http +POST /v1/users/scrypt-modified HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "passwordSalt": "<PASSWORD_SALT>", + "passwordSaltSeparator": "<PASSWORD_SALT_SEPARATOR>", + "passwordSignerKey": "<PASSWORD_SIGNER_KEY>", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-scrypt-user.md b/examples/2.0.x/server-rest/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..99677dd44 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-scrypt-user.md @@ -0,0 +1,20 @@ +```http +POST /v1/users/scrypt HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "passwordSalt": "<PASSWORD_SALT>", + "passwordCpu": 8, + "passwordMemory": 65536, + "passwordParallel": 1, + "passwordLength": 64, + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-session.md b/examples/2.0.x/server-rest/examples/users/create-session.md new file mode 100644 index 000000000..0071d467f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-session.md @@ -0,0 +1,9 @@ +```http +POST /v1/users/{userId}/sessions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-sha-user.md b/examples/2.0.x/server-rest/examples/users/create-sha-user.md new file mode 100644 index 000000000..069fe98e2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-sha-user.md @@ -0,0 +1,16 @@ +```http +POST /v1/users/sha HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "passwordVersion": "sha1", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-target.md b/examples/2.0.x/server-rest/examples/users/create-target.md new file mode 100644 index 000000000..83f3a2229 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-target.md @@ -0,0 +1,16 @@ +```http +POST /v1/users/{userId}/targets HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "targetId": "<TARGET_ID>", + "providerType": "email", + "identifier": "<IDENTIFIER>", + "providerId": "<PROVIDER_ID>", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create-token.md b/examples/2.0.x/server-rest/examples/users/create-token.md new file mode 100644 index 000000000..917cb594e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create-token.md @@ -0,0 +1,13 @@ +```http +POST /v1/users/{userId}/tokens HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "length": 4, + "expire": 60 +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/create.md b/examples/2.0.x/server-rest/examples/users/create.md new file mode 100644 index 000000000..f2b48abf3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/create.md @@ -0,0 +1,16 @@ +```http +POST /v1/users HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "phone": "+12065550100", + "password": "password", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/delete-identity.md b/examples/2.0.x/server-rest/examples/users/delete-identity.md new file mode 100644 index 000000000..25adb4cae --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/delete-identity.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/users/identities/{identityId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-rest/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..e8eb10110 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/users/{userId}/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/delete-session.md b/examples/2.0.x/server-rest/examples/users/delete-session.md new file mode 100644 index 000000000..ffd162a08 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/delete-session.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/users/{userId}/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/delete-sessions.md b/examples/2.0.x/server-rest/examples/users/delete-sessions.md new file mode 100644 index 000000000..188fae004 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/delete-sessions.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/users/{userId}/sessions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/delete-target.md b/examples/2.0.x/server-rest/examples/users/delete-target.md new file mode 100644 index 000000000..2e1945c07 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/delete-target.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/users/{userId}/targets/{targetId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/delete.md b/examples/2.0.x/server-rest/examples/users/delete.md new file mode 100644 index 000000000..d68ac8ea7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/users/{userId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-rest/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..d6f15f829 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/get-mfa-challenge.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId}/mfa/challenges/{challengeId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-rest/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..528adf3a3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId}/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/get-prefs.md b/examples/2.0.x/server-rest/examples/users/get-prefs.md new file mode 100644 index 000000000..829b8f4e2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/get-prefs.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/get-target.md b/examples/2.0.x/server-rest/examples/users/get-target.md new file mode 100644 index 000000000..17d4c2f67 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/get-target.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId}/targets/{targetId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/get.md b/examples/2.0.x/server-rest/examples/users/get.md new file mode 100644 index 000000000..910cca8e2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/list-identities.md b/examples/2.0.x/server-rest/examples/users/list-identities.md new file mode 100644 index 000000000..d71f3d058 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/list-identities.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/identities HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/list-memberships.md b/examples/2.0.x/server-rest/examples/users/list-memberships.md new file mode 100644 index 000000000..605178b9e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/list-memberships.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/list-mfa-factors.md b/examples/2.0.x/server-rest/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..766c0e85c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/list-mfa-factors.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId}/mfa/factors HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/list-sessions.md b/examples/2.0.x/server-rest/examples/users/list-sessions.md new file mode 100644 index 000000000..0143fffb8 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/list-sessions.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId}/sessions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/list-targets.md b/examples/2.0.x/server-rest/examples/users/list-targets.md new file mode 100644 index 000000000..1a177316b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/list-targets.md @@ -0,0 +1,7 @@ +```http +GET /v1/users/{userId}/targets HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/list.md b/examples/2.0.x/server-rest/examples/users/list.md new file mode 100644 index 000000000..84de962ca --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/users HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-email-verification.md b/examples/2.0.x/server-rest/examples/users/update-email-verification.md new file mode 100644 index 000000000..54300f69c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-email-verification.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/verification HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "emailVerification": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-email.md b/examples/2.0.x/server-rest/examples/users/update-email.md new file mode 100644 index 000000000..966d21c08 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-email.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "email": "email@example.com" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-impersonator.md b/examples/2.0.x/server-rest/examples/users/update-impersonator.md new file mode 100644 index 000000000..0ad1ab24c --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-impersonator.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/impersonator HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "impersonator": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-labels.md b/examples/2.0.x/server-rest/examples/users/update-labels.md new file mode 100644 index 000000000..45494ceae --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-labels.md @@ -0,0 +1,12 @@ +```http +PUT /v1/users/{userId}/labels HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "labels": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-rest/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..11901b715 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +```http +PUT /v1/users/{userId}/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-mfa.md b/examples/2.0.x/server-rest/examples/users/update-mfa.md new file mode 100644 index 000000000..9cc10a66a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-mfa.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/mfa HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "mfa": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-name.md b/examples/2.0.x/server-rest/examples/users/update-name.md new file mode 100644 index 000000000..5324c15f0 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-name.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/name HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-password.md b/examples/2.0.x/server-rest/examples/users/update-password.md new file mode 100644 index 000000000..c835c4389 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-password.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/password HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "password": "password" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-phone-verification.md b/examples/2.0.x/server-rest/examples/users/update-phone-verification.md new file mode 100644 index 000000000..d786517b6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-phone-verification.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/verification/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "phoneVerification": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-phone.md b/examples/2.0.x/server-rest/examples/users/update-phone.md new file mode 100644 index 000000000..84f1acb3b --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-phone.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "number": "+12065550100" +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-prefs.md b/examples/2.0.x/server-rest/examples/users/update-prefs.md new file mode 100644 index 000000000..eb239cbcd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-prefs.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "prefs": {} +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-status.md b/examples/2.0.x/server-rest/examples/users/update-status.md new file mode 100644 index 000000000..d310eb918 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-status.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/users/{userId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "status": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/users/update-target.md b/examples/2.0.x/server-rest/examples/users/update-target.md new file mode 100644 index 000000000..a3b297cbf --- /dev/null +++ b/examples/2.0.x/server-rest/examples/users/update-target.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/users/{userId}/targets/{targetId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "identifier": "<IDENTIFIER>", + "providerId": "<PROVIDER_ID>", + "name": "<NAME>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-rest/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..24394c4ad --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/create-collection.md @@ -0,0 +1,17 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "collectionId": "<COLLECTION_ID>", + "name": "<NAME>", + "dimension": 1, + "permissions": ["read(\"any\")"], + "documentSecurity": false, + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/create-document.md b/examples/2.0.x/server-rest/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..97fba9e4a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documentId": "<DOCUMENT_ID>", + "data": { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + }, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-rest/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..aeb747dee --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/create-documents.md @@ -0,0 +1,13 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documents": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/create-index.md b/examples/2.0.x/server-rest/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..7948d8511 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/create-index.md @@ -0,0 +1,16 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections/{collectionId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "key": "<KEY>", + "type": "hnsw_euclidean", + "attributes": [], + "orders": [], + "lengths": [] +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-rest/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..7ad3d0670 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/create-operations.md @@ -0,0 +1,22 @@ +```http +POST /v1/vectorsdb/transactions/{transactionId}/operations HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "operations": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/create-query.md b/examples/2.0.x/server-rest/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..9eebb305d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/create-query.md @@ -0,0 +1,15 @@ +```http +POST /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/query HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "queries": [], + "transactionId": "<TRANSACTION_ID>", + "total": false, + "ttl": 0 +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-rest/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..50915dfc1 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/create-transaction.md @@ -0,0 +1,12 @@ +```http +POST /v1/vectorsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "ttl": 60 +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/create.md b/examples/2.0.x/server-rest/examples/vectorsdb/create.md new file mode 100644 index 000000000..e4926937a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/create.md @@ -0,0 +1,14 @@ +```http +POST /v1/vectorsdb HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "databaseId": "<DATABASE_ID>", + "name": "<NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-rest/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..eeb98927e --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/delete-collection.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-rest/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..6380db120 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/delete-document.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-rest/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..e0c3474e2 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/delete-documents.md @@ -0,0 +1,9 @@ +```http +DELETE /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-rest/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..7275a1cbc --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/delete-index.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-rest/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..6d65fcf3f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/delete.md b/examples/2.0.x/server-rest/examples/vectorsdb/delete.md new file mode 100644 index 000000000..6c60fcc82 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/vectorsdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-rest/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..1229989eb --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/get-collection.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/get-document.md b/examples/2.0.x/server-rest/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..f45584471 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/get-document.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/get-index.md b/examples/2.0.x/server-rest/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..4f775c8e5 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/get-index.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-rest/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..c75b0f3b3 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/get-transaction.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/get.md b/examples/2.0.x/server-rest/examples/vectorsdb/get.md new file mode 100644 index 000000000..6766f170f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-rest/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..8af664fc7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/list-collections.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-rest/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..7a71b311d --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/list-documents.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-rest/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..8032ddfe7 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/list-indexes.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/{databaseId}/collections/{collectionId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-rest/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..ae17b9673 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/list-transactions.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb/transactions HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/list.md b/examples/2.0.x/server-rest/examples/vectorsdb/list.md new file mode 100644 index 000000000..024c435f9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/vectorsdb HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-rest/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..5351b6780 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/update-collection.md @@ -0,0 +1,16 @@ +```http +PUT /v1/vectorsdb/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "dimension": 1, + "permissions": ["read(\"any\")"], + "documentSecurity": false, + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/update-document.md b/examples/2.0.x/server-rest/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..8575c4f0a --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/update-document.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-rest/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..34eccb59f --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/update-documents.md @@ -0,0 +1,14 @@ +```http +PATCH /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": {}, + "queries": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-rest/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..cb67d33a9 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/update-transaction.md @@ -0,0 +1,13 @@ +```http +PATCH /v1/vectorsdb/transactions/{transactionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "commit": false, + "rollback": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/update.md b/examples/2.0.x/server-rest/examples/vectorsdb/update.md new file mode 100644 index 000000000..c4bd5d6fb --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/update.md @@ -0,0 +1,13 @@ +```http +PUT /v1/vectorsdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "enabled": false +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-rest/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..a5ac42587 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/upsert-document.md @@ -0,0 +1,14 @@ +```http +PUT /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "data": {}, + "permissions": ["read(\"any\")"], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-rest/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..888e80cb4 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,13 @@ +```http +PUT /v1/vectorsdb/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "documents": [], + "transactionId": "<TRANSACTION_ID>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/webhooks/create.md b/examples/2.0.x/server-rest/examples/webhooks/create.md new file mode 100644 index 000000000..f49568b68 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/webhooks/create.md @@ -0,0 +1,20 @@ +```http +POST /v1/webhooks HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "webhookId": "<WEBHOOK_ID>", + "url": "https://example.com/webhook", + "name": "<NAME>", + "events": [], + "enabled": false, + "tls": false, + "authUsername": "<AUTH_USERNAME>", + "authPassword": "password", + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/webhooks/delete.md b/examples/2.0.x/server-rest/examples/webhooks/delete.md new file mode 100644 index 000000000..a49d328db --- /dev/null +++ b/examples/2.0.x/server-rest/examples/webhooks/delete.md @@ -0,0 +1,8 @@ +```http +DELETE /v1/webhooks/{webhookId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +``` diff --git a/examples/2.0.x/server-rest/examples/webhooks/get.md b/examples/2.0.x/server-rest/examples/webhooks/get.md new file mode 100644 index 000000000..443cba0d6 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/webhooks/get.md @@ -0,0 +1,7 @@ +```http +GET /v1/webhooks/{webhookId} HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/webhooks/list.md b/examples/2.0.x/server-rest/examples/webhooks/list.md new file mode 100644 index 000000000..6e1e9fdea --- /dev/null +++ b/examples/2.0.x/server-rest/examples/webhooks/list.md @@ -0,0 +1,7 @@ +```http +GET /v1/webhooks HTTP/1.1 +Host: cloud.appwrite.io +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +``` diff --git a/examples/2.0.x/server-rest/examples/webhooks/update-secret.md b/examples/2.0.x/server-rest/examples/webhooks/update-secret.md new file mode 100644 index 000000000..2a6def6f0 --- /dev/null +++ b/examples/2.0.x/server-rest/examples/webhooks/update-secret.md @@ -0,0 +1,12 @@ +```http +PATCH /v1/webhooks/{webhookId}/secret HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "secret": "<SECRET>" +} +``` diff --git a/examples/2.0.x/server-rest/examples/webhooks/update.md b/examples/2.0.x/server-rest/examples/webhooks/update.md new file mode 100644 index 000000000..bbb5510cd --- /dev/null +++ b/examples/2.0.x/server-rest/examples/webhooks/update.md @@ -0,0 +1,18 @@ +```http +PUT /v1/webhooks/{webhookId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +Accept: application/json +X-Appwrite-Response-Format: 2.0.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "name": "<NAME>", + "url": "https://example.com/webhook", + "events": [], + "enabled": false, + "tls": false, + "authUsername": "<AUTH_USERNAME>", + "authPassword": "password" +} +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-anonymous-session.md b/examples/2.0.x/server-ruby/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..0fce57505 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-anonymous-session.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_anonymous_session() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-email-password-session.md b/examples/2.0.x/server-ruby/examples/account/create-email-password-session.md new file mode 100644 index 000000000..57ab742da --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-email-password-session.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_email_password_session( + email: 'email@example.com', + password: 'password' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-email-token.md b/examples/2.0.x/server-ruby/examples/account/create-email-token.md new file mode 100644 index 000000000..e259f8132 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-email-token.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_email_token( + user_id: '<USER_ID>', + email: 'email@example.com', + phrase: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-email-verification.md b/examples/2.0.x/server-ruby/examples/account/create-email-verification.md new file mode 100644 index 000000000..b2351cc46 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-email-verification.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_email_verification( + url: 'https://example.com' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-magic-url-token.md b/examples/2.0.x/server-ruby/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..e84c21512 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-magic-url-token.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_magic_url_token( + user_id: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', # optional + phrase: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-ruby/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..5d80789dc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-mfa-authenticator.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_mfa_authenticator( + type: AuthenticatorType::TOTP +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-ruby/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..117f86f89 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-mfa-challenge.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_mfa_challenge( + factor: AuthenticationFactor::EMAIL +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-ruby/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..680f9df3e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_mfa_recovery_codes() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-ruby/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..4dbba2f03 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-o-auth-2-token.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_o_auth2_token( + provider: OAuthProvider::AMAZON, + success: 'https://example.com', # optional + failure: 'https://example.com', # optional + scopes: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-phone-token.md b/examples/2.0.x/server-ruby/examples/account/create-phone-token.md new file mode 100644 index 000000000..e291fd0ed --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-phone-token.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_phone_token( + user_id: '<USER_ID>', + phone: '+12065550100' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-phone-verification.md b/examples/2.0.x/server-ruby/examples/account/create-phone-verification.md new file mode 100644 index 000000000..0bf3df115 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-phone-verification.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_phone_verification() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-recovery.md b/examples/2.0.x/server-ruby/examples/account/create-recovery.md new file mode 100644 index 000000000..380dde1d2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-recovery.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_recovery( + email: 'email@example.com', + url: 'https://example.com' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-session.md b/examples/2.0.x/server-ruby/examples/account/create-session.md new file mode 100644 index 000000000..dcc2bd7ef --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-session.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_session( + user_id: '<USER_ID>', + secret: '<SECRET>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create-verification.md b/examples/2.0.x/server-ruby/examples/account/create-verification.md new file mode 100644 index 000000000..278198864 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create-verification.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_verification( + url: 'https://example.com' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/create.md b/examples/2.0.x/server-ruby/examples/account/create.md new file mode 100644 index 000000000..683fd89dd --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/create.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/delete-identity.md b/examples/2.0.x/server-ruby/examples/account/delete-identity.md new file mode 100644 index 000000000..fa6a2264f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/delete-identity.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.delete_identity( + identity_id: '<IDENTITY_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-ruby/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..76efdab1f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.delete_mfa_authenticator( + type: AuthenticatorType::TOTP +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/delete-session.md b/examples/2.0.x/server-ruby/examples/account/delete-session.md new file mode 100644 index 000000000..83a201ce3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/delete-session.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.delete_session( + session_id: '<SESSION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/delete-sessions.md b/examples/2.0.x/server-ruby/examples/account/delete-sessions.md new file mode 100644 index 000000000..3008032f0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/delete-sessions.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.delete_sessions() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-ruby/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..144abb0bd --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.get_mfa_recovery_codes() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/get-prefs.md b/examples/2.0.x/server-ruby/examples/account/get-prefs.md new file mode 100644 index 000000000..9cbebfea1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/get-prefs.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.get_prefs() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/get-session.md b/examples/2.0.x/server-ruby/examples/account/get-session.md new file mode 100644 index 000000000..d8b68f099 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/get-session.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.get_session( + session_id: '<SESSION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/get.md b/examples/2.0.x/server-ruby/examples/account/get.md new file mode 100644 index 000000000..4615dab17 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/get.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.get() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/list-identities.md b/examples/2.0.x/server-ruby/examples/account/list-identities.md new file mode 100644 index 000000000..e66dade30 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/list-identities.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.list_identities( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/list-mfa-factors.md b/examples/2.0.x/server-ruby/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..c172d71a7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/list-mfa-factors.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.list_mfa_factors() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/list-sessions.md b/examples/2.0.x/server-ruby/examples/account/list-sessions.md new file mode 100644 index 000000000..47d2c033c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/list-sessions.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.list_sessions() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-email-verification.md b/examples/2.0.x/server-ruby/examples/account/update-email-verification.md new file mode 100644 index 000000000..143d7924f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-email-verification.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_email_verification( + user_id: '<USER_ID>', + secret: '<SECRET>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-email.md b/examples/2.0.x/server-ruby/examples/account/update-email.md new file mode 100644 index 000000000..606a93651 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-email.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_email( + email: 'email@example.com', + password: 'password' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-magic-url-session.md b/examples/2.0.x/server-ruby/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..e37318283 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-magic-url-session.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_magic_url_session( + user_id: '<USER_ID>', + secret: '<SECRET>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-ruby/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..89c165264 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-mfa-authenticator.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_mfa_authenticator( + type: AuthenticatorType::TOTP, + otp: '<OTP>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-ruby/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..60e271f45 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-mfa-challenge.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_mfa_challenge( + challenge_id: '<CHALLENGE_ID>', + otp: '<OTP>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-ruby/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..e9bd85857 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_mfa_recovery_codes() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-mfa.md b/examples/2.0.x/server-ruby/examples/account/update-mfa.md new file mode 100644 index 000000000..1806f7c4a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-mfa.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_mfa( + mfa: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-name.md b/examples/2.0.x/server-ruby/examples/account/update-name.md new file mode 100644 index 000000000..9904c8c40 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-name.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_name( + name: '<NAME>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-password.md b/examples/2.0.x/server-ruby/examples/account/update-password.md new file mode 100644 index 000000000..1e9aba5ad --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-password.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_password( + password: 'password', + old_password: 'password' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-phone-session.md b/examples/2.0.x/server-ruby/examples/account/update-phone-session.md new file mode 100644 index 000000000..318840494 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-phone-session.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_phone_session( + user_id: '<USER_ID>', + secret: '<SECRET>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-phone-verification.md b/examples/2.0.x/server-ruby/examples/account/update-phone-verification.md new file mode 100644 index 000000000..a3904a9a1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-phone-verification.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_phone_verification( + user_id: '<USER_ID>', + secret: '<SECRET>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-phone.md b/examples/2.0.x/server-ruby/examples/account/update-phone.md new file mode 100644 index 000000000..6501becc1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-phone.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_phone( + phone: '+12065550100', + password: 'password' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-prefs.md b/examples/2.0.x/server-ruby/examples/account/update-prefs.md new file mode 100644 index 000000000..847cff42d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-prefs.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_prefs( + prefs: { + "language" => "en", + "timezone" => "UTC", + "darkTheme" => true + } +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-recovery.md b/examples/2.0.x/server-ruby/examples/account/update-recovery.md new file mode 100644 index 000000000..e3cfb643b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-recovery.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_recovery( + user_id: '<USER_ID>', + secret: '<SECRET>', + password: 'password' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-session.md b/examples/2.0.x/server-ruby/examples/account/update-session.md new file mode 100644 index 000000000..5919db026 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-session.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_session( + session_id: '<SESSION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-status.md b/examples/2.0.x/server-ruby/examples/account/update-status.md new file mode 100644 index 000000000..725bd31ca --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-status.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_status() +``` diff --git a/examples/2.0.x/server-ruby/examples/account/update-verification.md b/examples/2.0.x/server-ruby/examples/account/update-verification.md new file mode 100644 index 000000000..bee759fc9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/account/update-verification.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_verification( + user_id: '<USER_ID>', + secret: '<SECRET>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/advisor/delete-report.md b/examples/2.0.x/server-ruby/examples/advisor/delete-report.md new file mode 100644 index 000000000..1139bb71e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/advisor/delete-report.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor.new(client) + +result = advisor.delete_report( + report_id: '<REPORT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/advisor/get-insight.md b/examples/2.0.x/server-ruby/examples/advisor/get-insight.md new file mode 100644 index 000000000..e9fd0ac31 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/advisor/get-insight.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor.new(client) + +result = advisor.get_insight( + report_id: '<REPORT_ID>', + insight_id: '<INSIGHT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/advisor/get-report.md b/examples/2.0.x/server-ruby/examples/advisor/get-report.md new file mode 100644 index 000000000..919cc2850 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/advisor/get-report.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor.new(client) + +result = advisor.get_report( + report_id: '<REPORT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/advisor/list-insights.md b/examples/2.0.x/server-ruby/examples/advisor/list-insights.md new file mode 100644 index 000000000..59e97ad87 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/advisor/list-insights.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor.new(client) + +result = advisor.list_insights( + report_id: '<REPORT_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/advisor/list-reports.md b/examples/2.0.x/server-ruby/examples/advisor/list-reports.md new file mode 100644 index 000000000..11670c30a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/advisor/list-reports.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +advisor = Advisor.new(client) + +result = advisor.list_reports( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-browser.md b/examples/2.0.x/server-ruby/examples/avatars/get-browser.md new file mode 100644 index 000000000..2c9c1272d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-browser.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_browser( + code: Browser::AVANT_BROWSER, + width: 0, # optional + height: 0, # optional + quality: -1 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-credit-card.md b/examples/2.0.x/server-ruby/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..a912b9cd4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-credit-card.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_credit_card( + code: CreditCard::AMERICAN_EXPRESS, + width: 0, # optional + height: 0, # optional + quality: -1 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-favicon.md b/examples/2.0.x/server-ruby/examples/avatars/get-favicon.md new file mode 100644 index 000000000..a50b91a85 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-favicon.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_favicon( + url: 'https://example.com' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-flag.md b/examples/2.0.x/server-ruby/examples/avatars/get-flag.md new file mode 100644 index 000000000..a2f120672 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-flag.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_flag( + code: Flag::AFGHANISTAN, + width: 0, # optional + height: 0, # optional + quality: -1 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-image.md b/examples/2.0.x/server-ruby/examples/avatars/get-image.md new file mode 100644 index 000000000..b3bcce331 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-image.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_image( + url: 'https://example.com', + width: 0, # optional + height: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-initials.md b/examples/2.0.x/server-ruby/examples/avatars/get-initials.md new file mode 100644 index 000000000..728777d75 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-initials.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_initials( + name: '<NAME>', # optional + width: 0, # optional + height: 0, # optional + background: 'FFFFFF' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-photo.md b/examples/2.0.x/server-ruby/examples/avatars/get-photo.md new file mode 100644 index 000000000..37659bcbb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-photo.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_photo( + width: 0, # optional + height: 0, # optional + quality: 0, # optional + output: 'png', # optional + rating: 'g', # optional + user_id: 'current()', # optional + email_hash: '<EMAIL_HASH>', # optional + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-qr.md b/examples/2.0.x/server-ruby/examples/avatars/get-qr.md new file mode 100644 index 000000000..2ccde309a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-qr.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_qr( + text: '<TEXT>', + size: 1, # optional + margin: 0, # optional + download: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/avatars/get-screenshot.md b/examples/2.0.x/server-ruby/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..742c87fd9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/avatars/get-screenshot.md @@ -0,0 +1,39 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_screenshot( + url: 'https://example.com', + headers: { + "Authorization" => "Bearer token123", + "X-Custom-Header" => "value" + }, # optional + viewport_width: 1920, # optional + viewport_height: 1080, # optional + scale: 2, # optional + theme: BrowserTheme::DARK, # optional + user_agent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', # optional + fullpage: true, # optional + locale: 'en-US', # optional + timezone: Timezone::AFRICA_ABIDJAN, # optional + latitude: 37.7749, # optional + longitude: -122.4194, # optional + accuracy: 100, # optional + touch: true, # optional + permissions: [BrowserPermission::GEOLOCATION, BrowserPermission::NOTIFICATIONS], # optional + sleep: 3, # optional + width: 800, # optional + height: 600, # optional + quality: 85, # optional + output: ImageFormat::JPEG # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..b808068c7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-big-int-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_big_int_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, # optional + max: 1000000, # optional + default: 0, # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..95879a9c8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-boolean-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_boolean_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: false, # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-collection.md b/examples/2.0.x/server-ruby/examples/databases/create-collection.md new file mode 100644 index 000000000..3b21dc545 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-collection.md @@ -0,0 +1,25 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], # optional + document_security: false, # optional + enabled: false, # optional + attributes: [], # optional + indexes: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..8cc00eabf --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-datetime-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_datetime_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: '2020-10-15T06:38:00.000+00:00', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-document.md b/examples/2.0.x/server-ruby/examples/databases/create-document.md new file mode 100644 index 000000000..6398a210b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-document.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.create_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 30, + "isAdmin" => false + }, + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-documents.md b/examples/2.0.x/server-ruby/examples/databases/create-documents.md new file mode 100644 index 000000000..60acd19f7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + documents: [], + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-email-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..29d022461 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-email-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_email_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'email@example.com', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..e5975c020 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-enum-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_enum_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + required: false, + default: 'active', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-float-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..62eeecd8d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-float-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_float_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, # optional + max: 100, # optional + default: 10.5, # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-index.md b/examples/2.0.x/server-ruby/examples/databases/create-index.md new file mode 100644 index 000000000..e3e9238a9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-index.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + type: DatabasesIndexType::KEY, + attributes: [], + orders: [OrderBy::ASC], # optional + lengths: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..6b6d3a86a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-integer-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_integer_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + min: 0, # optional + max: 100, # optional + default: 10, # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..a64553ff3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-ip-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_ip_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: '192.0.2.0', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-line-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..8c2845f0c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-line-attribute.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_line_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [[1, 2], [3, 4], [5, 6]] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..a7cc06f4d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-longtext-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_longtext_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..84b609cd4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_mediumtext_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-operations.md b/examples/2.0.x/server-ruby/examples/databases/create-operations.md new file mode 100644 index 000000000..5fffcc05b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-operations.md @@ -0,0 +1,27 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_operations( + transaction_id: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-point-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..cb61a8646 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-point-attribute.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_point_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [1, 2] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..2a3e43321 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-polygon-attribute.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_polygon_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..fca5aadf4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-relationship-attribute.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_relationship_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + related_collection_id: '<RELATED_COLLECTION_ID>', + type: RelationshipType::ONETOONE, + two_way: false, # optional + key: '<KEY>', # optional + two_way_key: '<TWO_WAY_KEY>', # optional + on_delete: RelationMutate::CASCADE # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-string-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..014578058 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-string-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_string_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + size: 1, + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-text-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..b231a0a15 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-text-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_text_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-transaction.md b/examples/2.0.x/server-ruby/examples/databases/create-transaction.md new file mode 100644 index 000000000..86c61cd7f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_transaction( + ttl: 60 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-url-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..4078fb147 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-url-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_url_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'https://example.com', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-ruby/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..5d965bd5b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create-varchar-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_varchar_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + size: 1, + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/create.md b/examples/2.0.x/server-ruby/examples/databases/create.md new file mode 100644 index 000000000..c59b42306 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/create.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-ruby/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..a91aafc44 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.decrement_document_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, # optional + min: 0, # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/delete-attribute.md b/examples/2.0.x/server-ruby/examples/databases/delete-attribute.md new file mode 100644 index 000000000..56269a2d4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/delete-attribute.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/delete-collection.md b/examples/2.0.x/server-ruby/examples/databases/delete-collection.md new file mode 100644 index 000000000..1ec714e92 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/delete-collection.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/delete-document.md b/examples/2.0.x/server-ruby/examples/databases/delete-document.md new file mode 100644 index 000000000..4ca8c4e52 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/delete-document.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.delete_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/delete-documents.md b/examples/2.0.x/server-ruby/examples/databases/delete-documents.md new file mode 100644 index 000000000..c9309bd9d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/delete-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/delete-index.md b/examples/2.0.x/server-ruby/examples/databases/delete-index.md new file mode 100644 index 000000000..404bc9b07 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/delete-index.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/delete-transaction.md b/examples/2.0.x/server-ruby/examples/databases/delete-transaction.md new file mode 100644 index 000000000..c181b3495 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/delete-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_transaction( + transaction_id: '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/delete.md b/examples/2.0.x/server-ruby/examples/databases/delete.md new file mode 100644 index 000000000..054534cce --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete( + database_id: '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/get-attribute.md b/examples/2.0.x/server-ruby/examples/databases/get-attribute.md new file mode 100644 index 000000000..7753ac466 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/get-attribute.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/get-collection.md b/examples/2.0.x/server-ruby/examples/databases/get-collection.md new file mode 100644 index 000000000..a3384568b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/get-collection.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/get-document.md b/examples/2.0.x/server-ruby/examples/databases/get-document.md new file mode 100644 index 000000000..3a976514b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/get-document.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.get_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/get-index.md b/examples/2.0.x/server-ruby/examples/databases/get-index.md new file mode 100644 index 000000000..fb6557c5b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/get-index.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/get-transaction.md b/examples/2.0.x/server-ruby/examples/databases/get-transaction.md new file mode 100644 index 000000000..33432aae3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/get-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get_transaction( + transaction_id: '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/get.md b/examples/2.0.x/server-ruby/examples/databases/get.md new file mode 100644 index 000000000..d8e46b69f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get( + database_id: '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-ruby/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..d3992e678 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/increment-document-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.increment_document_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, # optional + max: 100, # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/list-attributes.md b/examples/2.0.x/server-ruby/examples/databases/list-attributes.md new file mode 100644 index 000000000..32374674f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/list-attributes.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list_attributes( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/list-collections.md b/examples/2.0.x/server-ruby/examples/databases/list-collections.md new file mode 100644 index 000000000..d1ae8d985 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/list-collections.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list_collections( + database_id: '<DATABASE_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/list-documents.md b/examples/2.0.x/server-ruby/examples/databases/list-documents.md new file mode 100644 index 000000000..0e471e298 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/list-documents.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.list_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>', # optional + total: false, # optional + ttl: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/list-indexes.md b/examples/2.0.x/server-ruby/examples/databases/list-indexes.md new file mode 100644 index 000000000..17adc6049 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/list-indexes.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list_indexes( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/list-transactions.md b/examples/2.0.x/server-ruby/examples/databases/list-transactions.md new file mode 100644 index 000000000..9071982e7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/list-transactions.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list_transactions( + queries: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/list.md b/examples/2.0.x/server-ruby/examples/databases/list.md new file mode 100644 index 000000000..9c747c5ce --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..33d5b1f7d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-big-int-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_big_int_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 0, + min: 0, # optional + max: 1000000, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..086ffb2d2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-boolean-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_boolean_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: false, + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-collection.md b/examples/2.0.x/server-ruby/examples/databases/update-collection.md new file mode 100644 index 000000000..a3c190033 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-collection.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + name: '<NAME>', # optional + permissions: [Permission.read(Role.any())], # optional + document_security: false, # optional + enabled: false, # optional + purge: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..b56c18054 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-datetime-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_datetime_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: '2020-10-15T06:38:00.000+00:00', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-document.md b/examples/2.0.x/server-ruby/examples/databases/update-document.md new file mode 100644 index 000000000..27747e3ba --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-document.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.update_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 33, + "isAdmin" => false + }, # optional + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-documents.md b/examples/2.0.x/server-ruby/examples/databases/update-documents.md new file mode 100644 index 000000000..5ebb951f9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-documents.md @@ -0,0 +1,26 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 33, + "isAdmin" => false + }, # optional + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-email-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..207940878 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-email-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_email_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'email@example.com', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..a3f66c449 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-enum-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_enum_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + required: false, + default: 'active', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-float-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..5a652c7f3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-float-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_float_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 10.5, + min: 0, # optional + max: 100, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..47d7eb45e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-integer-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_integer_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 10, + min: 0, # optional + max: 100, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..3f7882893 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-ip-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_ip_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: '192.0.2.0', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-line-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..27754f2fd --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-line-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_line_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [[1, 2], [3, 4], [5, 6]], # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..ceca43a3a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-longtext-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_longtext_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..d82768ed9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_mediumtext_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-point-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..95ffce6ef --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-point-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_point_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [1, 2], # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..75582120c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-polygon-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_polygon_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..22541f0e5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-relationship-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_relationship_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + on_delete: RelationMutate::CASCADE, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-string-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..d6e3a76d8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-string-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_string_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + size: 1, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-text-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..c4b46f5b8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-text-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_text_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-transaction.md b/examples/2.0.x/server-ruby/examples/databases/update-transaction.md new file mode 100644 index 000000000..18598015f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-transaction.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_transaction( + transaction_id: '<TRANSACTION_ID>', + commit: false, # optional + rollback: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-url-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..9a3176426 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-url-attribute.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_url_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'https://example.com', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-ruby/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..07f216026 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update-varchar-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_varchar_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + size: 1, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/update.md b/examples/2.0.x/server-ruby/examples/databases/update.md new file mode 100644 index 000000000..a5c6d143b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/update.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update( + database_id: '<DATABASE_ID>', + name: '<NAME>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/upsert-document.md b/examples/2.0.x/server-ruby/examples/databases/upsert-document.md new file mode 100644 index 000000000..d196769e6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/upsert-document.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.upsert_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 30, + "isAdmin" => false + }, # optional + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/databases/upsert-documents.md b/examples/2.0.x/server-ruby/examples/databases/upsert-documents.md new file mode 100644 index 000000000..49432e01b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/databases/upsert-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.upsert_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + documents: [], + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/create-collection.md b/examples/2.0.x/server-ruby/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..60b4570f6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/create-collection.md @@ -0,0 +1,25 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.create_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], # optional + document_security: false, # optional + enabled: false, # optional + attributes: [], # optional + indexes: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/create-document.md b/examples/2.0.x/server-ruby/examples/documentsdb/create-document.md new file mode 100644 index 000000000..94b68b351 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/create-document.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.create_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 30, + "isAdmin" => false + }, + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/create-documents.md b/examples/2.0.x/server-ruby/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..1277f4aca --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/create-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.create_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + documents: [], + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/create-index.md b/examples/2.0.x/server-ruby/examples/documentsdb/create-index.md new file mode 100644 index 000000000..d1891f9ae --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/create-index.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.create_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + type: DocumentsDBIndexType::KEY, + attributes: [], + orders: [OrderBy::ASC], # optional + lengths: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/create-operations.md b/examples/2.0.x/server-ruby/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..8f96a15ca --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/create-operations.md @@ -0,0 +1,27 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.create_operations( + transaction_id: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-ruby/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..5f56cb235 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/create-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.create_transaction( + ttl: 60 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/create.md b/examples/2.0.x/server-ruby/examples/documentsdb/create.md new file mode 100644 index 000000000..48a26042d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/create.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.create( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-ruby/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..926c406b9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.decrement_document_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, # optional + min: 0, # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-ruby/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..886b2d68a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/delete-collection.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.delete_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/delete-document.md b/examples/2.0.x/server-ruby/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..d4482765f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/delete-document.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.delete_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-ruby/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..cd628c75f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/delete-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.delete_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/delete-index.md b/examples/2.0.x/server-ruby/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..cf25af04a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/delete-index.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.delete_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-ruby/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..017d541bc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/delete-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.delete_transaction( + transaction_id: '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/delete.md b/examples/2.0.x/server-ruby/examples/documentsdb/delete.md new file mode 100644 index 000000000..668637d51 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.delete( + database_id: '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/get-collection.md b/examples/2.0.x/server-ruby/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..d92c81093 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/get-collection.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.get_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/get-document.md b/examples/2.0.x/server-ruby/examples/documentsdb/get-document.md new file mode 100644 index 000000000..8f5b5c685 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/get-document.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.get_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/get-index.md b/examples/2.0.x/server-ruby/examples/documentsdb/get-index.md new file mode 100644 index 000000000..e6ba531b9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/get-index.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.get_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-ruby/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..3b586e38e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/get-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.get_transaction( + transaction_id: '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/get.md b/examples/2.0.x/server-ruby/examples/documentsdb/get.md new file mode 100644 index 000000000..ad7d06ab3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.get( + database_id: '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-ruby/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..abf9a5883 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.increment_document_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + attribute: '<ATTRIBUTE>', + value: 1, # optional + max: 100, # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/list-collections.md b/examples/2.0.x/server-ruby/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..6a784fb0f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/list-collections.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.list_collections( + database_id: '<DATABASE_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/list-documents.md b/examples/2.0.x/server-ruby/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..a2562675d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/list-documents.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.list_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>', # optional + total: false, # optional + ttl: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-ruby/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..b23b14915 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/list-indexes.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.list_indexes( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-ruby/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..82d368e17 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/list-transactions.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.list_transactions( + queries: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/list.md b/examples/2.0.x/server-ruby/examples/documentsdb/list.md new file mode 100644 index 000000000..df827a109 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.list( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/update-collection.md b/examples/2.0.x/server-ruby/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..2be8dca6f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/update-collection.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.update_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], # optional + document_security: false, # optional + enabled: false, # optional + purge: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/update-document.md b/examples/2.0.x/server-ruby/examples/documentsdb/update-document.md new file mode 100644 index 000000000..90e51e069 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/update-document.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.update_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: {}, # optional + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/update-documents.md b/examples/2.0.x/server-ruby/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..4f3bb64e9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/update-documents.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.update_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + data: {}, # optional + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-ruby/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..37a638e26 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/update-transaction.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.update_transaction( + transaction_id: '<TRANSACTION_ID>', + commit: false, # optional + rollback: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/update.md b/examples/2.0.x/server-ruby/examples/documentsdb/update.md new file mode 100644 index 000000000..05d20a94d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/update.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.update( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-ruby/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..ca6bace1b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/upsert-document.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +documents_db = DocumentsDB.new(client) + +result = documents_db.upsert_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: {}, # optional + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-ruby/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..f7f05970e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/documentsdb/upsert-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +documents_db = DocumentsDB.new(client) + +result = documents_db.upsert_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + documents: [], + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-ruby/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..facbe573f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +embeddings = Embeddings.new(client) + +result = embeddings.create_text_embeddings( + texts: [], + model: EmbeddingModel::NOMIC_EMBED_TEXT # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/create-deployment.md b/examples/2.0.x/server-ruby/examples/functions/create-deployment.md new file mode 100644 index 000000000..1bc2abdf9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/create-deployment.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_deployment( + function_id: '<FUNCTION_ID>', + code: InputFile.from_path('dir/file.png'), + activate: false, + entrypoint: '<ENTRYPOINT>', # optional + commands: '<COMMANDS>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-ruby/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..c39e3a7ea --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_duplicate_deployment( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>', + build_id: '<BUILD_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/create-execution.md b/examples/2.0.x/server-ruby/examples/functions/create-execution.md new file mode 100644 index 000000000..9c529150d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/create-execution.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +functions = Functions.new(client) + +result = functions.create_execution( + function_id: '<FUNCTION_ID>', + body: '<BODY>', # optional + async: false, # optional + path: '<PATH>', # optional + method: ExecutionMethod::GET, # optional + headers: {}, # optional + scheduled_at: '<SCHEDULED_AT>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/create-template-deployment.md b/examples/2.0.x/server-ruby/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..9f80f906d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/create-template-deployment.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_template_deployment( + function_id: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + root_directory: '<ROOT_DIRECTORY>', + type: TemplateReferenceType::COMMIT, + reference: '<REFERENCE>', + activate: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/create-variable.md b/examples/2.0.x/server-ruby/examples/functions/create-variable.md new file mode 100644 index 000000000..de8f763d5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/create-variable.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_variable( + function_id: '<FUNCTION_ID>', + variable_id: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-ruby/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..fe8d9917c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/create-vcs-deployment.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_vcs_deployment( + function_id: '<FUNCTION_ID>', + type: VCSReferenceType::BRANCH, + reference: '<REFERENCE>', + activate: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/create.md b/examples/2.0.x/server-ruby/examples/functions/create.md new file mode 100644 index 000000000..49c372650 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/create.md @@ -0,0 +1,38 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create( + function_id: '<FUNCTION_ID>', + name: '<NAME>', + runtime: Runtime::NODE_14_5, + execute: ["any"], # optional + events: [], # optional + schedule: '0 0 * * *', # optional + timeout: 1, # optional + enabled: false, # optional + logging: false, # optional + entrypoint: '<ENTRYPOINT>', # optional + commands: '<COMMANDS>', # optional + scopes: [ProjectKeyScopes::PROJECT_READ], # optional + installation_id: '<INSTALLATION_ID>', # optional + provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch: '<PROVIDER_BRANCH>', # optional + provider_silent_mode: false, # optional + provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional + provider_branches: [], # optional + provider_paths: [], # optional + build_specification: 's-1vcpu-512mb', # optional + runtime_specification: 's-1vcpu-512mb', # optional + deployment_retention: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/delete-deployment.md b/examples/2.0.x/server-ruby/examples/functions/delete-deployment.md new file mode 100644 index 000000000..42ee16cbc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/delete-deployment.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.delete_deployment( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/delete-execution.md b/examples/2.0.x/server-ruby/examples/functions/delete-execution.md new file mode 100644 index 000000000..8d125bcf1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/delete-execution.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.delete_execution( + function_id: '<FUNCTION_ID>', + execution_id: '<EXECUTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/delete-variable.md b/examples/2.0.x/server-ruby/examples/functions/delete-variable.md new file mode 100644 index 000000000..bd8e79e25 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/delete-variable.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.delete_variable( + function_id: '<FUNCTION_ID>', + variable_id: '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/delete.md b/examples/2.0.x/server-ruby/examples/functions/delete.md new file mode 100644 index 000000000..f895cd650 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.delete( + function_id: '<FUNCTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/get-deployment-download.md b/examples/2.0.x/server-ruby/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..dd7547af0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/get-deployment-download.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.get_deployment_download( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType::SOURCE, # optional + token: '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/get-deployment.md b/examples/2.0.x/server-ruby/examples/functions/get-deployment.md new file mode 100644 index 000000000..1711df1e6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/get-deployment.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.get_deployment( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/get-execution.md b/examples/2.0.x/server-ruby/examples/functions/get-execution.md new file mode 100644 index 000000000..240606c65 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/get-execution.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +functions = Functions.new(client) + +result = functions.get_execution( + function_id: '<FUNCTION_ID>', + execution_id: '<EXECUTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/get-variable.md b/examples/2.0.x/server-ruby/examples/functions/get-variable.md new file mode 100644 index 000000000..e06337ea4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/get-variable.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.get_variable( + function_id: '<FUNCTION_ID>', + variable_id: '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/get.md b/examples/2.0.x/server-ruby/examples/functions/get.md new file mode 100644 index 000000000..8b4b1b13e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.get( + function_id: '<FUNCTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/list-deployments.md b/examples/2.0.x/server-ruby/examples/functions/list-deployments.md new file mode 100644 index 000000000..d4f88ba61 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/list-deployments.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list_deployments( + function_id: '<FUNCTION_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/list-executions.md b/examples/2.0.x/server-ruby/examples/functions/list-executions.md new file mode 100644 index 000000000..f9b138ecf --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/list-executions.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +functions = Functions.new(client) + +result = functions.list_executions( + function_id: '<FUNCTION_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/list-runtimes.md b/examples/2.0.x/server-ruby/examples/functions/list-runtimes.md new file mode 100644 index 000000000..98a754662 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/list-runtimes.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list_runtimes() +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/list-specifications.md b/examples/2.0.x/server-ruby/examples/functions/list-specifications.md new file mode 100644 index 000000000..635f73a5c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/list-specifications.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list_specifications( + type: 'runtimes' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/list-variables.md b/examples/2.0.x/server-ruby/examples/functions/list-variables.md new file mode 100644 index 000000000..3e4b1ca63 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/list-variables.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list_variables( + function_id: '<FUNCTION_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/list.md b/examples/2.0.x/server-ruby/examples/functions/list.md new file mode 100644 index 000000000..b9ffba05e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/update-deployment-status.md b/examples/2.0.x/server-ruby/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..b70d5f0f0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/update-deployment-status.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.update_deployment_status( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/update-function-deployment.md b/examples/2.0.x/server-ruby/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..be7eff9c5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/update-function-deployment.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.update_function_deployment( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/update-variable.md b/examples/2.0.x/server-ruby/examples/functions/update-variable.md new file mode 100644 index 000000000..d3a2a8deb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/update-variable.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.update_variable( + function_id: '<FUNCTION_ID>', + variable_id: '<VARIABLE_ID>', + key: '<KEY>', # optional + value: '<VALUE>', # optional + secret: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/functions/update.md b/examples/2.0.x/server-ruby/examples/functions/update.md new file mode 100644 index 000000000..d0bb4c859 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/functions/update.md @@ -0,0 +1,38 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.update( + function_id: '<FUNCTION_ID>', + name: '<NAME>', + runtime: Runtime::NODE_14_5, # optional + execute: ["any"], # optional + events: [], # optional + schedule: '0 0 * * *', # optional + timeout: 1, # optional + enabled: false, # optional + logging: false, # optional + entrypoint: '<ENTRYPOINT>', # optional + commands: '<COMMANDS>', # optional + scopes: [ProjectKeyScopes::PROJECT_READ], # optional + installation_id: '<INSTALLATION_ID>', # optional + provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch: '<PROVIDER_BRANCH>', # optional + provider_silent_mode: false, # optional + provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional + provider_branches: [], # optional + provider_paths: [], # optional + build_specification: 's-1vcpu-512mb', # optional + runtime_specification: 's-1vcpu-512mb', # optional + deployment_retention: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/graphql/mutation.md b/examples/2.0.x/server-ruby/examples/graphql/mutation.md new file mode 100644 index 000000000..a71a8bd61 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/graphql/mutation.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +graphql = Graphql.new(client) + +result = graphql.mutation( + query: {} +) +``` diff --git a/examples/2.0.x/server-ruby/examples/graphql/query.md b/examples/2.0.x/server-ruby/examples/graphql/query.md new file mode 100644 index 000000000..49561b158 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/graphql/query.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +graphql = Graphql.new(client) + +result = graphql.query( + query: {} +) +``` diff --git a/examples/2.0.x/server-ruby/examples/locale/get.md b/examples/2.0.x/server-ruby/examples/locale/get.md new file mode 100644 index 000000000..e6fa23f9a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/locale/get.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.get() +``` diff --git a/examples/2.0.x/server-ruby/examples/locale/list-codes.md b/examples/2.0.x/server-ruby/examples/locale/list-codes.md new file mode 100644 index 000000000..cf31d3af0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/locale/list-codes.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_codes() +``` diff --git a/examples/2.0.x/server-ruby/examples/locale/list-continents.md b/examples/2.0.x/server-ruby/examples/locale/list-continents.md new file mode 100644 index 000000000..1470c7d16 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/locale/list-continents.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_continents() +``` diff --git a/examples/2.0.x/server-ruby/examples/locale/list-countries-eu.md b/examples/2.0.x/server-ruby/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..7ca1e985d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/locale/list-countries-eu.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_countries_eu() +``` diff --git a/examples/2.0.x/server-ruby/examples/locale/list-countries-phones.md b/examples/2.0.x/server-ruby/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..43c80c6ac --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/locale/list-countries-phones.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_countries_phones() +``` diff --git a/examples/2.0.x/server-ruby/examples/locale/list-countries.md b/examples/2.0.x/server-ruby/examples/locale/list-countries.md new file mode 100644 index 000000000..a5a81c7ba --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/locale/list-countries.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_countries() +``` diff --git a/examples/2.0.x/server-ruby/examples/locale/list-currencies.md b/examples/2.0.x/server-ruby/examples/locale/list-currencies.md new file mode 100644 index 000000000..a5316f2bf --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/locale/list-currencies.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_currencies() +``` diff --git a/examples/2.0.x/server-ruby/examples/locale/list-languages.md b/examples/2.0.x/server-ruby/examples/locale/list-languages.md new file mode 100644 index 000000000..9c8655f4e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/locale/list-languages.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_languages() +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..0d4534fee --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-apns-provider.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_apns_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + auth_key: '<AUTH_KEY>', # optional + auth_key_id: '<AUTH_KEY_ID>', # optional + team_id: '<TEAM_ID>', # optional + bundle_id: '<BUNDLE_ID>', # optional + sandbox: false, # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-email.md b/examples/2.0.x/server-ruby/examples/messaging/create-email.md new file mode 100644 index 000000000..e661a8a35 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-email.md @@ -0,0 +1,27 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_email( + message_id: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], # optional + users: [], # optional + targets: [], # optional + cc: [], # optional + bcc: [], # optional + attachments: [], # optional + draft: false, # optional + html: false, # optional + scheduled_at: '2020-10-15T06:38:00.000+00:00' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..2ff771b6c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-fcm-provider.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_fcm_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + service_account_json: {}, # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..eaa15ecb2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,25 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_mailgun_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + api_key: '<API_KEY>', # optional + domain: 'example.com', # optional + is_eu_region: false, # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..2553f1c1c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_msg91_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + template_id: '<TEMPLATE_ID>', # optional + sender_id: '<SENDER_ID>', # optional + auth_key: '<AUTH_KEY>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-push.md b/examples/2.0.x/server-ruby/examples/messaging/create-push.md new file mode 100644 index 000000000..e94015e60 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-push.md @@ -0,0 +1,35 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_push( + message_id: '<MESSAGE_ID>', + title: '<TITLE>', # optional + body: '<BODY>', # optional + topics: [], # optional + users: [], # optional + targets: [], # optional + data: {}, # optional + action: '<ACTION>', # optional + image: '<ID1:ID2>', # optional + icon: '<ICON>', # optional + sound: '<SOUND>', # optional + color: '<COLOR>', # optional + tag: '<TAG>', # optional + badge: 1, # optional + draft: false, # optional + scheduled_at: '2020-10-15T06:38:00.000+00:00', # optional + content_available: false, # optional + critical: false, # optional + priority: MessagePriority::NORMAL # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..417142fe7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-resend-provider.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_resend_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + api_key: '<API_KEY>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..d57c79f17 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_sendgrid_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + api_key: '<API_KEY>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..2ac71f733 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-ses-provider.md @@ -0,0 +1,25 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_ses_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + access_key: '<ACCESS_KEY>', # optional + secret_key: '<SECRET_KEY>', # optional + region: '<REGION>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-sms.md b/examples/2.0.x/server-ruby/examples/messaging/create-sms.md new file mode 100644 index 000000000..c59279fd8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-sms.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_sms( + message_id: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], # optional + users: [], # optional + targets: [], # optional + draft: false, # optional + scheduled_at: '2020-10-15T06:38:00.000+00:00' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..25e5dd7f3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-smtp-provider.md @@ -0,0 +1,30 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_smtp_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 587, # optional + username: '<USERNAME>', # optional + password: 'password', # optional + encryption: SmtpEncryption::NONE, # optional + auto_tls: false, # optional + mailer: '<MAILER>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-subscriber.md b/examples/2.0.x/server-ruby/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..2038711f2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-subscriber.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_jwt('<YOUR_JWT>') # Your secret JSON Web Token + +messaging = Messaging.new(client) + +result = messaging.create_subscriber( + topic_id: '<TOPIC_ID>', + subscriber_id: '<SUBSCRIBER_ID>', + target_id: '<TARGET_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..49e43a7c0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-telesign-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_telesign_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', # optional + customer_id: '<CUSTOMER_ID>', # optional + api_key: '<API_KEY>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..ff7b9116e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_textmagic_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', # optional + username: '<USERNAME>', # optional + api_key: '<API_KEY>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-topic.md b/examples/2.0.x/server-ruby/examples/messaging/create-topic.md new file mode 100644 index 000000000..85cc5d76b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-topic.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_topic( + topic_id: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..fa86a8354 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-twilio-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_twilio_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', # optional + account_sid: '<ACCOUNT_SID>', # optional + auth_token: '<AUTH_TOKEN>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-ruby/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..f3fa1beb8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/create-vonage-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_vonage_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', # optional + api_key: '<API_KEY>', # optional + api_secret: '<API_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/delete-provider.md b/examples/2.0.x/server-ruby/examples/messaging/delete-provider.md new file mode 100644 index 000000000..67273651b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/delete-provider.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.delete_provider( + provider_id: '<PROVIDER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-ruby/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..11b31bac9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/delete-subscriber.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_jwt('<YOUR_JWT>') # Your secret JSON Web Token + +messaging = Messaging.new(client) + +result = messaging.delete_subscriber( + topic_id: '<TOPIC_ID>', + subscriber_id: '<SUBSCRIBER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/delete-topic.md b/examples/2.0.x/server-ruby/examples/messaging/delete-topic.md new file mode 100644 index 000000000..fb1c13840 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/delete-topic.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.delete_topic( + topic_id: '<TOPIC_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/delete.md b/examples/2.0.x/server-ruby/examples/messaging/delete.md new file mode 100644 index 000000000..0e238dee8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.delete( + message_id: '<MESSAGE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/get-message.md b/examples/2.0.x/server-ruby/examples/messaging/get-message.md new file mode 100644 index 000000000..ae854c3c5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/get-message.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.get_message( + message_id: '<MESSAGE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/get-provider.md b/examples/2.0.x/server-ruby/examples/messaging/get-provider.md new file mode 100644 index 000000000..b66144fc9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/get-provider.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.get_provider( + provider_id: '<PROVIDER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/get-subscriber.md b/examples/2.0.x/server-ruby/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..800f60c1c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/get-subscriber.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.get_subscriber( + topic_id: '<TOPIC_ID>', + subscriber_id: '<SUBSCRIBER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/get-topic.md b/examples/2.0.x/server-ruby/examples/messaging/get-topic.md new file mode 100644 index 000000000..c34d6e05d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/get-topic.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.get_topic( + topic_id: '<TOPIC_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/list-messages.md b/examples/2.0.x/server-ruby/examples/messaging/list-messages.md new file mode 100644 index 000000000..250e57fa5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/list-messages.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_messages( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/list-providers.md b/examples/2.0.x/server-ruby/examples/messaging/list-providers.md new file mode 100644 index 000000000..4faa0bd6e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/list-providers.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_providers( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/list-subscribers.md b/examples/2.0.x/server-ruby/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..ac594e86a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/list-subscribers.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_subscribers( + topic_id: '<TOPIC_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/list-targets.md b/examples/2.0.x/server-ruby/examples/messaging/list-targets.md new file mode 100644 index 000000000..ea2ad4a82 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/list-targets.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_targets( + message_id: '<MESSAGE_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/list-topics.md b/examples/2.0.x/server-ruby/examples/messaging/list-topics.md new file mode 100644 index 000000000..8778e95e7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/list-topics.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_topics( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..2ef7cc625 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-apns-provider.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_apns_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + auth_key: '<AUTH_KEY>', # optional + auth_key_id: '<AUTH_KEY_ID>', # optional + team_id: '<TEAM_ID>', # optional + bundle_id: '<BUNDLE_ID>', # optional + sandbox: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-email.md b/examples/2.0.x/server-ruby/examples/messaging/update-email.md new file mode 100644 index 000000000..727fdbc23 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-email.md @@ -0,0 +1,27 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_email( + message_id: '<MESSAGE_ID>', + topics: [], # optional + users: [], # optional + targets: [], # optional + subject: '<SUBJECT>', # optional + content: '<CONTENT>', # optional + draft: false, # optional + html: false, # optional + cc: [], # optional + bcc: [], # optional + scheduled_at: '2020-10-15T06:38:00.000+00:00', # optional + attachments: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..003d016d3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-fcm-provider.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_fcm_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + service_account_json: {} # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..4c3f9018b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,25 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_mailgun_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + api_key: '<API_KEY>', # optional + domain: 'example.com', # optional + is_eu_region: false, # optional + enabled: false, # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: '<REPLY_TO_EMAIL>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..d091ee297 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_msg91_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + template_id: '<TEMPLATE_ID>', # optional + sender_id: '<SENDER_ID>', # optional + auth_key: '<AUTH_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-push.md b/examples/2.0.x/server-ruby/examples/messaging/update-push.md new file mode 100644 index 000000000..9aa0e8ba9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-push.md @@ -0,0 +1,35 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_push( + message_id: '<MESSAGE_ID>', + topics: [], # optional + users: [], # optional + targets: [], # optional + title: '<TITLE>', # optional + body: '<BODY>', # optional + data: {}, # optional + action: '<ACTION>', # optional + image: '<ID1:ID2>', # optional + icon: '<ICON>', # optional + sound: '<SOUND>', # optional + color: '<COLOR>', # optional + tag: '<TAG>', # optional + badge: 1, # optional + draft: false, # optional + scheduled_at: '2020-10-15T06:38:00.000+00:00', # optional + content_available: false, # optional + critical: false, # optional + priority: MessagePriority::NORMAL # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..bafa99c98 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-resend-provider.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_resend_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + api_key: '<API_KEY>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: '<REPLY_TO_EMAIL>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..f18e9ebeb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_sendgrid_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + api_key: '<API_KEY>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: '<REPLY_TO_EMAIL>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..9465ac31b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-ses-provider.md @@ -0,0 +1,25 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_ses_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + access_key: '<ACCESS_KEY>', # optional + secret_key: '<SECRET_KEY>', # optional + region: '<REGION>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: '<REPLY_TO_EMAIL>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-sms.md b/examples/2.0.x/server-ruby/examples/messaging/update-sms.md new file mode 100644 index 000000000..233ffb819 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-sms.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_sms( + message_id: '<MESSAGE_ID>', + topics: [], # optional + users: [], # optional + targets: [], # optional + content: '<CONTENT>', # optional + draft: false, # optional + scheduled_at: '2020-10-15T06:38:00.000+00:00' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..a7355fefc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-smtp-provider.md @@ -0,0 +1,30 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_smtp_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + host: '<HOST>', # optional + port: 1, # optional + username: '<USERNAME>', # optional + password: 'password', # optional + encryption: SmtpEncryption::NONE, # optional + auto_tls: false, # optional + mailer: '<MAILER>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: '<REPLY_TO_EMAIL>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..25dc144c6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-telesign-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_telesign_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + customer_id: '<CUSTOMER_ID>', # optional + api_key: '<API_KEY>', # optional + from: '<FROM>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..5f41c6ac3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_textmagic_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + username: '<USERNAME>', # optional + api_key: '<API_KEY>', # optional + from: '<FROM>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-topic.md b/examples/2.0.x/server-ruby/examples/messaging/update-topic.md new file mode 100644 index 000000000..af1ed82fb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-topic.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_topic( + topic_id: '<TOPIC_ID>', + name: '<NAME>', # optional + subscribe: ["any"] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..952d185b0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-twilio-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_twilio_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + account_sid: '<ACCOUNT_SID>', # optional + auth_token: '<AUTH_TOKEN>', # optional + from: '<FROM>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-ruby/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..3fb4558c1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/messaging/update-vonage-provider.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_vonage_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + api_key: '<API_KEY>', # optional + api_secret: '<API_SECRET>', # optional + from: '<FROM>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/organization/create-project.md b/examples/2.0.x/server-ruby/examples/organization/create-project.md new file mode 100644 index 000000000..4cb45b365 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/organization/create-project.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization.new(client) + +result = organization.create_project( + project_id: '<PROJECT_ID>', + name: '<NAME>', + region: Region::DEFAULT # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/organization/delete-project.md b/examples/2.0.x/server-ruby/examples/organization/delete-project.md new file mode 100644 index 000000000..39172c8c8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/organization/delete-project.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization.new(client) + +result = organization.delete_project( + project_id: '<PROJECT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/organization/get-project.md b/examples/2.0.x/server-ruby/examples/organization/get-project.md new file mode 100644 index 000000000..13f7a49d7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/organization/get-project.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization.new(client) + +result = organization.get_project( + project_id: '<PROJECT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/organization/list-projects.md b/examples/2.0.x/server-ruby/examples/organization/list-projects.md new file mode 100644 index 000000000..16bb09cf6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/organization/list-projects.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization.new(client) + +result = organization.list_projects( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/organization/update-project.md b/examples/2.0.x/server-ruby/examples/organization/update-project.md new file mode 100644 index 000000000..275851830 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/organization/update-project.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +organization = Organization.new(client) + +result = organization.update_project( + project_id: '<PROJECT_ID>', + name: '<NAME>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/presences/delete.md b/examples/2.0.x/server-ruby/examples/presences/delete.md new file mode 100644 index 000000000..b9b015269 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/presences/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences.new(client) + +result = presences.delete( + presence_id: '<PRESENCE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/presences/get.md b/examples/2.0.x/server-ruby/examples/presences/get.md new file mode 100644 index 000000000..18307cfd8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/presences/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences.new(client) + +result = presences.get( + presence_id: '<PRESENCE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/presences/list.md b/examples/2.0.x/server-ruby/examples/presences/list.md new file mode 100644 index 000000000..ff2ad46fe --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/presences/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences.new(client) + +result = presences.list( + queries: [], # optional + total: false, # optional + ttl: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/presences/update.md b/examples/2.0.x/server-ruby/examples/presences/update.md new file mode 100644 index 000000000..90acb543f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/presences/update.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences.new(client) + +result = presences.update( + presence_id: '<PRESENCE_ID>', + user_id: '<USER_ID>', + status: '<STATUS>', # optional + expires_at: '2020-10-15T06:38:00.000+00:00', # optional + metadata: {}, # optional + permissions: [Permission.read(Role.any())], # optional + purge: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/presences/upsert.md b/examples/2.0.x/server-ruby/examples/presences/upsert.md new file mode 100644 index 000000000..cc0801af5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/presences/upsert.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +presences = Presences.new(client) + +result = presences.upsert( + presence_id: '<PRESENCE_ID>', + user_id: '<USER_ID>', + status: '<STATUS>', + permissions: [Permission.read(Role.any())], # optional + expires_at: '2020-10-15T06:38:00.000+00:00', # optional + metadata: {} # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-android-platform.md b/examples/2.0.x/server-ruby/examples/project/create-android-platform.md new file mode 100644 index 000000000..31c9725ed --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-android-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_android_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + application_id: '<APPLICATION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-apple-platform.md b/examples/2.0.x/server-ruby/examples/project/create-apple-platform.md new file mode 100644 index 000000000..d720b22c3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-apple-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_apple_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + bundle_identifier: '<BUNDLE_IDENTIFIER>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-ruby/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..6f0d9b660 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-ephemeral-key.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_ephemeral_key( + scopes: [ProjectKeyScopes::PROJECT_READ], + duration: 600 +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-linux-platform.md b/examples/2.0.x/server-ruby/examples/project/create-linux-platform.md new file mode 100644 index 000000000..11af48743 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-linux-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_linux_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + package_name: '<PACKAGE_NAME>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-mock-phone.md b/examples/2.0.x/server-ruby/examples/project/create-mock-phone.md new file mode 100644 index 000000000..73cb15a44 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-mock-phone.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_mock_phone( + number: '+12065550100', + otp: '<OTP>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-smtp-test.md b/examples/2.0.x/server-ruby/examples/project/create-smtp-test.md new file mode 100644 index 000000000..1e1d1eae0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-smtp-test.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_smtp_test( + emails: [] +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-variable.md b/examples/2.0.x/server-ruby/examples/project/create-variable.md new file mode 100644 index 000000000..782cb51fe --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-variable.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_variable( + variable_id: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-web-platform.md b/examples/2.0.x/server-ruby/examples/project/create-web-platform.md new file mode 100644 index 000000000..9abfe8e99 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-web-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_web_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/create-windows-platform.md b/examples/2.0.x/server-ruby/examples/project/create-windows-platform.md new file mode 100644 index 000000000..8f53f16a8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/create-windows-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.create_windows_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + package_identifier_name: '<PACKAGE_IDENTIFIER_NAME>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/delete-key.md b/examples/2.0.x/server-ruby/examples/project/delete-key.md new file mode 100644 index 000000000..ed80903cc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/delete-key.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.delete_key( + key_id: '<KEY_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/delete-mock-phone.md b/examples/2.0.x/server-ruby/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..1800c0ec6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/delete-mock-phone.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.delete_mock_phone( + number: '+12065550100' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/delete-platform.md b/examples/2.0.x/server-ruby/examples/project/delete-platform.md new file mode 100644 index 000000000..bf8c2e5ba --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/delete-platform.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.delete_platform( + platform_id: '<PLATFORM_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/delete-variable.md b/examples/2.0.x/server-ruby/examples/project/delete-variable.md new file mode 100644 index 000000000..71c5bd804 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/delete-variable.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.delete_variable( + variable_id: '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/delete.md b/examples/2.0.x/server-ruby/examples/project/delete.md new file mode 100644 index 000000000..bc8b3a1a2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/delete.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.delete() +``` diff --git a/examples/2.0.x/server-ruby/examples/project/get-email-template.md b/examples/2.0.x/server-ruby/examples/project/get-email-template.md new file mode 100644 index 000000000..1bb1a4bc6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/get-email-template.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.get_email_template( + template_id: ProjectEmailTemplateId::VERIFICATION, + locale: ProjectEmailTemplateLocale::AF # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/get-key.md b/examples/2.0.x/server-ruby/examples/project/get-key.md new file mode 100644 index 000000000..2d19eae2c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/get-key.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.get_key( + key_id: '<KEY_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/get-mock-phone.md b/examples/2.0.x/server-ruby/examples/project/get-mock-phone.md new file mode 100644 index 000000000..03ef044ba --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/get-mock-phone.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.get_mock_phone( + number: '+12065550100' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-ruby/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..d5bde47f7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.get_o_auth2_provider( + provider_id: ProjectOAuthProviderId::AMAZON +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/get-platform.md b/examples/2.0.x/server-ruby/examples/project/get-platform.md new file mode 100644 index 000000000..276901c55 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/get-platform.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.get_platform( + platform_id: '<PLATFORM_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/get-policy.md b/examples/2.0.x/server-ruby/examples/project/get-policy.md new file mode 100644 index 000000000..57b186f22 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/get-policy.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.get_policy( + policy_id: ProjectPolicyId::PASSWORD_DICTIONARY +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/get-variable.md b/examples/2.0.x/server-ruby/examples/project/get-variable.md new file mode 100644 index 000000000..7bea5e9de --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/get-variable.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.get_variable( + variable_id: '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/get.md b/examples/2.0.x/server-ruby/examples/project/get.md new file mode 100644 index 000000000..3a702dec3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/get.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.get() +``` diff --git a/examples/2.0.x/server-ruby/examples/project/list-email-templates.md b/examples/2.0.x/server-ruby/examples/project/list-email-templates.md new file mode 100644 index 000000000..3286a5db4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/list-email-templates.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.list_email_templates( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/list-keys.md b/examples/2.0.x/server-ruby/examples/project/list-keys.md new file mode 100644 index 000000000..fe8823573 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/list-keys.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.list_keys( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/list-mock-phones.md b/examples/2.0.x/server-ruby/examples/project/list-mock-phones.md new file mode 100644 index 000000000..e0f0b35d5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/list-mock-phones.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.list_mock_phones( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-ruby/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..b91088014 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.list_o_auth2_providers( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/list-platforms.md b/examples/2.0.x/server-ruby/examples/project/list-platforms.md new file mode 100644 index 000000000..3685c81ce --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/list-platforms.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.list_platforms( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/list-policies.md b/examples/2.0.x/server-ruby/examples/project/list-policies.md new file mode 100644 index 000000000..b5ac0bd25 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/list-policies.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.list_policies( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/list-variables.md b/examples/2.0.x/server-ruby/examples/project/list-variables.md new file mode 100644 index 000000000..a6af08204 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/list-variables.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.list_variables( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-android-platform.md b/examples/2.0.x/server-ruby/examples/project/update-android-platform.md new file mode 100644 index 000000000..07e177d28 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-android-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_android_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + application_id: '<APPLICATION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-apple-platform.md b/examples/2.0.x/server-ruby/examples/project/update-apple-platform.md new file mode 100644 index 000000000..9faa5c138 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-apple-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_apple_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + bundle_identifier: '<BUNDLE_IDENTIFIER>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-auth-method.md b/examples/2.0.x/server-ruby/examples/project/update-auth-method.md new file mode 100644 index 000000000..a717e1051 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-auth-method.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_auth_method( + method_id: ProjectAuthMethodId::EMAIL_PASSWORD, + enabled: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-email-template.md b/examples/2.0.x/server-ruby/examples/project/update-email-template.md new file mode 100644 index 000000000..d845017e9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-email-template.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_email_template( + template_id: ProjectEmailTemplateId::VERIFICATION, + locale: ProjectEmailTemplateLocale::AF, # optional + subject: '<SUBJECT>', # optional + message: '<MESSAGE>', # optional + sender_name: '<SENDER_NAME>', # optional + sender_email: 'email@example.com', # optional + reply_to_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-key.md b/examples/2.0.x/server-ruby/examples/project/update-key.md new file mode 100644 index 000000000..b192315d7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-key.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_key( + key_id: '<KEY_ID>', + name: '<NAME>', + scopes: [ProjectKeyScopes::PROJECT_READ], + expire: '2020-10-15T06:38:00.000+00:00' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-labels.md b/examples/2.0.x/server-ruby/examples/project/update-labels.md new file mode 100644 index 000000000..f57cec70e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-labels.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_labels( + labels: [] +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-linux-platform.md b/examples/2.0.x/server-ruby/examples/project/update-linux-platform.md new file mode 100644 index 000000000..9714dced8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-linux-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_linux_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + package_name: '<PACKAGE_NAME>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-ruby/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..b84a8facc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_membership_privacy_policy( + user_id: false, # optional + user_email: false, # optional + user_phone: false, # optional + user_name: false, # optional + user_mfa: false, # optional + user_accessed_at: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-ruby/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..1849b161f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_mfa_factors_policy( + totp: false, # optional + email: false, # optional + phone: false, # optional + custom: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-mock-phone.md b/examples/2.0.x/server-ruby/examples/project/update-mock-phone.md new file mode 100644 index 000000000..028cb481f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-mock-phone.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_mock_phone( + number: '+12065550100', + otp: '<OTP>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..29861e692 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_amazon( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..adb2c8d6e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_apple( + service_id: '<SERVICE_ID>', # optional + key_id: '<KEY_ID>', # optional + team_id: '<TEAM_ID>', # optional + p8_file: '<P8_FILE>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..1d8e92edf --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_appwrite( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..e8d11dbf3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_auth0( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + endpoint: '<ENDPOINT>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..d0ec2396d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_authentik( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + endpoint: '<ENDPOINT>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..41e2e475f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_autodesk( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..46c7e20f4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_bitbucket( + key: '<KEY>', # optional + secret: '<SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..12a8ab63c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_bitly( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..5d390fead --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-box.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_box( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..7b143a7ef --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_cloudflare( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..7ae5ac7b5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_dailymotion( + api_key: '<API_KEY>', # optional + api_secret: '<API_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..01bacd7cb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_discord( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..38784b107 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_disqus( + public_key: '<PUBLIC_KEY>', # optional + secret_key: '<SECRET_KEY>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..29247c56d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_dropbox( + app_key: '<APP_KEY>', # optional + app_secret: '<APP_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..e3fdb3882 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_etsy( + key_string: '<KEY_STRING>', # optional + shared_secret: '<SHARED_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..474e4b5a6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_facebook( + app_id: '<APP_ID>', # optional + app_secret: '<APP_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..78ce11092 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_figma( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..5350351e3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_fusion_auth( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + endpoint: '<ENDPOINT>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..e63370f78 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_git_hub( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..6073bc86a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_gitlab( + application_id: '<APPLICATION_ID>', # optional + secret: '<SECRET>', # optional + endpoint: 'https://example.com', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..be38c0f39 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-google.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_google( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + prompt: [ProjectOAuth2GooglePrompt::NONE], # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..a8d2adc81 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_hugging_face( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..63d60d122 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_keycloak( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + endpoint: '<ENDPOINT>', # optional + realm_name: '<REALM_NAME>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..4a36804b0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_kick( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..7a9109cec --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_linkedin( + client_id: '<CLIENT_ID>', # optional + primary_client_secret: '<PRIMARY_CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..0a5563f7a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_microsoft( + application_id: '<APPLICATION_ID>', # optional + application_secret: '<APPLICATION_SECRET>', # optional + tenant: '<TENANT>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..f679d2872 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_notion( + oauth_client_id: '<OAUTH_CLIENT_ID>', # optional + oauth_client_secret: '<OAUTH_CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..f090e96ae --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,25 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_oidc( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + well_known_url: 'https://example.com', # optional + authorization_url: 'https://example.com', # optional + token_url: 'https://example.com', # optional + user_info_url: 'https://example.com', # optional + prompt: [ProjectOAuth2OidcPrompt::NONE], # optional + max_age: 0, # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..44716551f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_okta( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + domain: 'example.com', # optional + authorization_server_id: '<AUTHORIZATION_SERVER_ID>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..34a5cbf11 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_paypal_sandbox( + client_id: '<CLIENT_ID>', # optional + secret_key: '<SECRET_KEY>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..054a5c919 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_paypal( + client_id: '<CLIENT_ID>', # optional + secret_key: '<SECRET_KEY>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..5f58dbe8a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_podio( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..c88eb5a83 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_resend( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..f573693fb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_salesforce( + customer_key: '<CUSTOMER_KEY>', # optional + customer_secret: '<CUSTOMER_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..fb5055df9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_slack( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..fc95bff49 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_spotify( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..21db796dc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_stripe( + client_id: '<CLIENT_ID>', # optional + api_secret_key: '<API_SECRET_KEY>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..a79d0a91e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_tradeshift_sandbox( + oauth2_client_id: '<OAUTH2_CLIENT_ID>', # optional + oauth2_client_secret: '<OAUTH2_CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..eb4536caa --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_tradeshift( + oauth2_client_id: '<OAUTH2_CLIENT_ID>', # optional + oauth2_client_secret: '<OAUTH2_CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..c110abaf2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_twitch( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..90da17ab1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_word_press( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..8e2498a37 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_yahoo( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..73461da23 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_yandex( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..2fbd5fed3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_zoho( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..c61ddd9b4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_zoom( + client_id: '<CLIENT_ID>', # optional + client_secret: '<CLIENT_SECRET>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..3d06d8443 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-o-auth-2x.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_x( + customer_key: '<CUSTOMER_KEY>', # optional + secret_key: '<SECRET_KEY>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-ruby/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..e3f152e60 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_password_dictionary_policy( + enabled: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-password-history-policy.md b/examples/2.0.x/server-ruby/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..462ab8a85 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-password-history-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_password_history_policy( + total: 1 +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-ruby/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..226ecc821 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_password_personal_data_policy( + enabled: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-ruby/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..516324116 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-password-strength-policy.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_password_strength_policy( + min: 8, # optional + uppercase: false, # optional + lowercase: false, # optional + number: false, # optional + symbols: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-protocol.md b/examples/2.0.x/server-ruby/examples/project/update-protocol.md new file mode 100644 index 000000000..6ff3cc123 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-protocol.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_protocol( + protocol_id: ProjectProtocolId::REST, + enabled: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-service.md b/examples/2.0.x/server-ruby/examples/project/update-service.md new file mode 100644 index 000000000..0cabe6ac5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-service.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_service( + service_id: ProjectServiceId::ACCOUNT, + enabled: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-ruby/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..2fd2fe15d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-session-alert-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_session_alert_policy( + enabled: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-ruby/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..ba8f1cb39 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-session-duration-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_session_duration_policy( + duration: 60 +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-ruby/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..e48d0e318 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_session_invalidation_policy( + enabled: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-ruby/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..38a4dfdd4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-session-limit-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_session_limit_policy( + total: 1 +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-smtp.md b/examples/2.0.x/server-ruby/examples/project/update-smtp.md new file mode 100644 index 000000000..0af3b32be --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-smtp.md @@ -0,0 +1,26 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_smtp( + host: 'example.com', # optional + port: 587, # optional + username: '<USERNAME>', # optional + password: 'password', # optional + sender_email: 'email@example.com', # optional + sender_name: '<SENDER_NAME>', # optional + reply_to_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + secure: ProjectSMTPSecure::TLS, # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-ruby/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..145906a3e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-user-limit-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_user_limit_policy( + total: 0 +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-variable.md b/examples/2.0.x/server-ruby/examples/project/update-variable.md new file mode 100644 index 000000000..fcfcac625 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-variable.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_variable( + variable_id: '<VARIABLE_ID>', + key: '<KEY>', # optional + value: '<VALUE>', # optional + secret: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-web-platform.md b/examples/2.0.x/server-ruby/examples/project/update-web-platform.md new file mode 100644 index 000000000..46fe9cfd3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-web-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_web_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + hostname: 'app.example.com' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/project/update-windows-platform.md b/examples/2.0.x/server-ruby/examples/project/update-windows-platform.md new file mode 100644 index 000000000..5e2b10694 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/project/update-windows-platform.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +project = Project.new(client) + +result = project.update_windows_platform( + platform_id: '<PLATFORM_ID>', + name: '<NAME>', + package_identifier_name: '<PACKAGE_IDENTIFIER_NAME>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/proxy/create-api-rule.md b/examples/2.0.x/server-ruby/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..a69c1ec2b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/proxy/create-api-rule.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.create_api_rule( + domain: 'example.com' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/proxy/create-function-rule.md b/examples/2.0.x/server-ruby/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..2f65090bf --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/proxy/create-function-rule.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.create_function_rule( + domain: 'example.com', + function_id: '<FUNCTION_ID>', + branch: '<BRANCH>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-ruby/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..40a1ea4b7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/proxy/create-redirect-rule.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.create_redirect_rule( + domain: 'example.com', + url: 'https://example.com', + status_code: StatusCode::MOVEDPERMANENTLY, + resource_id: '<RESOURCE_ID>', + resource_type: ProxyResourceType::SITE +) +``` diff --git a/examples/2.0.x/server-ruby/examples/proxy/create-site-rule.md b/examples/2.0.x/server-ruby/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..c2570cb23 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/proxy/create-site-rule.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.create_site_rule( + domain: 'example.com', + site_id: '<SITE_ID>', + branch: '<BRANCH>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/proxy/delete-rule.md b/examples/2.0.x/server-ruby/examples/proxy/delete-rule.md new file mode 100644 index 000000000..960cd399e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/proxy/delete-rule.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.delete_rule( + rule_id: '<RULE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/proxy/get-rule.md b/examples/2.0.x/server-ruby/examples/proxy/get-rule.md new file mode 100644 index 000000000..47c03f1e2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/proxy/get-rule.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.get_rule( + rule_id: '<RULE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/proxy/list-rules.md b/examples/2.0.x/server-ruby/examples/proxy/list-rules.md new file mode 100644 index 000000000..858fc6c83 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/proxy/list-rules.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.list_rules( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/proxy/update-rule-status.md b/examples/2.0.x/server-ruby/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..13192b411 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/proxy/update-rule-status.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.update_rule_status( + rule_id: '<RULE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/create-deployment.md b/examples/2.0.x/server-ruby/examples/sites/create-deployment.md new file mode 100644 index 000000000..14bb26adb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/create-deployment.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_deployment( + site_id: '<SITE_ID>', + code: InputFile.from_path('dir/file.png'), + install_command: '<INSTALL_COMMAND>', # optional + build_command: '<BUILD_COMMAND>', # optional + output_directory: '<OUTPUT_DIRECTORY>', # optional + activate: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-ruby/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..b0d11d214 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_duplicate_deployment( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/create-template-deployment.md b/examples/2.0.x/server-ruby/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..81a92c474 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/create-template-deployment.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_template_deployment( + site_id: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + root_directory: '<ROOT_DIRECTORY>', + type: TemplateReferenceType::BRANCH, + reference: '<REFERENCE>', + activate: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/create-variable.md b/examples/2.0.x/server-ruby/examples/sites/create-variable.md new file mode 100644 index 000000000..8c878439b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/create-variable.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_variable( + site_id: '<SITE_ID>', + variable_id: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-ruby/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..bdda14c10 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/create-vcs-deployment.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_vcs_deployment( + site_id: '<SITE_ID>', + type: VCSReferenceType::BRANCH, + reference: '<REFERENCE>', + activate: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/create.md b/examples/2.0.x/server-ruby/examples/sites/create.md new file mode 100644 index 000000000..9f8d7f7f1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/create.md @@ -0,0 +1,40 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create( + site_id: '<SITE_ID>', + name: '<NAME>', + framework: Framework::ANALOG, + build_runtime: BuildRuntime::NODE_14_5, + enabled: false, # optional + logging: false, # optional + timeout: 1, # optional + install_command: '<INSTALL_COMMAND>', # optional + build_command: '<BUILD_COMMAND>', # optional + start_command: '<START_COMMAND>', # optional + output_directory: '<OUTPUT_DIRECTORY>', # optional + adapter: Adapter::STATIC, # optional + installation_id: '<INSTALLATION_ID>', # optional + fallback_file: '<FALLBACK_FILE>', # optional + provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch: '<PROVIDER_BRANCH>', # optional + provider_silent_mode: false, # optional + provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional + provider_branches: [], # optional + provider_paths: [], # optional + build_specification: 's-1vcpu-512mb', # optional + runtime_specification: 's-1vcpu-512mb', # optional + deployment_retention: 0, # optional + scopes: [ProjectKeyScopes::PROJECT_READ] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/delete-deployment.md b/examples/2.0.x/server-ruby/examples/sites/delete-deployment.md new file mode 100644 index 000000000..3c381a41a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/delete-deployment.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.delete_deployment( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/delete-log.md b/examples/2.0.x/server-ruby/examples/sites/delete-log.md new file mode 100644 index 000000000..65f5f67a3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/delete-log.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.delete_log( + site_id: '<SITE_ID>', + log_id: '<LOG_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/delete-variable.md b/examples/2.0.x/server-ruby/examples/sites/delete-variable.md new file mode 100644 index 000000000..a841882db --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/delete-variable.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.delete_variable( + site_id: '<SITE_ID>', + variable_id: '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/delete.md b/examples/2.0.x/server-ruby/examples/sites/delete.md new file mode 100644 index 000000000..55011140f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.delete( + site_id: '<SITE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/get-deployment-download.md b/examples/2.0.x/server-ruby/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..55206b431 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/get-deployment-download.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get_deployment_download( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType::SOURCE, # optional + token: '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/get-deployment.md b/examples/2.0.x/server-ruby/examples/sites/get-deployment.md new file mode 100644 index 000000000..585e8724b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/get-deployment.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get_deployment( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/get-log.md b/examples/2.0.x/server-ruby/examples/sites/get-log.md new file mode 100644 index 000000000..2b02488a1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/get-log.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get_log( + site_id: '<SITE_ID>', + log_id: '<LOG_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/get-variable.md b/examples/2.0.x/server-ruby/examples/sites/get-variable.md new file mode 100644 index 000000000..ab2862656 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/get-variable.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get_variable( + site_id: '<SITE_ID>', + variable_id: '<VARIABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/get.md b/examples/2.0.x/server-ruby/examples/sites/get.md new file mode 100644 index 000000000..b2005fb80 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get( + site_id: '<SITE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/list-deployments.md b/examples/2.0.x/server-ruby/examples/sites/list-deployments.md new file mode 100644 index 000000000..11a0b002e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/list-deployments.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_deployments( + site_id: '<SITE_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/list-frameworks.md b/examples/2.0.x/server-ruby/examples/sites/list-frameworks.md new file mode 100644 index 000000000..a33303a27 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/list-frameworks.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_frameworks() +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/list-logs.md b/examples/2.0.x/server-ruby/examples/sites/list-logs.md new file mode 100644 index 000000000..e02b3536d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/list-logs.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_logs( + site_id: '<SITE_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/list-specifications.md b/examples/2.0.x/server-ruby/examples/sites/list-specifications.md new file mode 100644 index 000000000..9ed8d0018 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/list-specifications.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_specifications( + type: 'runtimes' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/list-variables.md b/examples/2.0.x/server-ruby/examples/sites/list-variables.md new file mode 100644 index 000000000..ad4daf113 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/list-variables.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_variables( + site_id: '<SITE_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/list.md b/examples/2.0.x/server-ruby/examples/sites/list.md new file mode 100644 index 000000000..aa32f1baa --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/update-deployment-status.md b/examples/2.0.x/server-ruby/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..d3f2ff9ed --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/update-deployment-status.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.update_deployment_status( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/update-site-deployment.md b/examples/2.0.x/server-ruby/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..f52453516 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/update-site-deployment.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.update_site_deployment( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/update-variable.md b/examples/2.0.x/server-ruby/examples/sites/update-variable.md new file mode 100644 index 000000000..f2736136c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/update-variable.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.update_variable( + site_id: '<SITE_ID>', + variable_id: '<VARIABLE_ID>', + key: '<KEY>', # optional + value: '<VALUE>', # optional + secret: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/sites/update.md b/examples/2.0.x/server-ruby/examples/sites/update.md new file mode 100644 index 000000000..56031c02b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/sites/update.md @@ -0,0 +1,40 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.update( + site_id: '<SITE_ID>', + name: '<NAME>', + framework: Framework::ANALOG, + enabled: false, # optional + logging: false, # optional + timeout: 1, # optional + install_command: '<INSTALL_COMMAND>', # optional + build_command: '<BUILD_COMMAND>', # optional + start_command: '<START_COMMAND>', # optional + output_directory: '<OUTPUT_DIRECTORY>', # optional + build_runtime: BuildRuntime::NODE_14_5, # optional + adapter: Adapter::STATIC, # optional + fallback_file: '<FALLBACK_FILE>', # optional + installation_id: '<INSTALLATION_ID>', # optional + provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch: '<PROVIDER_BRANCH>', # optional + provider_silent_mode: false, # optional + provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional + provider_branches: [], # optional + provider_paths: [], # optional + build_specification: 's-1vcpu-512mb', # optional + runtime_specification: 's-1vcpu-512mb', # optional + deployment_retention: 0, # optional + scopes: [ProjectKeyScopes::PROJECT_READ] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/create-bucket.md b/examples/2.0.x/server-ruby/examples/storage/create-bucket.md new file mode 100644 index 000000000..47287c4ae --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/create-bucket.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.create_bucket( + bucket_id: '<BUCKET_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], # optional + file_security: false, # optional + enabled: false, # optional + maximum_file_size: 1, # optional + allowed_file_extensions: [], # optional + compression: Compression::NONE, # optional + encryption: false, # optional + antivirus: false, # optional + transformations: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/create-file.md b/examples/2.0.x/server-ruby/examples/storage/create-file.md new file mode 100644 index 000000000..8176563fd --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/create-file.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.create_file( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + file: InputFile.from_path('dir/file.png'), + permissions: [Permission.read(Role.any())], # optional + folder: 'photos/2026' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/delete-bucket.md b/examples/2.0.x/server-ruby/examples/storage/delete-bucket.md new file mode 100644 index 000000000..5ff3c4bcf --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/delete-bucket.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.delete_bucket( + bucket_id: '<BUCKET_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/delete-file.md b/examples/2.0.x/server-ruby/examples/storage/delete-file.md new file mode 100644 index 000000000..1175afbb3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/delete-file.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.delete_file( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/get-bucket.md b/examples/2.0.x/server-ruby/examples/storage/get-bucket.md new file mode 100644 index 000000000..7a401b8c4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/get-bucket.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.get_bucket( + bucket_id: '<BUCKET_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/get-file-download.md b/examples/2.0.x/server-ruby/examples/storage/get-file-download.md new file mode 100644 index 000000000..33324990c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/get-file-download.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.get_file_download( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + token: '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/get-file-preview.md b/examples/2.0.x/server-ruby/examples/storage/get-file-preview.md new file mode 100644 index 000000000..3b4ce03db --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/get-file-preview.md @@ -0,0 +1,30 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.get_file_preview( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + width: 0, # optional + height: 0, # optional + gravity: ImageGravity::CENTER, # optional + quality: -1, # optional + border_width: 0, # optional + border_color: 'FFFFFF', # optional + border_radius: 0, # optional + opacity: 0, # optional + rotation: -360, # optional + background: 'FFFFFF', # optional + output: ImageFormat::JPG, # optional + token: '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/get-file-view.md b/examples/2.0.x/server-ruby/examples/storage/get-file-view.md new file mode 100644 index 000000000..ed3e898e1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/get-file-view.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.get_file_view( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + token: '<TOKEN>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/get-file.md b/examples/2.0.x/server-ruby/examples/storage/get-file.md new file mode 100644 index 000000000..dbcfcb6a8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/get-file.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.get_file( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/list-buckets.md b/examples/2.0.x/server-ruby/examples/storage/list-buckets.md new file mode 100644 index 000000000..712d4ed08 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/list-buckets.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.list_buckets( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/list-files.md b/examples/2.0.x/server-ruby/examples/storage/list-files.md new file mode 100644 index 000000000..0247abb24 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/list-files.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.list_files( + bucket_id: '<BUCKET_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/update-bucket.md b/examples/2.0.x/server-ruby/examples/storage/update-bucket.md new file mode 100644 index 000000000..8c6c1962f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/update-bucket.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.update_bucket( + bucket_id: '<BUCKET_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], # optional + file_security: false, # optional + enabled: false, # optional + maximum_file_size: 1, # optional + allowed_file_extensions: [], # optional + compression: Compression::NONE, # optional + encryption: false, # optional + antivirus: false, # optional + transformations: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/storage/update-file.md b/examples/2.0.x/server-ruby/examples/storage/update-file.md new file mode 100644 index 000000000..f7fa78165 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/storage/update-file.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.update_file( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + name: '<NAME>', # optional + permissions: [Permission.read(Role.any())] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..8af044404 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_big_int_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, # optional + max: 1000000, # optional + default: 0, # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..f4bdf1b18 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_boolean_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: false, # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..e21b99b75 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_datetime_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: '2020-10-15T06:38:00.000+00:00', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..c7ed0fd71 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-email-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_email_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'email@example.com', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..6a2dafbee --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-enum-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_enum_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + required: false, + default: 'active', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..65fe00433 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-float-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_float_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, # optional + max: 100, # optional + default: 10.5, # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-index.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-index.md new file mode 100644 index 000000000..a0453818c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-index.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_index( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + type: TablesDBIndexType::KEY, + columns: [], + orders: [OrderBy::ASC], # optional + lengths: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..8abb17a5c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-integer-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_integer_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + min: 0, # optional + max: 100, # optional + default: 10, # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..546f7818d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-ip-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_ip_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: '192.0.2.0', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..aaf75a362 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-line-column.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_line_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [[1, 2], [3, 4], [5, 6]] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..f5a9318e5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_longtext_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..e2bf27b70 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_mediumtext_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-operations.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..576e9f224 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-operations.md @@ -0,0 +1,27 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_operations( + transaction_id: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..1e52d6e59 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-point-column.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_point_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [1, 2] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..c47193817 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_polygon_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..9b082036c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_relationship_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + related_table_id: '<RELATED_TABLE_ID>', + type: RelationshipType::ONETOONE, + two_way: false, # optional + key: '<KEY>', # optional + two_way_key: '<TWO_WAY_KEY>', # optional + on_delete: RelationMutate::CASCADE # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-row.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-row.md new file mode 100644 index 000000000..60aa4e9da --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-row.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.create_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 30, + "isAdmin" => false + }, + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-rows.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..2fc8a2b16 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-rows.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + rows: [], + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..9f4586884 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-string-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_string_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + size: 1, + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-table.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-table.md new file mode 100644 index 000000000..d89b2be59 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-table.md @@ -0,0 +1,25 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_table( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + name: '<NAME>', + permissions: [Permission.read(Role.any())], # optional + row_security: false, # optional + enabled: false, # optional + columns: [], # optional + indexes: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..aa7e59e2a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-text-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_text_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..61d6077cf --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_transaction( + ttl: 60 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..49671760f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-url-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_url_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'https://example.com', # optional + array: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..a03b5b706 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_varchar_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + size: 1, + required: false, + default: 'Hello World', # optional + array: false, # optional + encrypt: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/create.md b/examples/2.0.x/server-ruby/examples/tablesdb/create.md new file mode 100644 index 000000000..4eba90afb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/create.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..7dfeb83b3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.decrement_row_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + column: '<COLUMN>', + value: 1, # optional + min: 0, # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/delete-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..697305ada --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/delete-column.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/delete-index.md b/examples/2.0.x/server-ruby/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..78edab989 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/delete-index.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_index( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/delete-row.md b/examples/2.0.x/server-ruby/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..a6074a4f1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/delete-row.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.delete_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-ruby/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..69ab29e8a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/delete-rows.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/delete-table.md b/examples/2.0.x/server-ruby/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..30c7587c0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/delete-table.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_table( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-ruby/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..336fabba5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/delete-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_transaction( + transaction_id: '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/delete.md b/examples/2.0.x/server-ruby/examples/tablesdb/delete.md new file mode 100644 index 000000000..92cb3b59f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete( + database_id: '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/get-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/get-column.md new file mode 100644 index 000000000..21865dd54 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/get-column.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/get-index.md b/examples/2.0.x/server-ruby/examples/tablesdb/get-index.md new file mode 100644 index 000000000..78a49d384 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/get-index.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get_index( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/get-row.md b/examples/2.0.x/server-ruby/examples/tablesdb/get-row.md new file mode 100644 index 000000000..f16225a2b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/get-row.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.get_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/get-table.md b/examples/2.0.x/server-ruby/examples/tablesdb/get-table.md new file mode 100644 index 000000000..9c464793f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/get-table.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get_table( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-ruby/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..a9cd7d2f3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/get-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get_transaction( + transaction_id: '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/get.md b/examples/2.0.x/server-ruby/examples/tablesdb/get.md new file mode 100644 index 000000000..b45c2ca05 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get( + database_id: '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..c3295fda0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/increment-row-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.increment_row_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + column: '<COLUMN>', + value: 1, # optional + max: 100, # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/list-columns.md b/examples/2.0.x/server-ruby/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..0214923ed --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/list-columns.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list_columns( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-ruby/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..1a2a19d85 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/list-indexes.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list_indexes( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/list-rows.md b/examples/2.0.x/server-ruby/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..6d5669317 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/list-rows.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.list_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>', # optional + total: false, # optional + ttl: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/list-tables.md b/examples/2.0.x/server-ruby/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..9517913cc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/list-tables.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list_tables( + database_id: '<DATABASE_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-ruby/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..f8800dd78 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/list-transactions.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list_transactions( + queries: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/list.md b/examples/2.0.x/server-ruby/examples/tablesdb/list.md new file mode 100644 index 000000000..d9b52f250 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..fea7bfdbd --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_big_int_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 0, + min: 0, # optional + max: 1000000, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..c55d1f216 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_boolean_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: false, + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..d50571db9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_datetime_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: '2020-10-15T06:38:00.000+00:00', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..24b5ef629 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-email-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_email_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'email@example.com', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..6204ac2b0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-enum-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_enum_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + elements: ["active", "inactive"], + required: false, + default: 'active', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..cd98ae905 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-float-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_float_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 10.5, + min: 0, # optional + max: 100, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..1fd1e315e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-integer-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_integer_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 10, + min: 0, # optional + max: 100, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..9948c6f8c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-ip-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_ip_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: '192.0.2.0', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..8b32b9725 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-line-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_line_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [[1, 2], [3, 4], [5, 6]], # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..342ba998a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_longtext_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..70c7bca56 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_mediumtext_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..50ef5298a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-point-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_point_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [1, 2], # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..e6bb0bce6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_polygon_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..1bdbf618d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_relationship_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + on_delete: RelationMutate::CASCADE, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-row.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-row.md new file mode 100644 index 000000000..e801cb240 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-row.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.update_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 33, + "isAdmin" => false + }, # optional + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-rows.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..0eb800bd3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-rows.md @@ -0,0 +1,26 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 33, + "isAdmin" => false + }, # optional + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..1a356d189 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-string-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_string_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + size: 1, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-table.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-table.md new file mode 100644 index 000000000..a560d718e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-table.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_table( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + name: '<NAME>', # optional + permissions: [Permission.read(Role.any())], # optional + row_security: false, # optional + enabled: false, # optional + purge: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..9e40c656b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-text-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_text_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..057bff9ff --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-transaction.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_transaction( + transaction_id: '<TRANSACTION_ID>', + commit: false, # optional + rollback: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..93197380c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-url-column.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_url_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'https://example.com', + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-ruby/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..99804b03f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_varchar_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '<KEY>', + required: false, + default: 'Hello World', + size: 1, # optional + new_key: '<NEW_KEY>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/update.md b/examples/2.0.x/server-ruby/examples/tablesdb/update.md new file mode 100644 index 000000000..28377a61d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/update.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update( + database_id: '<DATABASE_ID>', + name: '<NAME>', # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-ruby/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..7802e672f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/upsert-row.md @@ -0,0 +1,29 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.upsert_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 33, + "isAdmin" => false + }, # optional + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-ruby/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..d450971f9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tablesdb/upsert-rows.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.upsert_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + rows: [], + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/create-membership.md b/examples/2.0.x/server-ruby/examples/teams/create-membership.md new file mode 100644 index 000000000..7df704e71 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/create-membership.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.create_membership( + team_id: '<TEAM_ID>', + roles: [], + email: 'email@example.com', # optional + user_id: '<USER_ID>', # optional + phone: '+12065550100', # optional + url: 'https://example.com', # optional + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/create.md b/examples/2.0.x/server-ruby/examples/teams/create.md new file mode 100644 index 000000000..4cec586c5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/create.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.create( + team_id: '<TEAM_ID>', + name: '<NAME>', + roles: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/delete-membership.md b/examples/2.0.x/server-ruby/examples/teams/delete-membership.md new file mode 100644 index 000000000..a53369d0d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/delete-membership.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.delete_membership( + team_id: '<TEAM_ID>', + membership_id: '<MEMBERSHIP_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/delete.md b/examples/2.0.x/server-ruby/examples/teams/delete.md new file mode 100644 index 000000000..926087d69 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.delete( + team_id: '<TEAM_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/get-membership.md b/examples/2.0.x/server-ruby/examples/teams/get-membership.md new file mode 100644 index 000000000..1e4ac1169 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/get-membership.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.get_membership( + team_id: '<TEAM_ID>', + membership_id: '<MEMBERSHIP_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/get-prefs.md b/examples/2.0.x/server-ruby/examples/teams/get-prefs.md new file mode 100644 index 000000000..13f9394d4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/get-prefs.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.get_prefs( + team_id: '<TEAM_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/get.md b/examples/2.0.x/server-ruby/examples/teams/get.md new file mode 100644 index 000000000..46c30add2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.get( + team_id: '<TEAM_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/list-memberships.md b/examples/2.0.x/server-ruby/examples/teams/list-memberships.md new file mode 100644 index 000000000..af1145cb5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/list-memberships.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.list_memberships( + team_id: '<TEAM_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/list.md b/examples/2.0.x/server-ruby/examples/teams/list.md new file mode 100644 index 000000000..dcebb72db --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.list( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/update-membership-status.md b/examples/2.0.x/server-ruby/examples/teams/update-membership-status.md new file mode 100644 index 000000000..4762f5aa6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/update-membership-status.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.update_membership_status( + team_id: '<TEAM_ID>', + membership_id: '<MEMBERSHIP_ID>', + user_id: '<USER_ID>', + secret: '<SECRET>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/update-membership.md b/examples/2.0.x/server-ruby/examples/teams/update-membership.md new file mode 100644 index 000000000..f94e3879e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/update-membership.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.update_membership( + team_id: '<TEAM_ID>', + membership_id: '<MEMBERSHIP_ID>', + roles: [] +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/update-name.md b/examples/2.0.x/server-ruby/examples/teams/update-name.md new file mode 100644 index 000000000..7c2fda631 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/update-name.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.update_name( + team_id: '<TEAM_ID>', + name: '<NAME>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/teams/update-prefs.md b/examples/2.0.x/server-ruby/examples/teams/update-prefs.md new file mode 100644 index 000000000..4410e91a6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/teams/update-prefs.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.update_prefs( + team_id: '<TEAM_ID>', + prefs: {} +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tokens/create-file-token.md b/examples/2.0.x/server-ruby/examples/tokens/create-file-token.md new file mode 100644 index 000000000..c734e65f2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tokens/create-file-token.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.create_file_token( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + expire: '2020-10-15T06:38:00.000+00:00' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tokens/delete.md b/examples/2.0.x/server-ruby/examples/tokens/delete.md new file mode 100644 index 000000000..c17c4f452 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tokens/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.delete( + token_id: '<TOKEN_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tokens/get.md b/examples/2.0.x/server-ruby/examples/tokens/get.md new file mode 100644 index 000000000..b4342f660 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tokens/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.get( + token_id: '<TOKEN_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tokens/list.md b/examples/2.0.x/server-ruby/examples/tokens/list.md new file mode 100644 index 000000000..c407e970c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tokens/list.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.list( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/tokens/update.md b/examples/2.0.x/server-ruby/examples/tokens/update.md new file mode 100644 index 000000000..84a9ddfad --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/tokens/update.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.update( + token_id: '<TOKEN_ID>', + expire: '2020-10-15T06:38:00.000+00:00' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-argon-2-user.md b/examples/2.0.x/server-ruby/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..26ad7f224 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-argon-2-user.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_argon2_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-ruby/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..9e3fd9bab --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-bcrypt-user.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_bcrypt_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-jwt.md b/examples/2.0.x/server-ruby/examples/users/create-jwt.md new file mode 100644 index 000000000..bb940ab27 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-jwt.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_jwt( + user_id: '<USER_ID>', + session_id: 'recent()', # optional + duration: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-md-5-user.md b/examples/2.0.x/server-ruby/examples/users/create-md-5-user.md new file mode 100644 index 000000000..8ad1535fe --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-md-5-user.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_md5_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-ruby/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..e2763ebfd --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_mfa_recovery_codes( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-ruby/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..c4e1b541a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-ph-pass-user.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_ph_pass_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-ruby/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..42138bd7f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_scrypt_modified_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + password_salt: '<PASSWORD_SALT>', + password_salt_separator: '<PASSWORD_SALT_SEPARATOR>', + password_signer_key: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-scrypt-user.md b/examples/2.0.x/server-ruby/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..14d85cf4a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-scrypt-user.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_scrypt_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + password_salt: '<PASSWORD_SALT>', + password_cpu: 8, + password_memory: 65536, + password_parallel: 1, + password_length: 64, + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-session.md b/examples/2.0.x/server-ruby/examples/users/create-session.md new file mode 100644 index 000000000..e44a0d845 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-session.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_session( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-sha-user.md b/examples/2.0.x/server-ruby/examples/users/create-sha-user.md new file mode 100644 index 000000000..6dbdece85 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-sha-user.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_sha_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + password_version: PasswordHash::SHA1, # optional + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-target.md b/examples/2.0.x/server-ruby/examples/users/create-target.md new file mode 100644 index 000000000..624b56f9d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-target.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_target( + user_id: '<USER_ID>', + target_id: '<TARGET_ID>', + provider_type: MessagingProviderType::EMAIL, + identifier: '<IDENTIFIER>', + provider_id: '<PROVIDER_ID>', # optional + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create-token.md b/examples/2.0.x/server-ruby/examples/users/create-token.md new file mode 100644 index 000000000..fbcbc6eeb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create-token.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_token( + user_id: '<USER_ID>', + length: 4, # optional + expire: 60 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/create.md b/examples/2.0.x/server-ruby/examples/users/create.md new file mode 100644 index 000000000..183fa0769 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/create.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create( + user_id: '<USER_ID>', + email: 'email@example.com', # optional + phone: '+12065550100', # optional + password: 'password', # optional + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/delete-identity.md b/examples/2.0.x/server-ruby/examples/users/delete-identity.md new file mode 100644 index 000000000..36625931b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/delete-identity.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_identity( + identity_id: '<IDENTITY_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-ruby/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..94af17b8b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_mfa_authenticator( + user_id: '<USER_ID>', + type: AuthenticatorType::TOTP +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/delete-session.md b/examples/2.0.x/server-ruby/examples/users/delete-session.md new file mode 100644 index 000000000..e4f55cf0f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/delete-session.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_session( + user_id: '<USER_ID>', + session_id: '<SESSION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/delete-sessions.md b/examples/2.0.x/server-ruby/examples/users/delete-sessions.md new file mode 100644 index 000000000..578366c54 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/delete-sessions.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_sessions( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/delete-target.md b/examples/2.0.x/server-ruby/examples/users/delete-target.md new file mode 100644 index 000000000..08b774487 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/delete-target.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_target( + user_id: '<USER_ID>', + target_id: '<TARGET_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/delete.md b/examples/2.0.x/server-ruby/examples/users/delete.md new file mode 100644 index 000000000..600fe7729 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-ruby/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..dbdbad3bc --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/get-mfa-challenge.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get_mfa_challenge( + user_id: '<USER_ID>', + challenge_id: '<CHALLENGE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-ruby/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..92e172291 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get_mfa_recovery_codes( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/get-prefs.md b/examples/2.0.x/server-ruby/examples/users/get-prefs.md new file mode 100644 index 000000000..58271f0e0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/get-prefs.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get_prefs( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/get-target.md b/examples/2.0.x/server-ruby/examples/users/get-target.md new file mode 100644 index 000000000..d7d8a0976 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/get-target.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get_target( + user_id: '<USER_ID>', + target_id: '<TARGET_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/get.md b/examples/2.0.x/server-ruby/examples/users/get.md new file mode 100644 index 000000000..b54a2a685 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/list-identities.md b/examples/2.0.x/server-ruby/examples/users/list-identities.md new file mode 100644 index 000000000..cbfdaa4fb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/list-identities.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_identities( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/list-memberships.md b/examples/2.0.x/server-ruby/examples/users/list-memberships.md new file mode 100644 index 000000000..15f3bb817 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/list-memberships.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_memberships( + user_id: '<USER_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/list-mfa-factors.md b/examples/2.0.x/server-ruby/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..ac66333fd --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/list-mfa-factors.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_mfa_factors( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/list-sessions.md b/examples/2.0.x/server-ruby/examples/users/list-sessions.md new file mode 100644 index 000000000..f32fb1184 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/list-sessions.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_sessions( + user_id: '<USER_ID>', + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/list-targets.md b/examples/2.0.x/server-ruby/examples/users/list-targets.md new file mode 100644 index 000000000..ac582c3be --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/list-targets.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_targets( + user_id: '<USER_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/list.md b/examples/2.0.x/server-ruby/examples/users/list.md new file mode 100644 index 000000000..e3ee048e6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-email-verification.md b/examples/2.0.x/server-ruby/examples/users/update-email-verification.md new file mode 100644 index 000000000..32bd4dcb3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-email-verification.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_email_verification( + user_id: '<USER_ID>', + email_verification: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-email.md b/examples/2.0.x/server-ruby/examples/users/update-email.md new file mode 100644 index 000000000..0d8e7d461 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-email.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_email( + user_id: '<USER_ID>', + email: 'email@example.com' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-impersonator.md b/examples/2.0.x/server-ruby/examples/users/update-impersonator.md new file mode 100644 index 000000000..b11d61f49 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-impersonator.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_impersonator( + user_id: '<USER_ID>', + impersonator: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-labels.md b/examples/2.0.x/server-ruby/examples/users/update-labels.md new file mode 100644 index 000000000..0110cb9e5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-labels.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_labels( + user_id: '<USER_ID>', + labels: [] +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-ruby/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..ca2a9adf7 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_mfa_recovery_codes( + user_id: '<USER_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-mfa.md b/examples/2.0.x/server-ruby/examples/users/update-mfa.md new file mode 100644 index 000000000..d46a61334 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-mfa.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_mfa( + user_id: '<USER_ID>', + mfa: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-name.md b/examples/2.0.x/server-ruby/examples/users/update-name.md new file mode 100644 index 000000000..79bd5c2d8 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-name.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_name( + user_id: '<USER_ID>', + name: '<NAME>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-password.md b/examples/2.0.x/server-ruby/examples/users/update-password.md new file mode 100644 index 000000000..6be197188 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-password.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_password( + user_id: '<USER_ID>', + password: 'password' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-phone-verification.md b/examples/2.0.x/server-ruby/examples/users/update-phone-verification.md new file mode 100644 index 000000000..0dfed2c86 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-phone-verification.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_phone_verification( + user_id: '<USER_ID>', + phone_verification: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-phone.md b/examples/2.0.x/server-ruby/examples/users/update-phone.md new file mode 100644 index 000000000..2788ed071 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-phone.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_phone( + user_id: '<USER_ID>', + number: '+12065550100' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-prefs.md b/examples/2.0.x/server-ruby/examples/users/update-prefs.md new file mode 100644 index 000000000..452fe9aa2 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-prefs.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_prefs( + user_id: '<USER_ID>', + prefs: {} +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-status.md b/examples/2.0.x/server-ruby/examples/users/update-status.md new file mode 100644 index 000000000..75b7f375b --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-status.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_status( + user_id: '<USER_ID>', + status: false +) +``` diff --git a/examples/2.0.x/server-ruby/examples/users/update-target.md b/examples/2.0.x/server-ruby/examples/users/update-target.md new file mode 100644 index 000000000..9c4c1c091 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/users/update-target.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_target( + user_id: '<USER_ID>', + target_id: '<TARGET_ID>', + identifier: '<IDENTIFIER>', # optional + provider_id: '<PROVIDER_ID>', # optional + name: '<NAME>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-ruby/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..b449f541e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/create-collection.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.create_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, + permissions: [Permission.read(Role.any())], # optional + document_security: false, # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/create-document.md b/examples/2.0.x/server-ruby/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..648d9b2c5 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/create-document.md @@ -0,0 +1,33 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +vectors_db = VectorsDB.new(client) + +result = vectors_db.create_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: { + "embeddings" => { + "0" => 0.12, + "1" => -0.55, + "2" => 0.88, + "3" => 1.02 + }, + "metadata" => { + "key" => "value" + } + }, + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-ruby/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..9f3a4d4d9 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/create-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.create_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + documents: [], + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/create-index.md b/examples/2.0.x/server-ruby/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..d7880ab2c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/create-index.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.create_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>', + type: VectorsDBIndexType::HNSW_EUCLIDEAN, + attributes: [], + orders: [OrderBy::ASC], # optional + lengths: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-ruby/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..6817930bb --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/create-operations.md @@ -0,0 +1,27 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.create_operations( + transaction_id: '<TRANSACTION_ID>', + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/create-query.md b/examples/2.0.x/server-ruby/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..917cdac2c --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/create-query.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +vectors_db = VectorsDB.new(client) + +result = vectors_db.create_query( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>', # optional + total: false, # optional + ttl: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-ruby/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..509255332 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/create-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.create_transaction( + ttl: 60 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/create.md b/examples/2.0.x/server-ruby/examples/vectorsdb/create.md new file mode 100644 index 000000000..eefcfd0e4 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/create.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.create( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..fc3bd763e --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-collection.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.delete_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..40718f324 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-document.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +vectors_db = VectorsDB.new(client) + +result = vectors_db.delete_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..bb1173a38 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.delete_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..b968f684f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-index.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.delete_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..4124aac36 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.delete_transaction( + transaction_id: '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/delete.md b/examples/2.0.x/server-ruby/examples/vectorsdb/delete.md new file mode 100644 index 000000000..6be5631a1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.delete( + database_id: '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-ruby/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..dae8e5315 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/get-collection.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.get_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/get-document.md b/examples/2.0.x/server-ruby/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..49bfc862f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/get-document.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +vectors_db = VectorsDB.new(client) + +result = vectors_db.get_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/get-index.md b/examples/2.0.x/server-ruby/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..af722303a --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/get-index.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.get_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '<KEY>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-ruby/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..584134d61 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/get-transaction.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.get_transaction( + transaction_id: '<TRANSACTION_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/get.md b/examples/2.0.x/server-ruby/examples/vectorsdb/get.md new file mode 100644 index 000000000..cea4329f6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.get( + database_id: '<DATABASE_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-ruby/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..dc85e4ac0 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/list-collections.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.list_collections( + database_id: '<DATABASE_ID>', + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-ruby/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..c60da651f --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/list-documents.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +vectors_db = VectorsDB.new(client) + +result = vectors_db.list_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + transaction_id: '<TRANSACTION_ID>', # optional + total: false, # optional + ttl: 0 # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-ruby/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..2df5e6825 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/list-indexes.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.list_indexes( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-ruby/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..9c2182da6 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/list-transactions.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.list_transactions( + queries: [] # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/list.md b/examples/2.0.x/server-ruby/examples/vectorsdb/list.md new file mode 100644 index 000000000..2b52c5985 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.list( + queries: [], # optional + search: '<SEARCH>', # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-ruby/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..0dfdac139 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/update-collection.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.update_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + name: '<NAME>', + dimension: 1, # optional + permissions: [Permission.read(Role.any())], # optional + document_security: false, # optional + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/update-document.md b/examples/2.0.x/server-ruby/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..b4fdb3731 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/update-document.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +vectors_db = VectorsDB.new(client) + +result = vectors_db.update_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: {}, # optional + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-ruby/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..2f4d27a41 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/update-documents.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.update_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + data: {}, # optional + queries: [], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-ruby/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..96fbc93da --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/update-transaction.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.update_transaction( + transaction_id: '<TRANSACTION_ID>', + commit: false, # optional + rollback: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/update.md b/examples/2.0.x/server-ruby/examples/vectorsdb/update.md new file mode 100644 index 000000000..205ec54a3 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/update.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.update( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-ruby/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..788890374 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/upsert-document.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +vectors_db = VectorsDB.new(client) + +result = vectors_db.upsert_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: {}, # optional + permissions: [Permission.read(Role.any())], # optional + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-ruby/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..d737f1072 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +vectors_db = VectorsDB.new(client) + +result = vectors_db.upsert_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + documents: [], + transaction_id: '<TRANSACTION_ID>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/webhooks/create.md b/examples/2.0.x/server-ruby/examples/webhooks/create.md new file mode 100644 index 000000000..9f231f7b1 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/webhooks/create.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks.new(client) + +result = webhooks.create( + webhook_id: '<WEBHOOK_ID>', + url: 'https://example.com/webhook', + name: '<NAME>', + events: [], + enabled: false, # optional + tls: false, # optional + auth_username: '<AUTH_USERNAME>', # optional + auth_password: 'password', # optional + secret: '<SECRET>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/webhooks/delete.md b/examples/2.0.x/server-ruby/examples/webhooks/delete.md new file mode 100644 index 000000000..5951b7cab --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/webhooks/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks.new(client) + +result = webhooks.delete( + webhook_id: '<WEBHOOK_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/webhooks/get.md b/examples/2.0.x/server-ruby/examples/webhooks/get.md new file mode 100644 index 000000000..d81c12995 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/webhooks/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks.new(client) + +result = webhooks.get( + webhook_id: '<WEBHOOK_ID>' +) +``` diff --git a/examples/2.0.x/server-ruby/examples/webhooks/list.md b/examples/2.0.x/server-ruby/examples/webhooks/list.md new file mode 100644 index 000000000..541604073 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/webhooks/list.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks.new(client) + +result = webhooks.list( + queries: [], # optional + total: false # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/webhooks/update-secret.md b/examples/2.0.x/server-ruby/examples/webhooks/update-secret.md new file mode 100644 index 000000000..7aadac164 --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/webhooks/update-secret.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks.new(client) + +result = webhooks.update_secret( + webhook_id: '<WEBHOOK_ID>', + secret: '<SECRET>' # optional +) +``` diff --git a/examples/2.0.x/server-ruby/examples/webhooks/update.md b/examples/2.0.x/server-ruby/examples/webhooks/update.md new file mode 100644 index 000000000..ad3fa894d --- /dev/null +++ b/examples/2.0.x/server-ruby/examples/webhooks/update.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +webhooks = Webhooks.new(client) + +result = webhooks.update( + webhook_id: '<WEBHOOK_ID>', + name: '<NAME>', + url: 'https://example.com/webhook', + events: [], + enabled: false, # optional + tls: false, # optional + auth_username: '<AUTH_USERNAME>', # optional + auth_password: 'password' # optional +) +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-anonymous-session.md b/examples/2.0.x/server-rust/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..0d1b46780 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-anonymous-session.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_anonymous_session().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-email-password-session.md b/examples/2.0.x/server-rust/examples/account/create-email-password-session.md new file mode 100644 index 000000000..ac72db12b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-email-password-session.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_email_password_session( + "email@example.com", + "password" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-email-token.md b/examples/2.0.x/server-rust/examples/account/create-email-token.md new file mode 100644 index 000000000..4c9d6f4c2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-email-token.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_email_token( + "<USER_ID>", + "email@example.com", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-email-verification.md b/examples/2.0.x/server-rust/examples/account/create-email-verification.md new file mode 100644 index 000000000..044e55088 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-email-verification.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_email_verification( + "https://example.com" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-magic-url-token.md b/examples/2.0.x/server-rust/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..26f6992ed --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-magic-url-token.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_magic_url_token( + "<USER_ID>", + "email@example.com", + Some("https://example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-rust/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..1c44d6bd4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-mfa-authenticator.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_mfa_authenticator( + appwrite::enums::AuthenticatorType::Totp + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-rust/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..b9a315b89 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-mfa-challenge.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_mfa_challenge( + appwrite::enums::AuthenticationFactor::Email + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-rust/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..6bee9337a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_mfa_recovery_codes().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-rust/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..3fdb0c527 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-o-auth-2-token.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_o_auth2_token( + appwrite::enums::OAuthProvider::Amazon, + Some("https://example.com"), // optional + Some("https://example.com"), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-phone-token.md b/examples/2.0.x/server-rust/examples/account/create-phone-token.md new file mode 100644 index 000000000..870d1698b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-phone-token.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_phone_token( + "<USER_ID>", + "+12065550100" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-phone-verification.md b/examples/2.0.x/server-rust/examples/account/create-phone-verification.md new file mode 100644 index 000000000..4032be23e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-phone-verification.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_phone_verification().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-recovery.md b/examples/2.0.x/server-rust/examples/account/create-recovery.md new file mode 100644 index 000000000..ddd6c8d38 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-recovery.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_recovery( + "email@example.com", + "https://example.com" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-session.md b/examples/2.0.x/server-rust/examples/account/create-session.md new file mode 100644 index 000000000..70f220957 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-session.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_session( + "<USER_ID>", + "<SECRET>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create-verification.md b/examples/2.0.x/server-rust/examples/account/create-verification.md new file mode 100644 index 000000000..2a6e2e626 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create-verification.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create_verification( + "https://example.com" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/create.md b/examples/2.0.x/server-rust/examples/account/create.md new file mode 100644 index 000000000..b32e57733 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/create.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.create( + "<USER_ID>", + "email@example.com", + "password", + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/delete-identity.md b/examples/2.0.x/server-rust/examples/account/delete-identity.md new file mode 100644 index 000000000..9e0de14d6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/delete-identity.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + account.delete_identity( + "<IDENTITY_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-rust/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..93e8f2d4f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + account.delete_mfa_authenticator( + appwrite::enums::AuthenticatorType::Totp + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/delete-session.md b/examples/2.0.x/server-rust/examples/account/delete-session.md new file mode 100644 index 000000000..5e1cef5f8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/delete-session.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + account.delete_session( + "<SESSION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/delete-sessions.md b/examples/2.0.x/server-rust/examples/account/delete-sessions.md new file mode 100644 index 000000000..ee557af60 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/delete-sessions.md @@ -0,0 +1,18 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + account.delete_sessions().await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-rust/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..453b3854c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.get_mfa_recovery_codes().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/get-prefs.md b/examples/2.0.x/server-rust/examples/account/get-prefs.md new file mode 100644 index 000000000..dad334c7a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/get-prefs.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.get_prefs().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/get-session.md b/examples/2.0.x/server-rust/examples/account/get-session.md new file mode 100644 index 000000000..e0659e942 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/get-session.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.get_session( + "<SESSION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/get.md b/examples/2.0.x/server-rust/examples/account/get.md new file mode 100644 index 000000000..c132a21ed --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/get.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.get().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/list-identities.md b/examples/2.0.x/server-rust/examples/account/list-identities.md new file mode 100644 index 000000000..59c6bfbc7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/list-identities.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.list_identities( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/list-mfa-factors.md b/examples/2.0.x/server-rust/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..65e05f467 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/list-mfa-factors.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.list_mfa_factors().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/list-sessions.md b/examples/2.0.x/server-rust/examples/account/list-sessions.md new file mode 100644 index 000000000..5a2af5974 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/list-sessions.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.list_sessions().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-email-verification.md b/examples/2.0.x/server-rust/examples/account/update-email-verification.md new file mode 100644 index 000000000..ce125bdf3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-email-verification.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_email_verification( + "<USER_ID>", + "<SECRET>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-email.md b/examples/2.0.x/server-rust/examples/account/update-email.md new file mode 100644 index 000000000..054da7721 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-email.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_email( + "email@example.com", + "password" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-magic-url-session.md b/examples/2.0.x/server-rust/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..a540c4c7e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-magic-url-session.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_magic_url_session( + "<USER_ID>", + "<SECRET>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-rust/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..32610e12a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-mfa-authenticator.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_mfa_authenticator( + appwrite::enums::AuthenticatorType::Totp, + "<OTP>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-rust/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..d903fa60d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-mfa-challenge.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_mfa_challenge( + "<CHALLENGE_ID>", + "<OTP>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-rust/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..df849273b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_mfa_recovery_codes().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-mfa.md b/examples/2.0.x/server-rust/examples/account/update-mfa.md new file mode 100644 index 000000000..d9769d9d2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-mfa.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_mfa( + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-name.md b/examples/2.0.x/server-rust/examples/account/update-name.md new file mode 100644 index 000000000..46ceffc2f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-name.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_name( + "<NAME>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-password.md b/examples/2.0.x/server-rust/examples/account/update-password.md new file mode 100644 index 000000000..2e0ac1d36 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-password.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_password( + "password", + Some("password") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-phone-session.md b/examples/2.0.x/server-rust/examples/account/update-phone-session.md new file mode 100644 index 000000000..cd39e140f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-phone-session.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_phone_session( + "<USER_ID>", + "<SECRET>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-phone-verification.md b/examples/2.0.x/server-rust/examples/account/update-phone-verification.md new file mode 100644 index 000000000..5c6beca90 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-phone-verification.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_phone_verification( + "<USER_ID>", + "<SECRET>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-phone.md b/examples/2.0.x/server-rust/examples/account/update-phone.md new file mode 100644 index 000000000..f17c0f5c5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-phone.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_phone( + "+12065550100", + "password" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-prefs.md b/examples/2.0.x/server-rust/examples/account/update-prefs.md new file mode 100644 index 000000000..830abd9e0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-prefs.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_prefs( + serde_json::json!({}) + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-recovery.md b/examples/2.0.x/server-rust/examples/account/update-recovery.md new file mode 100644 index 000000000..340134c60 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-recovery.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_recovery( + "<USER_ID>", + "<SECRET>", + "password" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-session.md b/examples/2.0.x/server-rust/examples/account/update-session.md new file mode 100644 index 000000000..8ed7a2293 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-session.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_session( + "<SESSION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-status.md b/examples/2.0.x/server-rust/examples/account/update-status.md new file mode 100644 index 000000000..66ddfe17c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-status.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_status().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/account/update-verification.md b/examples/2.0.x/server-rust/examples/account/update-verification.md new file mode 100644 index 000000000..cbe7e8447 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/account/update-verification.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Account; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let account = Account::new(&client); + + let result = account.update_verification( + "<USER_ID>", + "<SECRET>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/advisor/delete-report.md b/examples/2.0.x/server-rust/examples/advisor/delete-report.md new file mode 100644 index 000000000..e0a205aae --- /dev/null +++ b/examples/2.0.x/server-rust/examples/advisor/delete-report.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Advisor; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let advisor = Advisor::new(&client); + + advisor.delete_report( + "<REPORT_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/advisor/get-insight.md b/examples/2.0.x/server-rust/examples/advisor/get-insight.md new file mode 100644 index 000000000..7926f5f84 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/advisor/get-insight.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Advisor; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let advisor = Advisor::new(&client); + + let result = advisor.get_insight( + "<REPORT_ID>", + "<INSIGHT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/advisor/get-report.md b/examples/2.0.x/server-rust/examples/advisor/get-report.md new file mode 100644 index 000000000..9cfe34e79 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/advisor/get-report.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Advisor; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let advisor = Advisor::new(&client); + + let result = advisor.get_report( + "<REPORT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/advisor/list-insights.md b/examples/2.0.x/server-rust/examples/advisor/list-insights.md new file mode 100644 index 000000000..a67a7ddc3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/advisor/list-insights.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Advisor; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let advisor = Advisor::new(&client); + + let result = advisor.list_insights( + "<REPORT_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/advisor/list-reports.md b/examples/2.0.x/server-rust/examples/advisor/list-reports.md new file mode 100644 index 000000000..f0620dc50 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/advisor/list-reports.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Advisor; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let advisor = Advisor::new(&client); + + let result = advisor.list_reports( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-browser.md b/examples/2.0.x/server-rust/examples/avatars/get-browser.md new file mode 100644 index 000000000..e61031416 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-browser.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_browser( + appwrite::enums::Browser::AvantBrowser, + Some(0), // optional + Some(0), // optional + Some(-1) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-credit-card.md b/examples/2.0.x/server-rust/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..2fb6fef00 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-credit-card.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_credit_card( + appwrite::enums::CreditCard::AmericanExpress, + Some(0), // optional + Some(0), // optional + Some(-1) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-favicon.md b/examples/2.0.x/server-rust/examples/avatars/get-favicon.md new file mode 100644 index 000000000..74c33216a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-favicon.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_favicon( + "https://example.com" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-flag.md b/examples/2.0.x/server-rust/examples/avatars/get-flag.md new file mode 100644 index 000000000..621d2c13e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-flag.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_flag( + appwrite::enums::Flag::Afghanistan, + Some(0), // optional + Some(0), // optional + Some(-1) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-image.md b/examples/2.0.x/server-rust/examples/avatars/get-image.md new file mode 100644 index 000000000..b7175c7bf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-image.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_image( + "https://example.com", + Some(0), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-initials.md b/examples/2.0.x/server-rust/examples/avatars/get-initials.md new file mode 100644 index 000000000..eaae6ff39 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-initials.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_initials( + Some("<NAME>"), // optional + Some(0), // optional + Some(0), // optional + Some("FFFFFF") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-photo.md b/examples/2.0.x/server-rust/examples/avatars/get-photo.md new file mode 100644 index 000000000..040583849 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-photo.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_photo( + Some(0), // optional + Some(0), // optional + Some(0), // optional + Some("png"), // optional + Some("g"), // optional + Some("current()"), // optional + Some("<EMAIL_HASH>"), // optional + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-qr.md b/examples/2.0.x/server-rust/examples/avatars/get-qr.md new file mode 100644 index 000000000..585f63a04 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-qr.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_qr( + "<TEXT>", + Some(1), // optional + Some(0), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/avatars/get-screenshot.md b/examples/2.0.x/server-rust/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..d21ece0b5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/avatars/get-screenshot.md @@ -0,0 +1,41 @@ +```rust +use appwrite::Client; +use appwrite::services::Avatars; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let avatars = Avatars::new(&client); + + let result = avatars.get_screenshot( + "https://example.com", + Some(serde_json::json!({})), // optional + Some(1920), // optional + Some(1080), // optional + Some(2), // optional + Some(appwrite::enums::BrowserTheme::Dark), // optional + Some("Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15"), // optional + Some(true), // optional + Some("en-US"), // optional + Some(appwrite::enums::Timezone::AfricaAbidjan), // optional + Some(37.7749), // optional + Some(-122.4194), // optional + Some(100), // optional + Some(true), // optional + Some(vec![appwrite::enums::BrowserPermission::Geolocation, appwrite::enums::BrowserPermission::Notifications]), // optional + Some(3), // optional + Some(800), // optional + Some(600), // optional + Some(85), // optional + Some(appwrite::enums::ImageFormat::Jpeg) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..6c8f09dbe --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-big-int-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_big_int_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(0), // optional + Some(1000000), // optional + Some(0), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..b109079af --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-boolean-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_boolean_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-collection.md b/examples/2.0.x/server-rust/examples/databases/create-collection.md new file mode 100644 index 000000000..57bf5f810 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-collection.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false), // optional + Some(vec![]), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..736f80cac --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-datetime-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_datetime_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("2020-10-15T06:38:00.000+00:00"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-document.md b/examples/2.0.x/server-rust/examples/databases/create-document.md new file mode 100644 index 000000000..6e3321d35 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let databases = Databases::new(&client); + + let result = databases.create_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + serde_json::json!({}), + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-documents.md b/examples/2.0.x/server-rust/examples/databases/create-documents.md new file mode 100644 index 000000000..f46917840 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + vec![], + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-email-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..cdebbb408 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-email-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_email_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("email@example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..edaf6a8b6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-enum-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_enum_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + vec!["active".into(), "inactive".into()], + false, + Some("active"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-float-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..2f1faf562 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-float-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_float_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(0), // optional + Some(100), // optional + Some(10.5), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-index.md b/examples/2.0.x/server-rust/examples/databases/create-index.md new file mode 100644 index 000000000..b7389d9a5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-index.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + appwrite::enums::DatabasesIndexType::Key, + vec![], + Some(vec![appwrite::enums::OrderBy::Asc]), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..7d2d1b18e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-integer-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_integer_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(0), // optional + Some(100), // optional + Some(10), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..9ab3d7cbf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-ip-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_ip_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("192.0.2.0"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-line-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..d0834b1b9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-line-attribute.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_line_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(vec![serde_json::json!([1,2]), serde_json::json!([3,4]), serde_json::json!([5,6])]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..11a38c1c9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-longtext-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_longtext_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..328414b34 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_mediumtext_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-operations.md b/examples/2.0.x/server-rust/examples/databases/create-operations.md new file mode 100644 index 000000000..7e4204a52 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-operations.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_operations( + "<TRANSACTION_ID>", + Some(vec![serde_json::json!({"action":"create","databaseId":"<DATABASE_ID>","collectionId":"<COLLECTION_ID>","documentId":"<DOCUMENT_ID>","data":{"name":"Walter O'Brien"}})]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-point-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..489fba3b0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-point-attribute.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_point_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(vec![1, 2]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..32c519f05 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-polygon-attribute.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_polygon_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(vec![serde_json::json!([[1,2],[3,4],[5,6],[1,2]])]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..af202d405 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-relationship-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_relationship_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<RELATED_COLLECTION_ID>", + appwrite::enums::RelationshipType::OneToOne, + Some(false), // optional + Some("<KEY>"), // optional + Some("<TWO_WAY_KEY>"), // optional + Some(appwrite::enums::RelationMutate::Cascade) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-string-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..30ed03b61 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-string-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_string_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + 1, + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-text-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..6f0b142f7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-text-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_text_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-transaction.md b/examples/2.0.x/server-rust/examples/databases/create-transaction.md new file mode 100644 index 000000000..13ec21f87 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-transaction.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_transaction( + Some(60) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-url-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..6a9b96fdb --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-url-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_url_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("https://example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-rust/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..66528ae7b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create-varchar-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create_varchar_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + 1, + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/create.md b/examples/2.0.x/server-rust/examples/databases/create.md new file mode 100644 index 000000000..58ff3e5e8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/create.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.create( + "<DATABASE_ID>", + "<NAME>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-rust/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..8dd9d1858 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/decrement-document-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let databases = Databases::new(&client); + + let result = databases.decrement_document_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "<ATTRIBUTE>", + Some(1), // optional + Some(0), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/delete-attribute.md b/examples/2.0.x/server-rust/examples/databases/delete-attribute.md new file mode 100644 index 000000000..3388f0b95 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/delete-attribute.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + databases.delete_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/delete-collection.md b/examples/2.0.x/server-rust/examples/databases/delete-collection.md new file mode 100644 index 000000000..1b7a38577 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/delete-collection.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + databases.delete_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/delete-document.md b/examples/2.0.x/server-rust/examples/databases/delete-document.md new file mode 100644 index 000000000..4762af670 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/delete-document.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let databases = Databases::new(&client); + + databases.delete_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some("<TRANSACTION_ID>") // optional + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/delete-documents.md b/examples/2.0.x/server-rust/examples/databases/delete-documents.md new file mode 100644 index 000000000..2d75876c5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/delete-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.delete_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/delete-index.md b/examples/2.0.x/server-rust/examples/databases/delete-index.md new file mode 100644 index 000000000..49ae6eb2e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/delete-index.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + databases.delete_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/delete-transaction.md b/examples/2.0.x/server-rust/examples/databases/delete-transaction.md new file mode 100644 index 000000000..45308f71f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/delete-transaction.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + databases.delete_transaction( + "<TRANSACTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/delete.md b/examples/2.0.x/server-rust/examples/databases/delete.md new file mode 100644 index 000000000..268bad5c5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + databases.delete( + "<DATABASE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/get-attribute.md b/examples/2.0.x/server-rust/examples/databases/get-attribute.md new file mode 100644 index 000000000..6053bdfbc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/get-attribute.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.get_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/get-collection.md b/examples/2.0.x/server-rust/examples/databases/get-collection.md new file mode 100644 index 000000000..cdc1f8705 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/get-collection.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.get_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/get-document.md b/examples/2.0.x/server-rust/examples/databases/get-document.md new file mode 100644 index 000000000..06b72cc95 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/get-document.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let databases = Databases::new(&client); + + let result = databases.get_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/get-index.md b/examples/2.0.x/server-rust/examples/databases/get-index.md new file mode 100644 index 000000000..7a7ea7338 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/get-index.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.get_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/get-transaction.md b/examples/2.0.x/server-rust/examples/databases/get-transaction.md new file mode 100644 index 000000000..b035332ad --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/get-transaction.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.get_transaction( + "<TRANSACTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/get.md b/examples/2.0.x/server-rust/examples/databases/get.md new file mode 100644 index 000000000..9a2aeb5bb --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.get( + "<DATABASE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-rust/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..36f3ea18f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/increment-document-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let databases = Databases::new(&client); + + let result = databases.increment_document_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "<ATTRIBUTE>", + Some(1), // optional + Some(100), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/list-attributes.md b/examples/2.0.x/server-rust/examples/databases/list-attributes.md new file mode 100644 index 000000000..156c43fd3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/list-attributes.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.list_attributes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/list-collections.md b/examples/2.0.x/server-rust/examples/databases/list-collections.md new file mode 100644 index 000000000..5b1cd663f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/list-collections.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.list_collections( + "<DATABASE_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/list-documents.md b/examples/2.0.x/server-rust/examples/databases/list-documents.md new file mode 100644 index 000000000..2dd664c6e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/list-documents.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let databases = Databases::new(&client); + + let result = databases.list_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>"), // optional + Some(false), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/list-indexes.md b/examples/2.0.x/server-rust/examples/databases/list-indexes.md new file mode 100644 index 000000000..94b4d636c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/list-indexes.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.list_indexes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/list-transactions.md b/examples/2.0.x/server-rust/examples/databases/list-transactions.md new file mode 100644 index 000000000..6570a83a7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/list-transactions.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.list_transactions( + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/list.md b/examples/2.0.x/server-rust/examples/databases/list.md new file mode 100644 index 000000000..9967ae58a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.list( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..eafd1dd04 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-big-int-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_big_int_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(0), + Some(0), // optional + Some(1000000), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..9e9e5510a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-boolean-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_boolean_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(false), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-collection.md b/examples/2.0.x/server-rust/examples/databases/update-collection.md new file mode 100644 index 000000000..af0a82c4a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-collection.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some("<NAME>"), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..b0ce51faf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-datetime-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_datetime_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("2020-10-15T06:38:00.000+00:00"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-document.md b/examples/2.0.x/server-rust/examples/databases/update-document.md new file mode 100644 index 000000000..3729c1a32 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let databases = Databases::new(&client); + + let result = databases.update_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-documents.md b/examples/2.0.x/server-rust/examples/databases/update-documents.md new file mode 100644 index 000000000..e0dd2373e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-documents.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(serde_json::json!({})), // optional + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-email-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..51da9adc7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-email-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_email_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("email@example.com"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..07f9ea396 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-enum-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_enum_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + vec!["active".into(), "inactive".into()], + false, + Some("active"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-float-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..4ce1b3d0b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-float-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_float_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(10.5), + Some(0), // optional + Some(100), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..d9a912e2a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-integer-attribute.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_integer_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(10), + Some(0), // optional + Some(100), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..3912aa9c3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-ip-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_ip_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("192.0.2.0"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-line-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..8ba81273b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-line-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_line_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(vec![serde_json::json!([1,2]), serde_json::json!([3,4]), serde_json::json!([5,6])]), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..dc6dabca4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-longtext-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_longtext_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("Hello World"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..f88d43bf1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_mediumtext_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("Hello World"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-point-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..b862fd6a9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-point-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_point_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(vec![1, 2]), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..541b17bd2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-polygon-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_polygon_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some(vec![serde_json::json!([[1,2],[3,4],[5,6],[1,2]])]), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..d8a3073a0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-relationship-attribute.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_relationship_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + Some(appwrite::enums::RelationMutate::Cascade), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-string-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..5238097e8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-string-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_string_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("Hello World"), + Some(1), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-text-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..646ccec53 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-text-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_text_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("Hello World"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-transaction.md b/examples/2.0.x/server-rust/examples/databases/update-transaction.md new file mode 100644 index 000000000..0edecca22 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-transaction.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_transaction( + "<TRANSACTION_ID>", + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-url-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..ca807990b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-url-attribute.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_url_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("https://example.com"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-rust/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..bda6271b5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update-varchar-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update_varchar_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + false, + Some("Hello World"), + Some(1), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/update.md b/examples/2.0.x/server-rust/examples/databases/update.md new file mode 100644 index 000000000..1f8f57b07 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/update.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.update( + "<DATABASE_ID>", + Some("<NAME>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/upsert-document.md b/examples/2.0.x/server-rust/examples/databases/upsert-document.md new file mode 100644 index 000000000..88e96676e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/upsert-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let databases = Databases::new(&client); + + let result = databases.upsert_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/databases/upsert-documents.md b/examples/2.0.x/server-rust/examples/databases/upsert-documents.md new file mode 100644 index 000000000..6ef035f6e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/databases/upsert-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Databases; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let databases = Databases::new(&client); + + let result = databases.upsert_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + vec![], + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/create-collection.md b/examples/2.0.x/server-rust/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..8e7eb00c5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/create-collection.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.create_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false), // optional + Some(vec![]), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/create-document.md b/examples/2.0.x/server-rust/examples/documentsdb/create-document.md new file mode 100644 index 000000000..0986a89c2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/create-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.create_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + serde_json::json!({}), + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/create-documents.md b/examples/2.0.x/server-rust/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..1c60d5cd5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/create-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.create_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + vec![], + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/create-index.md b/examples/2.0.x/server-rust/examples/documentsdb/create-index.md new file mode 100644 index 000000000..2b7534c5b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/create-index.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.create_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + appwrite::enums::DocumentsDBIndexType::Key, + vec![], + Some(vec![appwrite::enums::OrderBy::Asc]), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/create-operations.md b/examples/2.0.x/server-rust/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..4288bfb1d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/create-operations.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.create_operations( + "<TRANSACTION_ID>", + Some(vec![serde_json::json!({"action":"create","databaseId":"<DATABASE_ID>","collectionId":"<COLLECTION_ID>","documentId":"<DOCUMENT_ID>","data":{"name":"Walter O'Brien"}})]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-rust/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..46ba2c1b9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/create-transaction.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.create_transaction( + Some(60) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/create.md b/examples/2.0.x/server-rust/examples/documentsdb/create.md new file mode 100644 index 000000000..cb0a88acd --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/create.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.create( + "<DATABASE_ID>", + "<NAME>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-rust/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..31453e7ae --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.decrement_document_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "<ATTRIBUTE>", + Some(1), // optional + Some(0), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-rust/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..777bc9f47 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/delete-collection.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + documents_db.delete_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/delete-document.md b/examples/2.0.x/server-rust/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..aaf1c97fb --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/delete-document.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + documents_db.delete_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some("<TRANSACTION_ID>") // optional + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-rust/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..be2ad02d6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/delete-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.delete_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/delete-index.md b/examples/2.0.x/server-rust/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..d2911cae9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/delete-index.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + documents_db.delete_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-rust/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..86a7d3dd0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/delete-transaction.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + documents_db.delete_transaction( + "<TRANSACTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/delete.md b/examples/2.0.x/server-rust/examples/documentsdb/delete.md new file mode 100644 index 000000000..f0254c301 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + documents_db.delete( + "<DATABASE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/get-collection.md b/examples/2.0.x/server-rust/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..742ada715 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/get-collection.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.get_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/get-document.md b/examples/2.0.x/server-rust/examples/documentsdb/get-document.md new file mode 100644 index 000000000..b2c1ca59a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/get-document.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.get_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/get-index.md b/examples/2.0.x/server-rust/examples/documentsdb/get-index.md new file mode 100644 index 000000000..cd4ffbd58 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/get-index.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.get_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-rust/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..2a7ade60a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/get-transaction.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.get_transaction( + "<TRANSACTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/get.md b/examples/2.0.x/server-rust/examples/documentsdb/get.md new file mode 100644 index 000000000..e60770cfe --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.get( + "<DATABASE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-rust/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..f45a1bbf0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.increment_document_attribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "<ATTRIBUTE>", + Some(1), // optional + Some(100), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/list-collections.md b/examples/2.0.x/server-rust/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..2266a7314 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/list-collections.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.list_collections( + "<DATABASE_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/list-documents.md b/examples/2.0.x/server-rust/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..b99a9fdb3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/list-documents.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.list_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>"), // optional + Some(false), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-rust/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..0db1c7a55 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/list-indexes.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.list_indexes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-rust/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..9f387f633 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/list-transactions.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.list_transactions( + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/list.md b/examples/2.0.x/server-rust/examples/documentsdb/list.md new file mode 100644 index 000000000..5034622a3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.list( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/update-collection.md b/examples/2.0.x/server-rust/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..895461693 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/update-collection.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.update_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/update-document.md b/examples/2.0.x/server-rust/examples/documentsdb/update-document.md new file mode 100644 index 000000000..6faab5b42 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/update-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.update_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/update-documents.md b/examples/2.0.x/server-rust/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..a85039201 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/update-documents.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.update_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(serde_json::json!({})), // optional + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-rust/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..449d18783 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/update-transaction.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.update_transaction( + "<TRANSACTION_ID>", + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/update.md b/examples/2.0.x/server-rust/examples/documentsdb/update.md new file mode 100644 index 000000000..07ec7089e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/update.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.update( + "<DATABASE_ID>", + "<NAME>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-rust/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..29e6d534c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/upsert-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.upsert_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-rust/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..d6ba16543 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/documentsdb/upsert-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::DocumentsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let documents_db = DocumentsDB::new(&client); + + let result = documents_db.upsert_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + vec![], + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-rust/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..8f945bb4c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Embeddings; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let embeddings = Embeddings::new(&client); + + let result = embeddings.create_text_embeddings( + vec![], + Some(appwrite::enums::EmbeddingModel::NomicEmbedText) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/create-deployment.md b/examples/2.0.x/server-rust/examples/functions/create-deployment.md new file mode 100644 index 000000000..a3fbf94cd --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/create-deployment.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; +use appwrite::InputFile; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let code = InputFile::from_path("path/to/file.png", None).await?; + + let result = functions.create_deployment( + "<FUNCTION_ID>", + code, + false, + Some("<ENTRYPOINT>"), // optional + Some("<COMMANDS>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-rust/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..d6d923247 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.create_duplicate_deployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + Some("<BUILD_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/create-execution.md b/examples/2.0.x/server-rust/examples/functions/create-execution.md new file mode 100644 index 000000000..c614af524 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/create-execution.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let functions = Functions::new(&client); + + let result = functions.create_execution( + "<FUNCTION_ID>", + Some("<BODY>"), // optional + Some(false), // optional + Some("<PATH>"), // optional + Some(appwrite::enums::ExecutionMethod::GET), // optional + Some(serde_json::json!({})), // optional + Some("<SCHEDULED_AT>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/create-template-deployment.md b/examples/2.0.x/server-rust/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..998338d14 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/create-template-deployment.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.create_template_deployment( + "<FUNCTION_ID>", + "<REPOSITORY>", + "<OWNER>", + "<ROOT_DIRECTORY>", + appwrite::enums::TemplateReferenceType::Commit, + "<REFERENCE>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/create-variable.md b/examples/2.0.x/server-rust/examples/functions/create-variable.md new file mode 100644 index 000000000..3f7ec5477 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/create-variable.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.create_variable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", + "<KEY>", + "<VALUE>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-rust/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..28ce87815 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/create-vcs-deployment.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.create_vcs_deployment( + "<FUNCTION_ID>", + appwrite::enums::VCSReferenceType::Branch, + "<REFERENCE>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/create.md b/examples/2.0.x/server-rust/examples/functions/create.md new file mode 100644 index 000000000..46b7a2026 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/create.md @@ -0,0 +1,43 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.create( + "<FUNCTION_ID>", + "<NAME>", + appwrite::enums::Runtime::Node145, + Some(vec!["any".into()]), // optional + Some(vec![]), // optional + Some("0 0 * * *"), // optional + Some(1), // optional + Some(false), // optional + Some(false), // optional + Some("<ENTRYPOINT>"), // optional + Some("<COMMANDS>"), // optional + Some(vec![appwrite::enums::ProjectKeyScopes::ProjectRead]), // optional + Some("<INSTALLATION_ID>"), // optional + Some("<PROVIDER_REPOSITORY_ID>"), // optional + Some("<PROVIDER_BRANCH>"), // optional + Some(false), // optional + Some("<PROVIDER_ROOT_DIRECTORY>"), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some("s-1vcpu-512mb"), // optional + Some("s-1vcpu-512mb"), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/delete-deployment.md b/examples/2.0.x/server-rust/examples/functions/delete-deployment.md new file mode 100644 index 000000000..2e9ca5661 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/delete-deployment.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + functions.delete_deployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/delete-execution.md b/examples/2.0.x/server-rust/examples/functions/delete-execution.md new file mode 100644 index 000000000..6cc451cca --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/delete-execution.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + functions.delete_execution( + "<FUNCTION_ID>", + "<EXECUTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/delete-variable.md b/examples/2.0.x/server-rust/examples/functions/delete-variable.md new file mode 100644 index 000000000..db03d2537 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/delete-variable.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + functions.delete_variable( + "<FUNCTION_ID>", + "<VARIABLE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/delete.md b/examples/2.0.x/server-rust/examples/functions/delete.md new file mode 100644 index 000000000..55dfb6051 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + functions.delete( + "<FUNCTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/get-deployment-download.md b/examples/2.0.x/server-rust/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..69e5e391e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/get-deployment-download.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.get_deployment_download( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + Some(appwrite::enums::DeploymentDownloadType::Source), // optional + Some("<TOKEN>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/get-deployment.md b/examples/2.0.x/server-rust/examples/functions/get-deployment.md new file mode 100644 index 000000000..0fc911e11 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/get-deployment.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.get_deployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/get-execution.md b/examples/2.0.x/server-rust/examples/functions/get-execution.md new file mode 100644 index 000000000..9b934827a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/get-execution.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let functions = Functions::new(&client); + + let result = functions.get_execution( + "<FUNCTION_ID>", + "<EXECUTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/get-variable.md b/examples/2.0.x/server-rust/examples/functions/get-variable.md new file mode 100644 index 000000000..74bc9c26c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/get-variable.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.get_variable( + "<FUNCTION_ID>", + "<VARIABLE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/get.md b/examples/2.0.x/server-rust/examples/functions/get.md new file mode 100644 index 000000000..b89adba92 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.get( + "<FUNCTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/list-deployments.md b/examples/2.0.x/server-rust/examples/functions/list-deployments.md new file mode 100644 index 000000000..3d8b44538 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/list-deployments.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.list_deployments( + "<FUNCTION_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/list-executions.md b/examples/2.0.x/server-rust/examples/functions/list-executions.md new file mode 100644 index 000000000..87ac99d6b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/list-executions.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let functions = Functions::new(&client); + + let result = functions.list_executions( + "<FUNCTION_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/list-runtimes.md b/examples/2.0.x/server-rust/examples/functions/list-runtimes.md new file mode 100644 index 000000000..abeffc758 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/list-runtimes.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.list_runtimes().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/list-specifications.md b/examples/2.0.x/server-rust/examples/functions/list-specifications.md new file mode 100644 index 000000000..57245ba6d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/list-specifications.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.list_specifications( + Some("runtimes") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/list-variables.md b/examples/2.0.x/server-rust/examples/functions/list-variables.md new file mode 100644 index 000000000..3b149293c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/list-variables.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.list_variables( + "<FUNCTION_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/list.md b/examples/2.0.x/server-rust/examples/functions/list.md new file mode 100644 index 000000000..ef9d71d62 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.list( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/update-deployment-status.md b/examples/2.0.x/server-rust/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..c0964401a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/update-deployment-status.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.update_deployment_status( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/update-function-deployment.md b/examples/2.0.x/server-rust/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..5fd072800 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/update-function-deployment.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.update_function_deployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/update-variable.md b/examples/2.0.x/server-rust/examples/functions/update-variable.md new file mode 100644 index 000000000..0ee9606d9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/update-variable.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.update_variable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", + Some("<KEY>"), // optional + Some("<VALUE>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/functions/update.md b/examples/2.0.x/server-rust/examples/functions/update.md new file mode 100644 index 000000000..16e4ea52a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/functions/update.md @@ -0,0 +1,43 @@ +```rust +use appwrite::Client; +use appwrite::services::Functions; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let functions = Functions::new(&client); + + let result = functions.update( + "<FUNCTION_ID>", + "<NAME>", + Some(appwrite::enums::Runtime::Node145), // optional + Some(vec!["any".into()]), // optional + Some(vec![]), // optional + Some("0 0 * * *"), // optional + Some(1), // optional + Some(false), // optional + Some(false), // optional + Some("<ENTRYPOINT>"), // optional + Some("<COMMANDS>"), // optional + Some(vec![appwrite::enums::ProjectKeyScopes::ProjectRead]), // optional + Some("<INSTALLATION_ID>"), // optional + Some("<PROVIDER_REPOSITORY_ID>"), // optional + Some("<PROVIDER_BRANCH>"), // optional + Some(false), // optional + Some("<PROVIDER_ROOT_DIRECTORY>"), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some("s-1vcpu-512mb"), // optional + Some("s-1vcpu-512mb"), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/graphql/mutation.md b/examples/2.0.x/server-rust/examples/graphql/mutation.md new file mode 100644 index 000000000..559dc2854 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/graphql/mutation.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Graphql; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let graphql = Graphql::new(&client); + + let result = graphql.mutation( + serde_json::json!({}) + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/graphql/query.md b/examples/2.0.x/server-rust/examples/graphql/query.md new file mode 100644 index 000000000..edd210470 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/graphql/query.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Graphql; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let graphql = Graphql::new(&client); + + let result = graphql.query( + serde_json::json!({}) + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/locale/get.md b/examples/2.0.x/server-rust/examples/locale/get.md new file mode 100644 index 000000000..c4665a6c8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/locale/get.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Locale; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let locale = Locale::new(&client); + + let result = locale.get().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/locale/list-codes.md b/examples/2.0.x/server-rust/examples/locale/list-codes.md new file mode 100644 index 000000000..f920bf615 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/locale/list-codes.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Locale; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let locale = Locale::new(&client); + + let result = locale.list_codes().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/locale/list-continents.md b/examples/2.0.x/server-rust/examples/locale/list-continents.md new file mode 100644 index 000000000..b4f8d46ba --- /dev/null +++ b/examples/2.0.x/server-rust/examples/locale/list-continents.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Locale; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let locale = Locale::new(&client); + + let result = locale.list_continents().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/locale/list-countries-eu.md b/examples/2.0.x/server-rust/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..c959aa1ca --- /dev/null +++ b/examples/2.0.x/server-rust/examples/locale/list-countries-eu.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Locale; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let locale = Locale::new(&client); + + let result = locale.list_countries_eu().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/locale/list-countries-phones.md b/examples/2.0.x/server-rust/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..6c0238bfc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/locale/list-countries-phones.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Locale; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let locale = Locale::new(&client); + + let result = locale.list_countries_phones().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/locale/list-countries.md b/examples/2.0.x/server-rust/examples/locale/list-countries.md new file mode 100644 index 000000000..bd8f795e0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/locale/list-countries.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Locale; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let locale = Locale::new(&client); + + let result = locale.list_countries().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/locale/list-currencies.md b/examples/2.0.x/server-rust/examples/locale/list-currencies.md new file mode 100644 index 000000000..b382da677 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/locale/list-currencies.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Locale; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let locale = Locale::new(&client); + + let result = locale.list_currencies().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/locale/list-languages.md b/examples/2.0.x/server-rust/examples/locale/list-languages.md new file mode 100644 index 000000000..fb7c78a53 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/locale/list-languages.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Locale; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let locale = Locale::new(&client); + + let result = locale.list_languages().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..d20edfadd --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-apns-provider.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_apns_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("<AUTH_KEY>"), // optional + Some("<AUTH_KEY_ID>"), // optional + Some("<TEAM_ID>"), // optional + Some("<BUNDLE_ID>"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-email.md b/examples/2.0.x/server-rust/examples/messaging/create-email.md new file mode 100644 index 000000000..74ffddcc4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-email.md @@ -0,0 +1,33 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_email( + "<MESSAGE_ID>", + "<SUBJECT>", + "<CONTENT>", + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some(false), // optional + Some(false), // optional + Some("2020-10-15T06:38:00.000+00:00") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..3b62c549a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-fcm-provider.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_fcm_provider( + "<PROVIDER_ID>", + "<NAME>", + Some(serde_json::json!({})), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..ecc599cac --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_mailgun_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("<API_KEY>"), // optional + Some("example.com"), // optional + Some(false), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("email@example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..1a1484599 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_msg91_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("<TEMPLATE_ID>"), // optional + Some("<SENDER_ID>"), // optional + Some("<AUTH_KEY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-push.md b/examples/2.0.x/server-rust/examples/messaging/create-push.md new file mode 100644 index 000000000..7f93d6bff --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-push.md @@ -0,0 +1,40 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_push( + "<MESSAGE_ID>", + Some("<TITLE>"), // optional + Some("<BODY>"), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some(serde_json::json!({})), // optional + Some("<ACTION>"), // optional + Some("<ID1:ID2>"), // optional + Some("<ICON>"), // optional + Some("<SOUND>"), // optional + Some("<COLOR>"), // optional + Some("<TAG>"), // optional + Some(1), // optional + Some(false), // optional + Some("2020-10-15T06:38:00.000+00:00"), // optional + Some(false), // optional + Some(false), // optional + Some(appwrite::enums::MessagePriority::Normal) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..0632c50cf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-resend-provider.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_resend_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("<API_KEY>"), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("email@example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..93fc064b4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_sendgrid_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("<API_KEY>"), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("email@example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..f5d8344c5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-ses-provider.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_ses_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("<ACCESS_KEY>"), // optional + Some("<SECRET_KEY>"), // optional + Some("<REGION>"), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("email@example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-sms.md b/examples/2.0.x/server-rust/examples/messaging/create-sms.md new file mode 100644 index 000000000..f190adc8c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-sms.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_sms( + "<MESSAGE_ID>", + "<CONTENT>", + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some(false), // optional + Some("2020-10-15T06:38:00.000+00:00") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..f6ee6a1be --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-smtp-provider.md @@ -0,0 +1,35 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_smtp_provider( + "<PROVIDER_ID>", + "<NAME>", + "<HOST>", + Some(587), // optional + Some("<USERNAME>"), // optional + Some("password"), // optional + Some(appwrite::enums::SmtpEncryption::None), // optional + Some(false), // optional + Some("<MAILER>"), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("email@example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-subscriber.md b/examples/2.0.x/server-rust/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..064875dc5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-subscriber.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_jwt("<YOUR_JWT>"); // Your secret JSON Web Token + + let messaging = Messaging::new(&client); + + let result = messaging.create_subscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>", + "<TARGET_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..88860228a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-telesign-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_telesign_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("+12065550100"), // optional + Some("<CUSTOMER_ID>"), // optional + Some("<API_KEY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..d6a7b1378 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_textmagic_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("+12065550100"), // optional + Some("<USERNAME>"), // optional + Some("<API_KEY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-topic.md b/examples/2.0.x/server-rust/examples/messaging/create-topic.md new file mode 100644 index 000000000..9b2108f6e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-topic.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_topic( + "<TOPIC_ID>", + "<NAME>", + Some(vec!["any".into()]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..2a28b8308 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-twilio-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_twilio_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("+12065550100"), // optional + Some("<ACCOUNT_SID>"), // optional + Some("<AUTH_TOKEN>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-rust/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..6e35af111 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/create-vonage-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.create_vonage_provider( + "<PROVIDER_ID>", + "<NAME>", + Some("+12065550100"), // optional + Some("<API_KEY>"), // optional + Some("<API_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/delete-provider.md b/examples/2.0.x/server-rust/examples/messaging/delete-provider.md new file mode 100644 index 000000000..9c6d65d0f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/delete-provider.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + messaging.delete_provider( + "<PROVIDER_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-rust/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..faf142559 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/delete-subscriber.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_jwt("<YOUR_JWT>"); // Your secret JSON Web Token + + let messaging = Messaging::new(&client); + + messaging.delete_subscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/delete-topic.md b/examples/2.0.x/server-rust/examples/messaging/delete-topic.md new file mode 100644 index 000000000..e9384ce92 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/delete-topic.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + messaging.delete_topic( + "<TOPIC_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/delete.md b/examples/2.0.x/server-rust/examples/messaging/delete.md new file mode 100644 index 000000000..45530838a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + messaging.delete( + "<MESSAGE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/get-message.md b/examples/2.0.x/server-rust/examples/messaging/get-message.md new file mode 100644 index 000000000..c73f09070 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/get-message.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.get_message( + "<MESSAGE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/get-provider.md b/examples/2.0.x/server-rust/examples/messaging/get-provider.md new file mode 100644 index 000000000..be30b3a79 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/get-provider.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.get_provider( + "<PROVIDER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/get-subscriber.md b/examples/2.0.x/server-rust/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..5bd199452 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/get-subscriber.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.get_subscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/get-topic.md b/examples/2.0.x/server-rust/examples/messaging/get-topic.md new file mode 100644 index 000000000..bf3cdfff1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/get-topic.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.get_topic( + "<TOPIC_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/list-messages.md b/examples/2.0.x/server-rust/examples/messaging/list-messages.md new file mode 100644 index 000000000..2a8b10cb4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/list-messages.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.list_messages( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/list-providers.md b/examples/2.0.x/server-rust/examples/messaging/list-providers.md new file mode 100644 index 000000000..d49e39756 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/list-providers.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.list_providers( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/list-subscribers.md b/examples/2.0.x/server-rust/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..7bea96f97 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/list-subscribers.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.list_subscribers( + "<TOPIC_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/list-targets.md b/examples/2.0.x/server-rust/examples/messaging/list-targets.md new file mode 100644 index 000000000..c1c8ef44b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/list-targets.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.list_targets( + "<MESSAGE_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/list-topics.md b/examples/2.0.x/server-rust/examples/messaging/list-topics.md new file mode 100644 index 000000000..ec0d15aee --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/list-topics.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.list_topics( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..c6b5c9bee --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-apns-provider.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_apns_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<AUTH_KEY>"), // optional + Some("<AUTH_KEY_ID>"), // optional + Some("<TEAM_ID>"), // optional + Some("<BUNDLE_ID>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-email.md b/examples/2.0.x/server-rust/examples/messaging/update-email.md new file mode 100644 index 000000000..0728e91c2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-email.md @@ -0,0 +1,33 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_email( + "<MESSAGE_ID>", + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some("<SUBJECT>"), // optional + Some("<CONTENT>"), // optional + Some(false), // optional + Some(false), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some("2020-10-15T06:38:00.000+00:00"), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..6739579a6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-fcm-provider.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_fcm_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some(serde_json::json!({})) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..60a710b60 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_mailgun_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some("<API_KEY>"), // optional + Some("example.com"), // optional + Some(false), // optional + Some(false), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("<REPLY_TO_EMAIL>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..64b167b2d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_msg91_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<TEMPLATE_ID>"), // optional + Some("<SENDER_ID>"), // optional + Some("<AUTH_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-push.md b/examples/2.0.x/server-rust/examples/messaging/update-push.md new file mode 100644 index 000000000..00fdc77c0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-push.md @@ -0,0 +1,40 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_push( + "<MESSAGE_ID>", + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some("<TITLE>"), // optional + Some("<BODY>"), // optional + Some(serde_json::json!({})), // optional + Some("<ACTION>"), // optional + Some("<ID1:ID2>"), // optional + Some("<ICON>"), // optional + Some("<SOUND>"), // optional + Some("<COLOR>"), // optional + Some("<TAG>"), // optional + Some(1), // optional + Some(false), // optional + Some("2020-10-15T06:38:00.000+00:00"), // optional + Some(false), // optional + Some(false), // optional + Some(appwrite::enums::MessagePriority::Normal) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..28f63a6b4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-resend-provider.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_resend_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<API_KEY>"), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("<REPLY_TO_EMAIL>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..89be552df --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_sendgrid_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<API_KEY>"), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("<REPLY_TO_EMAIL>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..c7b44d097 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-ses-provider.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_ses_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<ACCESS_KEY>"), // optional + Some("<SECRET_KEY>"), // optional + Some("<REGION>"), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("<REPLY_TO_EMAIL>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-sms.md b/examples/2.0.x/server-rust/examples/messaging/update-sms.md new file mode 100644 index 000000000..ede80793e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-sms.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_sms( + "<MESSAGE_ID>", + Some(vec![]), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some("<CONTENT>"), // optional + Some(false), // optional + Some("2020-10-15T06:38:00.000+00:00") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..0790c9db1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-smtp-provider.md @@ -0,0 +1,35 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_smtp_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some("<HOST>"), // optional + Some(1), // optional + Some("<USERNAME>"), // optional + Some("password"), // optional + Some(appwrite::enums::SmtpEncryption::None), // optional + Some(false), // optional + Some("<MAILER>"), // optional + Some("<FROM_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some("<REPLY_TO_EMAIL>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..6aafea8f9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-telesign-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_telesign_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<CUSTOMER_ID>"), // optional + Some("<API_KEY>"), // optional + Some("<FROM>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..d5ff9add7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_textmagic_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<USERNAME>"), // optional + Some("<API_KEY>"), // optional + Some("<FROM>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-topic.md b/examples/2.0.x/server-rust/examples/messaging/update-topic.md new file mode 100644 index 000000000..9f112ffbe --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-topic.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_topic( + "<TOPIC_ID>", + Some("<NAME>"), // optional + Some(vec!["any".into()]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..a9c7778d7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-twilio-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_twilio_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<ACCOUNT_SID>"), // optional + Some("<AUTH_TOKEN>"), // optional + Some("<FROM>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-rust/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..4ca9b38a5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/messaging/update-vonage-provider.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Messaging; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let messaging = Messaging::new(&client); + + let result = messaging.update_vonage_provider( + "<PROVIDER_ID>", + Some("<NAME>"), // optional + Some(false), // optional + Some("<API_KEY>"), // optional + Some("<API_SECRET>"), // optional + Some("<FROM>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/organization/create-project.md b/examples/2.0.x/server-rust/examples/organization/create-project.md new file mode 100644 index 000000000..fa3f8040f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/organization/create-project.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Organization; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let organization = Organization::new(&client); + + let result = organization.create_project( + "<PROJECT_ID>", + "<NAME>", + Some(appwrite::enums::Region::Default) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/organization/delete-project.md b/examples/2.0.x/server-rust/examples/organization/delete-project.md new file mode 100644 index 000000000..8e8c9379a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/organization/delete-project.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Organization; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let organization = Organization::new(&client); + + organization.delete_project( + "<PROJECT_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/organization/get-project.md b/examples/2.0.x/server-rust/examples/organization/get-project.md new file mode 100644 index 000000000..3c1df1ef0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/organization/get-project.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Organization; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let organization = Organization::new(&client); + + let result = organization.get_project( + "<PROJECT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/organization/list-projects.md b/examples/2.0.x/server-rust/examples/organization/list-projects.md new file mode 100644 index 000000000..13591a033 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/organization/list-projects.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Organization; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let organization = Organization::new(&client); + + let result = organization.list_projects( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/organization/update-project.md b/examples/2.0.x/server-rust/examples/organization/update-project.md new file mode 100644 index 000000000..036ecccb8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/organization/update-project.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Organization; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let organization = Organization::new(&client); + + let result = organization.update_project( + "<PROJECT_ID>", + "<NAME>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/presences/delete.md b/examples/2.0.x/server-rust/examples/presences/delete.md new file mode 100644 index 000000000..6802abd1f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/presences/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Presences; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let presences = Presences::new(&client); + + presences.delete( + "<PRESENCE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/presences/get.md b/examples/2.0.x/server-rust/examples/presences/get.md new file mode 100644 index 000000000..5bba380a3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/presences/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Presences; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let presences = Presences::new(&client); + + let result = presences.get( + "<PRESENCE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/presences/list.md b/examples/2.0.x/server-rust/examples/presences/list.md new file mode 100644 index 000000000..413209655 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/presences/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Presences; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let presences = Presences::new(&client); + + let result = presences.list( + Some(vec![]), // optional + Some(false), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/presences/update.md b/examples/2.0.x/server-rust/examples/presences/update.md new file mode 100644 index 000000000..479bf78be --- /dev/null +++ b/examples/2.0.x/server-rust/examples/presences/update.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::Presences; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let presences = Presences::new(&client); + + let result = presences.update( + "<PRESENCE_ID>", + "<USER_ID>", + Some("<STATUS>"), // optional + Some("2020-10-15T06:38:00.000+00:00"), // optional + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/presences/upsert.md b/examples/2.0.x/server-rust/examples/presences/upsert.md new file mode 100644 index 000000000..e1d5745f4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/presences/upsert.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Presences; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let presences = Presences::new(&client); + + let result = presences.upsert( + "<PRESENCE_ID>", + "<USER_ID>", + "<STATUS>", + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("2020-10-15T06:38:00.000+00:00"), // optional + Some(serde_json::json!({})) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-android-platform.md b/examples/2.0.x/server-rust/examples/project/create-android-platform.md new file mode 100644 index 000000000..98c013fe2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-android-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.create_android_platform( + "<PLATFORM_ID>", + "<NAME>", + "<APPLICATION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-apple-platform.md b/examples/2.0.x/server-rust/examples/project/create-apple-platform.md new file mode 100644 index 000000000..5c7f0c8aa --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-apple-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.create_apple_platform( + "<PLATFORM_ID>", + "<NAME>", + "<BUNDLE_IDENTIFIER>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-rust/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..93d1dc4a1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-ephemeral-key.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.create_ephemeral_key( + vec![appwrite::enums::ProjectKeyScopes::ProjectRead], + 600 + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-linux-platform.md b/examples/2.0.x/server-rust/examples/project/create-linux-platform.md new file mode 100644 index 000000000..be6274afe --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-linux-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.create_linux_platform( + "<PLATFORM_ID>", + "<NAME>", + "<PACKAGE_NAME>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-mock-phone.md b/examples/2.0.x/server-rust/examples/project/create-mock-phone.md new file mode 100644 index 000000000..f867b96f6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-mock-phone.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.create_mock_phone( + "+12065550100", + "<OTP>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-smtp-test.md b/examples/2.0.x/server-rust/examples/project/create-smtp-test.md new file mode 100644 index 000000000..cb5f2ceda --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-smtp-test.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + project.create_smtp_test( + vec![] + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-variable.md b/examples/2.0.x/server-rust/examples/project/create-variable.md new file mode 100644 index 000000000..39356ece3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-variable.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.create_variable( + "<VARIABLE_ID>", + "<KEY>", + "<VALUE>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-web-platform.md b/examples/2.0.x/server-rust/examples/project/create-web-platform.md new file mode 100644 index 000000000..07e13a747 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-web-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.create_web_platform( + "<PLATFORM_ID>", + "<NAME>", + "app.example.com" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/create-windows-platform.md b/examples/2.0.x/server-rust/examples/project/create-windows-platform.md new file mode 100644 index 000000000..0921cf898 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/create-windows-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.create_windows_platform( + "<PLATFORM_ID>", + "<NAME>", + "<PACKAGE_IDENTIFIER_NAME>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/delete-key.md b/examples/2.0.x/server-rust/examples/project/delete-key.md new file mode 100644 index 000000000..e0ff21281 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/delete-key.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + project.delete_key( + "<KEY_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/delete-mock-phone.md b/examples/2.0.x/server-rust/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..f3b8744be --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/delete-mock-phone.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + project.delete_mock_phone( + "+12065550100" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/delete-platform.md b/examples/2.0.x/server-rust/examples/project/delete-platform.md new file mode 100644 index 000000000..335ab49e5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/delete-platform.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + project.delete_platform( + "<PLATFORM_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/delete-variable.md b/examples/2.0.x/server-rust/examples/project/delete-variable.md new file mode 100644 index 000000000..dc79ce977 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/delete-variable.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + project.delete_variable( + "<VARIABLE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/delete.md b/examples/2.0.x/server-rust/examples/project/delete.md new file mode 100644 index 000000000..aef1dcf76 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/delete.md @@ -0,0 +1,18 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + project.delete().await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/get-email-template.md b/examples/2.0.x/server-rust/examples/project/get-email-template.md new file mode 100644 index 000000000..b163f0f41 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/get-email-template.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.get_email_template( + appwrite::enums::ProjectEmailTemplateId::Verification, + Some(appwrite::enums::ProjectEmailTemplateLocale::Af) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/get-key.md b/examples/2.0.x/server-rust/examples/project/get-key.md new file mode 100644 index 000000000..61d58e894 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/get-key.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.get_key( + "<KEY_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/get-mock-phone.md b/examples/2.0.x/server-rust/examples/project/get-mock-phone.md new file mode 100644 index 000000000..1c44f0729 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/get-mock-phone.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.get_mock_phone( + "+12065550100" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-rust/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..ea5dd53bc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.get_o_auth2_provider( + appwrite::enums::ProjectOAuthProviderId::Amazon + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/get-platform.md b/examples/2.0.x/server-rust/examples/project/get-platform.md new file mode 100644 index 000000000..559fb7309 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/get-platform.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.get_platform( + "<PLATFORM_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/get-policy.md b/examples/2.0.x/server-rust/examples/project/get-policy.md new file mode 100644 index 000000000..53781fb9b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/get-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.get_policy( + appwrite::enums::ProjectPolicyId::PasswordDictionary + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/get-variable.md b/examples/2.0.x/server-rust/examples/project/get-variable.md new file mode 100644 index 000000000..b86d29f2a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/get-variable.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.get_variable( + "<VARIABLE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/get.md b/examples/2.0.x/server-rust/examples/project/get.md new file mode 100644 index 000000000..5c249b48e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/get.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.get().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/list-email-templates.md b/examples/2.0.x/server-rust/examples/project/list-email-templates.md new file mode 100644 index 000000000..edbaf99f8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/list-email-templates.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.list_email_templates( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/list-keys.md b/examples/2.0.x/server-rust/examples/project/list-keys.md new file mode 100644 index 000000000..9d8031704 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/list-keys.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.list_keys( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/list-mock-phones.md b/examples/2.0.x/server-rust/examples/project/list-mock-phones.md new file mode 100644 index 000000000..4057971d9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/list-mock-phones.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.list_mock_phones( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-rust/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..e2bc1c7e6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.list_o_auth2_providers( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/list-platforms.md b/examples/2.0.x/server-rust/examples/project/list-platforms.md new file mode 100644 index 000000000..effb3c377 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/list-platforms.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.list_platforms( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/list-policies.md b/examples/2.0.x/server-rust/examples/project/list-policies.md new file mode 100644 index 000000000..3abb2ab69 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/list-policies.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.list_policies( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/list-variables.md b/examples/2.0.x/server-rust/examples/project/list-variables.md new file mode 100644 index 000000000..75c3b61f5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/list-variables.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.list_variables( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-android-platform.md b/examples/2.0.x/server-rust/examples/project/update-android-platform.md new file mode 100644 index 000000000..4240a36d0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-android-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_android_platform( + "<PLATFORM_ID>", + "<NAME>", + "<APPLICATION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-apple-platform.md b/examples/2.0.x/server-rust/examples/project/update-apple-platform.md new file mode 100644 index 000000000..9034653b9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-apple-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_apple_platform( + "<PLATFORM_ID>", + "<NAME>", + "<BUNDLE_IDENTIFIER>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-auth-method.md b/examples/2.0.x/server-rust/examples/project/update-auth-method.md new file mode 100644 index 000000000..7b8bd77ba --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-auth-method.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_auth_method( + appwrite::enums::ProjectAuthMethodId::EmailPassword, + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-email-template.md b/examples/2.0.x/server-rust/examples/project/update-email-template.md new file mode 100644 index 000000000..4ec7ce96e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-email-template.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_email_template( + appwrite::enums::ProjectEmailTemplateId::Verification, + Some(appwrite::enums::ProjectEmailTemplateLocale::Af), // optional + Some("<SUBJECT>"), // optional + Some("<MESSAGE>"), // optional + Some("<SENDER_NAME>"), // optional + Some("email@example.com"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-key.md b/examples/2.0.x/server-rust/examples/project/update-key.md new file mode 100644 index 000000000..12b0282ab --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-key.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_key( + "<KEY_ID>", + "<NAME>", + vec![appwrite::enums::ProjectKeyScopes::ProjectRead], + Some("2020-10-15T06:38:00.000+00:00") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-labels.md b/examples/2.0.x/server-rust/examples/project/update-labels.md new file mode 100644 index 000000000..541993e9a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-labels.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_labels( + vec![] + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-linux-platform.md b/examples/2.0.x/server-rust/examples/project/update-linux-platform.md new file mode 100644 index 000000000..4d0c98353 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-linux-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_linux_platform( + "<PLATFORM_ID>", + "<NAME>", + "<PACKAGE_NAME>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-rust/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..42f9faec8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_membership_privacy_policy( + Some(false), // optional + Some(false), // optional + Some(false), // optional + Some(false), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-rust/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..c8613f0a1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_mfa_factors_policy( + Some(false), // optional + Some(false), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-mock-phone.md b/examples/2.0.x/server-rust/examples/project/update-mock-phone.md new file mode 100644 index 000000000..cd55b55b3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-mock-phone.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_mock_phone( + "+12065550100", + "<OTP>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..4c02d8b5d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_amazon( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..428de09e8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_apple( + Some("<SERVICE_ID>"), // optional + Some("<KEY_ID>"), // optional + Some("<TEAM_ID>"), // optional + Some("<P8_FILE>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..0ed17eb65 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_appwrite( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..811a8c8fc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_auth0( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some("<ENDPOINT>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..a4566e112 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_authentik( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some("<ENDPOINT>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..62ad0944c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_autodesk( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..30791180a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_bitbucket( + Some("<KEY>"), // optional + Some("<SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..212d49fb2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_bitly( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..3a463f299 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-box.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_box( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..52f74a114 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_cloudflare( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..e46a0f18f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_dailymotion( + Some("<API_KEY>"), // optional + Some("<API_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..783c9b8ab --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_discord( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..4476bf26e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_disqus( + Some("<PUBLIC_KEY>"), // optional + Some("<SECRET_KEY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..49458db76 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_dropbox( + Some("<APP_KEY>"), // optional + Some("<APP_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..09ab588e5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_etsy( + Some("<KEY_STRING>"), // optional + Some("<SHARED_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..424cdff2a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_facebook( + Some("<APP_ID>"), // optional + Some("<APP_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..5f5a34916 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_figma( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..e1a73144c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_fusion_auth( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some("<ENDPOINT>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..be26e71dd --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_git_hub( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..23fab7e4e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_gitlab( + Some("<APPLICATION_ID>"), // optional + Some("<SECRET>"), // optional + Some("https://example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..2a96b7b4f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-google.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_google( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(vec![appwrite::enums::ProjectOAuth2GooglePrompt::None]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..275e2d972 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_hugging_face( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..89ae292af --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_keycloak( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some("<ENDPOINT>"), // optional + Some("<REALM_NAME>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..56aedb478 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_kick( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..8f864a3f0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_linkedin( + Some("<CLIENT_ID>"), // optional + Some("<PRIMARY_CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..f32216e4b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_microsoft( + Some("<APPLICATION_ID>"), // optional + Some("<APPLICATION_SECRET>"), // optional + Some("<TENANT>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..84642ef72 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_notion( + Some("<OAUTH_CLIENT_ID>"), // optional + Some("<OAUTH_CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..bc607cea4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_oidc( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some("https://example.com"), // optional + Some("https://example.com"), // optional + Some("https://example.com"), // optional + Some("https://example.com"), // optional + Some(vec![appwrite::enums::ProjectOAuth2OidcPrompt::None]), // optional + Some(0), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..527310412 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_okta( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some("example.com"), // optional + Some("<AUTHORIZATION_SERVER_ID>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..a260d7d9e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_paypal_sandbox( + Some("<CLIENT_ID>"), // optional + Some("<SECRET_KEY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..8a296877a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_paypal( + Some("<CLIENT_ID>"), // optional + Some("<SECRET_KEY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..141c517ba --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_podio( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..5a9e36f72 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_resend( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..dd41c0a9b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_salesforce( + Some("<CUSTOMER_KEY>"), // optional + Some("<CUSTOMER_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..60fa98300 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_slack( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..ac7af69db --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_spotify( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..993f2164c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_stripe( + Some("<CLIENT_ID>"), // optional + Some("<API_SECRET_KEY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..5804af8fa --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_tradeshift_sandbox( + Some("<OAUTH2_CLIENT_ID>"), // optional + Some("<OAUTH2_CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..37bc1145f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_tradeshift( + Some("<OAUTH2_CLIENT_ID>"), // optional + Some("<OAUTH2_CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..e238d7630 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_twitch( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..808c156a6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_word_press( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..c75ae753a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_yahoo( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..b5b82d3a1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_yandex( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..62ac858e2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_zoho( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..225ed8773 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_zoom( + Some("<CLIENT_ID>"), // optional + Some("<CLIENT_SECRET>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-rust/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..b8c02abdf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-o-auth-2x.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_o_auth2_x( + Some("<CUSTOMER_KEY>"), // optional + Some("<SECRET_KEY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-rust/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..2c01878a8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_password_dictionary_policy( + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-password-history-policy.md b/examples/2.0.x/server-rust/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..1b884806d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-password-history-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_password_history_policy( + Some(1) + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-rust/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..fc0cb39b2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_password_personal_data_policy( + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-rust/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..dc1b12806 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-password-strength-policy.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_password_strength_policy( + Some(8), // optional + Some(false), // optional + Some(false), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-protocol.md b/examples/2.0.x/server-rust/examples/project/update-protocol.md new file mode 100644 index 000000000..935b832e3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-protocol.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_protocol( + appwrite::enums::ProjectProtocolId::Rest, + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-service.md b/examples/2.0.x/server-rust/examples/project/update-service.md new file mode 100644 index 000000000..3e69a585b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-service.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_service( + appwrite::enums::ProjectServiceId::Account, + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-rust/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..cd67b887f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-session-alert-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_session_alert_policy( + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-rust/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..6a92c036c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-session-duration-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_session_duration_policy( + 60 + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-rust/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..8c275b30d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_session_invalidation_policy( + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-rust/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..fd958cf0a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-session-limit-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_session_limit_policy( + 1 + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-smtp.md b/examples/2.0.x/server-rust/examples/project/update-smtp.md new file mode 100644 index 000000000..d4fa577e1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-smtp.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_smtp( + Some("example.com"), // optional + Some(587), // optional + Some("<USERNAME>"), // optional + Some("password"), // optional + Some("email@example.com"), // optional + Some("<SENDER_NAME>"), // optional + Some("email@example.com"), // optional + Some("<REPLY_TO_NAME>"), // optional + Some(appwrite::enums::ProjectSMTPSecure::Tls), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-rust/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..b2b0419c7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-user-limit-policy.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_user_limit_policy( + Some(0) + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-variable.md b/examples/2.0.x/server-rust/examples/project/update-variable.md new file mode 100644 index 000000000..21b4eac31 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-variable.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_variable( + "<VARIABLE_ID>", + Some("<KEY>"), // optional + Some("<VALUE>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-web-platform.md b/examples/2.0.x/server-rust/examples/project/update-web-platform.md new file mode 100644 index 000000000..f5d44ea82 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-web-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_web_platform( + "<PLATFORM_ID>", + "<NAME>", + "app.example.com" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/project/update-windows-platform.md b/examples/2.0.x/server-rust/examples/project/update-windows-platform.md new file mode 100644 index 000000000..ea73c85e4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/project/update-windows-platform.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Project; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let project = Project::new(&client); + + let result = project.update_windows_platform( + "<PLATFORM_ID>", + "<NAME>", + "<PACKAGE_IDENTIFIER_NAME>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/proxy/create-api-rule.md b/examples/2.0.x/server-rust/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..50d03218f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/proxy/create-api-rule.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Proxy; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let proxy = Proxy::new(&client); + + let result = proxy.create_api_rule( + "example.com" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/proxy/create-function-rule.md b/examples/2.0.x/server-rust/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..c2ef9ce16 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/proxy/create-function-rule.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Proxy; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let proxy = Proxy::new(&client); + + let result = proxy.create_function_rule( + "example.com", + "<FUNCTION_ID>", + Some("<BRANCH>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-rust/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..bb5a8a728 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/proxy/create-redirect-rule.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Proxy; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let proxy = Proxy::new(&client); + + let result = proxy.create_redirect_rule( + "example.com", + "https://example.com", + appwrite::enums::StatusCode::MovedPermanently, + "<RESOURCE_ID>", + appwrite::enums::ProxyResourceType::Site + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/proxy/create-site-rule.md b/examples/2.0.x/server-rust/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..7c1483868 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/proxy/create-site-rule.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Proxy; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let proxy = Proxy::new(&client); + + let result = proxy.create_site_rule( + "example.com", + "<SITE_ID>", + Some("<BRANCH>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/proxy/delete-rule.md b/examples/2.0.x/server-rust/examples/proxy/delete-rule.md new file mode 100644 index 000000000..485df0252 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/proxy/delete-rule.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Proxy; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let proxy = Proxy::new(&client); + + proxy.delete_rule( + "<RULE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/proxy/get-rule.md b/examples/2.0.x/server-rust/examples/proxy/get-rule.md new file mode 100644 index 000000000..4609619af --- /dev/null +++ b/examples/2.0.x/server-rust/examples/proxy/get-rule.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Proxy; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let proxy = Proxy::new(&client); + + let result = proxy.get_rule( + "<RULE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/proxy/list-rules.md b/examples/2.0.x/server-rust/examples/proxy/list-rules.md new file mode 100644 index 000000000..400963fdf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/proxy/list-rules.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Proxy; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let proxy = Proxy::new(&client); + + let result = proxy.list_rules( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/proxy/update-rule-status.md b/examples/2.0.x/server-rust/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..0651b48bf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/proxy/update-rule-status.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Proxy; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let proxy = Proxy::new(&client); + + let result = proxy.update_rule_status( + "<RULE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/create-deployment.md b/examples/2.0.x/server-rust/examples/sites/create-deployment.md new file mode 100644 index 000000000..9bec31f56 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/create-deployment.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; +use appwrite::InputFile; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let code = InputFile::from_path("path/to/file.png", None).await?; + + let result = sites.create_deployment( + "<SITE_ID>", + code, + Some("<INSTALL_COMMAND>"), // optional + Some("<BUILD_COMMAND>"), // optional + Some("<OUTPUT_DIRECTORY>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-rust/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..802e36359 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.create_duplicate_deployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/create-template-deployment.md b/examples/2.0.x/server-rust/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..b5f1716de --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/create-template-deployment.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.create_template_deployment( + "<SITE_ID>", + "<REPOSITORY>", + "<OWNER>", + "<ROOT_DIRECTORY>", + appwrite::enums::TemplateReferenceType::Branch, + "<REFERENCE>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/create-variable.md b/examples/2.0.x/server-rust/examples/sites/create-variable.md new file mode 100644 index 000000000..873c562a0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/create-variable.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.create_variable( + "<SITE_ID>", + "<VARIABLE_ID>", + "<KEY>", + "<VALUE>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-rust/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..9032a437e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/create-vcs-deployment.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.create_vcs_deployment( + "<SITE_ID>", + appwrite::enums::VCSReferenceType::Branch, + "<REFERENCE>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/create.md b/examples/2.0.x/server-rust/examples/sites/create.md new file mode 100644 index 000000000..5f4c33476 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/create.md @@ -0,0 +1,45 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.create( + "<SITE_ID>", + "<NAME>", + appwrite::enums::Framework::Analog, + appwrite::enums::BuildRuntime::Node145, + Some(false), // optional + Some(false), // optional + Some(1), // optional + Some("<INSTALL_COMMAND>"), // optional + Some("<BUILD_COMMAND>"), // optional + Some("<START_COMMAND>"), // optional + Some("<OUTPUT_DIRECTORY>"), // optional + Some(appwrite::enums::Adapter::Static), // optional + Some("<INSTALLATION_ID>"), // optional + Some("<FALLBACK_FILE>"), // optional + Some("<PROVIDER_REPOSITORY_ID>"), // optional + Some("<PROVIDER_BRANCH>"), // optional + Some(false), // optional + Some("<PROVIDER_ROOT_DIRECTORY>"), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some("s-1vcpu-512mb"), // optional + Some("s-1vcpu-512mb"), // optional + Some(0), // optional + Some(vec![appwrite::enums::ProjectKeyScopes::ProjectRead]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/delete-deployment.md b/examples/2.0.x/server-rust/examples/sites/delete-deployment.md new file mode 100644 index 000000000..6b3e01a2e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/delete-deployment.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + sites.delete_deployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/delete-log.md b/examples/2.0.x/server-rust/examples/sites/delete-log.md new file mode 100644 index 000000000..7e5d91586 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/delete-log.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.delete_log( + "<SITE_ID>", + "<LOG_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/delete-variable.md b/examples/2.0.x/server-rust/examples/sites/delete-variable.md new file mode 100644 index 000000000..83e2e545d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/delete-variable.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + sites.delete_variable( + "<SITE_ID>", + "<VARIABLE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/delete.md b/examples/2.0.x/server-rust/examples/sites/delete.md new file mode 100644 index 000000000..f39237603 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + sites.delete( + "<SITE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/get-deployment-download.md b/examples/2.0.x/server-rust/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..925c03507 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/get-deployment-download.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.get_deployment_download( + "<SITE_ID>", + "<DEPLOYMENT_ID>", + Some(appwrite::enums::DeploymentDownloadType::Source), // optional + Some("<TOKEN>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/get-deployment.md b/examples/2.0.x/server-rust/examples/sites/get-deployment.md new file mode 100644 index 000000000..5b258c78f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/get-deployment.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.get_deployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/get-log.md b/examples/2.0.x/server-rust/examples/sites/get-log.md new file mode 100644 index 000000000..6cfff4f98 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/get-log.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.get_log( + "<SITE_ID>", + "<LOG_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/get-variable.md b/examples/2.0.x/server-rust/examples/sites/get-variable.md new file mode 100644 index 000000000..6fa109bf4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/get-variable.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.get_variable( + "<SITE_ID>", + "<VARIABLE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/get.md b/examples/2.0.x/server-rust/examples/sites/get.md new file mode 100644 index 000000000..ec7cbb815 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.get( + "<SITE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/list-deployments.md b/examples/2.0.x/server-rust/examples/sites/list-deployments.md new file mode 100644 index 000000000..712b53e12 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/list-deployments.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.list_deployments( + "<SITE_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/list-frameworks.md b/examples/2.0.x/server-rust/examples/sites/list-frameworks.md new file mode 100644 index 000000000..1252124c9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/list-frameworks.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.list_frameworks().await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/list-logs.md b/examples/2.0.x/server-rust/examples/sites/list-logs.md new file mode 100644 index 000000000..8ff3b46d5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/list-logs.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.list_logs( + "<SITE_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/list-specifications.md b/examples/2.0.x/server-rust/examples/sites/list-specifications.md new file mode 100644 index 000000000..4736fb7ca --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/list-specifications.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.list_specifications( + Some("runtimes") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/list-variables.md b/examples/2.0.x/server-rust/examples/sites/list-variables.md new file mode 100644 index 000000000..5bc1c9b16 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/list-variables.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.list_variables( + "<SITE_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/list.md b/examples/2.0.x/server-rust/examples/sites/list.md new file mode 100644 index 000000000..e98928c78 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.list( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/update-deployment-status.md b/examples/2.0.x/server-rust/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..bae9438fc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/update-deployment-status.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.update_deployment_status( + "<SITE_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/update-site-deployment.md b/examples/2.0.x/server-rust/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..9fef04f88 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/update-site-deployment.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.update_site_deployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/update-variable.md b/examples/2.0.x/server-rust/examples/sites/update-variable.md new file mode 100644 index 000000000..9ecbfd8b7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/update-variable.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.update_variable( + "<SITE_ID>", + "<VARIABLE_ID>", + Some("<KEY>"), // optional + Some("<VALUE>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/sites/update.md b/examples/2.0.x/server-rust/examples/sites/update.md new file mode 100644 index 000000000..24eaea17f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/sites/update.md @@ -0,0 +1,45 @@ +```rust +use appwrite::Client; +use appwrite::services::Sites; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let sites = Sites::new(&client); + + let result = sites.update( + "<SITE_ID>", + "<NAME>", + appwrite::enums::Framework::Analog, + Some(false), // optional + Some(false), // optional + Some(1), // optional + Some("<INSTALL_COMMAND>"), // optional + Some("<BUILD_COMMAND>"), // optional + Some("<START_COMMAND>"), // optional + Some("<OUTPUT_DIRECTORY>"), // optional + Some(appwrite::enums::BuildRuntime::Node145), // optional + Some(appwrite::enums::Adapter::Static), // optional + Some("<FALLBACK_FILE>"), // optional + Some("<INSTALLATION_ID>"), // optional + Some("<PROVIDER_REPOSITORY_ID>"), // optional + Some("<PROVIDER_BRANCH>"), // optional + Some(false), // optional + Some("<PROVIDER_ROOT_DIRECTORY>"), // optional + Some(vec![]), // optional + Some(vec![]), // optional + Some("s-1vcpu-512mb"), // optional + Some("s-1vcpu-512mb"), // optional + Some(0), // optional + Some(vec![appwrite::enums::ProjectKeyScopes::ProjectRead]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/create-bucket.md b/examples/2.0.x/server-rust/examples/storage/create-bucket.md new file mode 100644 index 000000000..939e4b517 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/create-bucket.md @@ -0,0 +1,34 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let storage = Storage::new(&client); + + let result = storage.create_bucket( + "<BUCKET_ID>", + "<NAME>", + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false), // optional + Some(1), // optional + Some(vec![]), // optional + Some(appwrite::enums::Compression::None), // optional + Some(false), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/create-file.md b/examples/2.0.x/server-rust/examples/storage/create-file.md new file mode 100644 index 000000000..882803cc6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/create-file.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; +use appwrite::InputFile; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let storage = Storage::new(&client); + + let file = InputFile::from_path("path/to/file.png", None).await?; + + let result = storage.create_file( + "<BUCKET_ID>", + "<FILE_ID>", + file, + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("photos/2026") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/delete-bucket.md b/examples/2.0.x/server-rust/examples/storage/delete-bucket.md new file mode 100644 index 000000000..dfd3fe95d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/delete-bucket.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let storage = Storage::new(&client); + + storage.delete_bucket( + "<BUCKET_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/delete-file.md b/examples/2.0.x/server-rust/examples/storage/delete-file.md new file mode 100644 index 000000000..960aa86c0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/delete-file.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let storage = Storage::new(&client); + + storage.delete_file( + "<BUCKET_ID>", + "<FILE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/get-bucket.md b/examples/2.0.x/server-rust/examples/storage/get-bucket.md new file mode 100644 index 000000000..a1f6b3359 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/get-bucket.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let storage = Storage::new(&client); + + let result = storage.get_bucket( + "<BUCKET_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/get-file-download.md b/examples/2.0.x/server-rust/examples/storage/get-file-download.md new file mode 100644 index 000000000..1119b18fe --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/get-file-download.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let storage = Storage::new(&client); + + let result = storage.get_file_download( + "<BUCKET_ID>", + "<FILE_ID>", + Some("<TOKEN>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/get-file-preview.md b/examples/2.0.x/server-rust/examples/storage/get-file-preview.md new file mode 100644 index 000000000..f8f2406d9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/get-file-preview.md @@ -0,0 +1,35 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let storage = Storage::new(&client); + + let result = storage.get_file_preview( + "<BUCKET_ID>", + "<FILE_ID>", + Some(0), // optional + Some(0), // optional + Some(appwrite::enums::ImageGravity::Center), // optional + Some(-1), // optional + Some(0), // optional + Some("FFFFFF"), // optional + Some(0), // optional + Some(0), // optional + Some(-360), // optional + Some("FFFFFF"), // optional + Some(appwrite::enums::ImageFormat::Jpg), // optional + Some("<TOKEN>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/get-file-view.md b/examples/2.0.x/server-rust/examples/storage/get-file-view.md new file mode 100644 index 000000000..01079108b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/get-file-view.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let storage = Storage::new(&client); + + let result = storage.get_file_view( + "<BUCKET_ID>", + "<FILE_ID>", + Some("<TOKEN>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/get-file.md b/examples/2.0.x/server-rust/examples/storage/get-file.md new file mode 100644 index 000000000..35de19dce --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/get-file.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let storage = Storage::new(&client); + + let result = storage.get_file( + "<BUCKET_ID>", + "<FILE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/list-buckets.md b/examples/2.0.x/server-rust/examples/storage/list-buckets.md new file mode 100644 index 000000000..12b9bb606 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/list-buckets.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let storage = Storage::new(&client); + + let result = storage.list_buckets( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/list-files.md b/examples/2.0.x/server-rust/examples/storage/list-files.md new file mode 100644 index 000000000..8cc678171 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/list-files.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let storage = Storage::new(&client); + + let result = storage.list_files( + "<BUCKET_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/update-bucket.md b/examples/2.0.x/server-rust/examples/storage/update-bucket.md new file mode 100644 index 000000000..93e88dc9b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/update-bucket.md @@ -0,0 +1,34 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let storage = Storage::new(&client); + + let result = storage.update_bucket( + "<BUCKET_ID>", + "<NAME>", + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false), // optional + Some(1), // optional + Some(vec![]), // optional + Some(appwrite::enums::Compression::None), // optional + Some(false), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/storage/update-file.md b/examples/2.0.x/server-rust/examples/storage/update-file.md new file mode 100644 index 000000000..84632094f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/storage/update-file.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Storage; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let storage = Storage::new(&client); + + let result = storage.update_file( + "<BUCKET_ID>", + "<FILE_ID>", + Some("<NAME>"), // optional + Some(vec![Permission::read(Role::any()).to_string()]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..03b0ab61a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_big_int_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(0), // optional + Some(1000000), // optional + Some(0), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..1762d5eec --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_boolean_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..31c8d7ccb --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_datetime_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("2020-10-15T06:38:00.000+00:00"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..11f800c9b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-email-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_email_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("email@example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..64d1496d2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-enum-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_enum_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + vec!["active".into(), "inactive".into()], + false, + Some("active"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..9c3179ad9 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-float-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_float_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(0), // optional + Some(100), // optional + Some(10.5), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-index.md b/examples/2.0.x/server-rust/examples/tablesdb/create-index.md new file mode 100644 index 000000000..409d88ddf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-index.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_index( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + appwrite::enums::TablesDBIndexType::Key, + vec![], + Some(vec![appwrite::enums::OrderBy::Asc]), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..756522813 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-integer-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_integer_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(0), // optional + Some(100), // optional + Some(10), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..c59cd2e43 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-ip-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_ip_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("192.0.2.0"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..70812a4de --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-line-column.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_line_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(vec![serde_json::json!([1,2]), serde_json::json!([3,4]), serde_json::json!([5,6])]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..85a2b4b63 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_longtext_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..35d022dff --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_mediumtext_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-operations.md b/examples/2.0.x/server-rust/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..30bd0fcf0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-operations.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_operations( + "<TRANSACTION_ID>", + Some(vec![serde_json::json!({"action":"create","databaseId":"<DATABASE_ID>","tableId":"<TABLE_ID>","rowId":"<ROW_ID>","data":{"name":"Walter O'Brien"}})]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..750f7778c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-point-column.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_point_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(vec![1, 2]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..b9a598f26 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_polygon_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(vec![serde_json::json!([[1,2],[3,4],[5,6],[1,2]])]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..12e8d26da --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_relationship_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<RELATED_TABLE_ID>", + appwrite::enums::RelationshipType::OneToOne, + Some(false), // optional + Some("<KEY>"), // optional + Some("<TWO_WAY_KEY>"), // optional + Some(appwrite::enums::RelationMutate::Cascade) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-row.md b/examples/2.0.x/server-rust/examples/tablesdb/create-row.md new file mode 100644 index 000000000..8dd7d1564 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-row.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_row( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + serde_json::json!({}), + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-rows.md b/examples/2.0.x/server-rust/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..b5722c489 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-rows.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_rows( + "<DATABASE_ID>", + "<TABLE_ID>", + vec![], + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..2e6118a22 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-string-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_string_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + 1, + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-table.md b/examples/2.0.x/server-rust/examples/tablesdb/create-table.md new file mode 100644 index 000000000..46aa1457b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-table.md @@ -0,0 +1,31 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_table( + "<DATABASE_ID>", + "<TABLE_ID>", + "<NAME>", + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false), // optional + Some(vec![]), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..c8cb8cc54 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-text-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_text_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-rust/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..e8b878838 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-transaction.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_transaction( + Some(60) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..aed6a8422 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-url-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_url_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("https://example.com"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-rust/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..8be27419b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create_varchar_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + 1, + false, + Some("Hello World"), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/create.md b/examples/2.0.x/server-rust/examples/tablesdb/create.md new file mode 100644 index 000000000..8a787bac1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/create.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.create( + "<DATABASE_ID>", + "<NAME>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-rust/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..f0fc521aa --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let tables_db = TablesDB::new(&client); + + let result = tables_db.decrement_row_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + "<COLUMN>", + Some(1), // optional + Some(0), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/delete-column.md b/examples/2.0.x/server-rust/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..3b4d2e1e3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/delete-column.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + tables_db.delete_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/delete-index.md b/examples/2.0.x/server-rust/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..50d737150 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/delete-index.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + tables_db.delete_index( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/delete-row.md b/examples/2.0.x/server-rust/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..e6da0e2e3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/delete-row.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let tables_db = TablesDB::new(&client); + + tables_db.delete_row( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + Some("<TRANSACTION_ID>") // optional + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-rust/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..92520ae1c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/delete-rows.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.delete_rows( + "<DATABASE_ID>", + "<TABLE_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/delete-table.md b/examples/2.0.x/server-rust/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..2838cac73 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/delete-table.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + tables_db.delete_table( + "<DATABASE_ID>", + "<TABLE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-rust/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..5fdc148af --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/delete-transaction.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + tables_db.delete_transaction( + "<TRANSACTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/delete.md b/examples/2.0.x/server-rust/examples/tablesdb/delete.md new file mode 100644 index 000000000..3be7ac0c7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + tables_db.delete( + "<DATABASE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/get-column.md b/examples/2.0.x/server-rust/examples/tablesdb/get-column.md new file mode 100644 index 000000000..d7b1bd093 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/get-column.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.get_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/get-index.md b/examples/2.0.x/server-rust/examples/tablesdb/get-index.md new file mode 100644 index 000000000..cc9c1246d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/get-index.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.get_index( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/get-row.md b/examples/2.0.x/server-rust/examples/tablesdb/get-row.md new file mode 100644 index 000000000..0c4dd7b97 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/get-row.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let tables_db = TablesDB::new(&client); + + let result = tables_db.get_row( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/get-table.md b/examples/2.0.x/server-rust/examples/tablesdb/get-table.md new file mode 100644 index 000000000..17299f315 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/get-table.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.get_table( + "<DATABASE_ID>", + "<TABLE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-rust/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..957072d93 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/get-transaction.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.get_transaction( + "<TRANSACTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/get.md b/examples/2.0.x/server-rust/examples/tablesdb/get.md new file mode 100644 index 000000000..a5400206c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.get( + "<DATABASE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-rust/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..d618d082b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/increment-row-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let tables_db = TablesDB::new(&client); + + let result = tables_db.increment_row_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + "<COLUMN>", + Some(1), // optional + Some(100), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/list-columns.md b/examples/2.0.x/server-rust/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..12f276c8f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/list-columns.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.list_columns( + "<DATABASE_ID>", + "<TABLE_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-rust/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..8153a1ec4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/list-indexes.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.list_indexes( + "<DATABASE_ID>", + "<TABLE_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/list-rows.md b/examples/2.0.x/server-rust/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..7d6e8aede --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/list-rows.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let tables_db = TablesDB::new(&client); + + let result = tables_db.list_rows( + "<DATABASE_ID>", + "<TABLE_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>"), // optional + Some(false), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/list-tables.md b/examples/2.0.x/server-rust/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..4102c92a4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/list-tables.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.list_tables( + "<DATABASE_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-rust/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..047974237 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/list-transactions.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.list_transactions( + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/list.md b/examples/2.0.x/server-rust/examples/tablesdb/list.md new file mode 100644 index 000000000..40543cd76 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.list( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..1f0eabd06 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_big_int_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(0), + Some(0), // optional + Some(1000000), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..3a65cab6b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_boolean_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(false), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..612a1cb56 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_datetime_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("2020-10-15T06:38:00.000+00:00"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..c6f29c74e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-email-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_email_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("email@example.com"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..7806f9cb5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-enum-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_enum_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + vec!["active".into(), "inactive".into()], + false, + Some("active"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..25b5ad2c1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-float-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_float_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(10.5), + Some(0), // optional + Some(100), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..7053a0d4b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-integer-column.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_integer_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(10), + Some(0), // optional + Some(100), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..261a8cee4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-ip-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_ip_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("192.0.2.0"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..a87f09830 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-line-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_line_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(vec![serde_json::json!([1,2]), serde_json::json!([3,4]), serde_json::json!([5,6])]), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..a5629b317 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_longtext_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("Hello World"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..4a8162dbc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_mediumtext_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("Hello World"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..33f4d27ab --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-point-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_point_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(vec![1, 2]), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..c3504e678 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_polygon_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some(vec![serde_json::json!([[1,2],[3,4],[5,6],[1,2]])]), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..8c83d0d48 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_relationship_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + Some(appwrite::enums::RelationMutate::Cascade), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-row.md b/examples/2.0.x/server-rust/examples/tablesdb/update-row.md new file mode 100644 index 000000000..b81fbc7c7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-row.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_row( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-rows.md b/examples/2.0.x/server-rust/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..582a9b33f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-rows.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_rows( + "<DATABASE_ID>", + "<TABLE_ID>", + Some(serde_json::json!({})), // optional + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..ea6dde7dc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-string-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_string_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("Hello World"), + Some(1), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-table.md b/examples/2.0.x/server-rust/examples/tablesdb/update-table.md new file mode 100644 index 000000000..184d9d6d4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-table.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_table( + "<DATABASE_ID>", + "<TABLE_ID>", + Some("<NAME>"), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..f9376ca24 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-text-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_text_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("Hello World"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-rust/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..39259fffd --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-transaction.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_transaction( + "<TRANSACTION_ID>", + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..57afcdcc6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-url-column.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_url_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("https://example.com"), + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-rust/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..02d74b30a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update_varchar_column( + "<DATABASE_ID>", + "<TABLE_ID>", + "<KEY>", + false, + Some("Hello World"), + Some(1), // optional + Some("<NEW_KEY>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/update.md b/examples/2.0.x/server-rust/examples/tablesdb/update.md new file mode 100644 index 000000000..13251f035 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/update.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.update( + "<DATABASE_ID>", + Some("<NAME>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-rust/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..150504999 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/upsert-row.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let tables_db = TablesDB::new(&client); + + let result = tables_db.upsert_row( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-rust/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..ba84a600a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tablesdb/upsert-rows.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::TablesDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tables_db = TablesDB::new(&client); + + let result = tables_db.upsert_rows( + "<DATABASE_ID>", + "<TABLE_ID>", + vec![], + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/create-membership.md b/examples/2.0.x/server-rust/examples/teams/create-membership.md new file mode 100644 index 000000000..5366d5e28 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/create-membership.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.create_membership( + "<TEAM_ID>", + vec![], + Some("email@example.com"), // optional + Some("<USER_ID>"), // optional + Some("+12065550100"), // optional + Some("https://example.com"), // optional + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/create.md b/examples/2.0.x/server-rust/examples/teams/create.md new file mode 100644 index 000000000..5877bdc93 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/create.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.create( + "<TEAM_ID>", + "<NAME>", + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/delete-membership.md b/examples/2.0.x/server-rust/examples/teams/delete-membership.md new file mode 100644 index 000000000..6ed7d458f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/delete-membership.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + teams.delete_membership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/delete.md b/examples/2.0.x/server-rust/examples/teams/delete.md new file mode 100644 index 000000000..c13da3a0e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + teams.delete( + "<TEAM_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/get-membership.md b/examples/2.0.x/server-rust/examples/teams/get-membership.md new file mode 100644 index 000000000..595ed8ce1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/get-membership.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.get_membership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/get-prefs.md b/examples/2.0.x/server-rust/examples/teams/get-prefs.md new file mode 100644 index 000000000..10db6fcc0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/get-prefs.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.get_prefs( + "<TEAM_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/get.md b/examples/2.0.x/server-rust/examples/teams/get.md new file mode 100644 index 000000000..ddaa9ae57 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.get( + "<TEAM_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/list-memberships.md b/examples/2.0.x/server-rust/examples/teams/list-memberships.md new file mode 100644 index 000000000..6390127f5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/list-memberships.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.list_memberships( + "<TEAM_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/list.md b/examples/2.0.x/server-rust/examples/teams/list.md new file mode 100644 index 000000000..8e55273ca --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.list( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/update-membership-status.md b/examples/2.0.x/server-rust/examples/teams/update-membership-status.md new file mode 100644 index 000000000..d6a143bb8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/update-membership-status.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.update_membership_status( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", + "<USER_ID>", + "<SECRET>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/update-membership.md b/examples/2.0.x/server-rust/examples/teams/update-membership.md new file mode 100644 index 000000000..6c6d0d792 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/update-membership.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.update_membership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", + vec![] + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/update-name.md b/examples/2.0.x/server-rust/examples/teams/update-name.md new file mode 100644 index 000000000..47e6e6c58 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/update-name.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.update_name( + "<TEAM_ID>", + "<NAME>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/teams/update-prefs.md b/examples/2.0.x/server-rust/examples/teams/update-prefs.md new file mode 100644 index 000000000..dd19536b7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/teams/update-prefs.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Teams; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let teams = Teams::new(&client); + + let result = teams.update_prefs( + "<TEAM_ID>", + serde_json::json!({}) + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tokens/create-file-token.md b/examples/2.0.x/server-rust/examples/tokens/create-file-token.md new file mode 100644 index 000000000..e1577cd44 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tokens/create-file-token.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Tokens; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tokens = Tokens::new(&client); + + let result = tokens.create_file_token( + "<BUCKET_ID>", + "<FILE_ID>", + Some("2020-10-15T06:38:00.000+00:00") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tokens/delete.md b/examples/2.0.x/server-rust/examples/tokens/delete.md new file mode 100644 index 000000000..e44ed7c27 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tokens/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Tokens; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tokens = Tokens::new(&client); + + tokens.delete( + "<TOKEN_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tokens/get.md b/examples/2.0.x/server-rust/examples/tokens/get.md new file mode 100644 index 000000000..769a18cbf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tokens/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Tokens; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tokens = Tokens::new(&client); + + let result = tokens.get( + "<TOKEN_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tokens/list.md b/examples/2.0.x/server-rust/examples/tokens/list.md new file mode 100644 index 000000000..b399512d2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tokens/list.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Tokens; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tokens = Tokens::new(&client); + + let result = tokens.list( + "<BUCKET_ID>", + "<FILE_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/tokens/update.md b/examples/2.0.x/server-rust/examples/tokens/update.md new file mode 100644 index 000000000..b6db1f7c3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/tokens/update.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Tokens; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let tokens = Tokens::new(&client); + + let result = tokens.update( + "<TOKEN_ID>", + Some("2020-10-15T06:38:00.000+00:00") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-argon-2-user.md b/examples/2.0.x/server-rust/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..5e58b7b26 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-argon-2-user.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_argon2_user( + "<USER_ID>", + "email@example.com", + "password", + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-rust/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..39cfbeb1d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-bcrypt-user.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_bcrypt_user( + "<USER_ID>", + "email@example.com", + "password", + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-jwt.md b/examples/2.0.x/server-rust/examples/users/create-jwt.md new file mode 100644 index 000000000..d728829e8 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-jwt.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_jwt( + "<USER_ID>", + Some("recent()"), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-md-5-user.md b/examples/2.0.x/server-rust/examples/users/create-md-5-user.md new file mode 100644 index 000000000..04c3f4a16 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-md-5-user.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_md5_user( + "<USER_ID>", + "email@example.com", + "password", + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-rust/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..791bfc22c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_mfa_recovery_codes( + "<USER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-rust/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..62d0b5fef --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-ph-pass-user.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_ph_pass_user( + "<USER_ID>", + "email@example.com", + "password", + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-rust/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..f576eec58 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_scrypt_modified_user( + "<USER_ID>", + "email@example.com", + "password", + "<PASSWORD_SALT>", + "<PASSWORD_SALT_SEPARATOR>", + "<PASSWORD_SIGNER_KEY>", + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-scrypt-user.md b/examples/2.0.x/server-rust/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..f87ef4adf --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-scrypt-user.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_scrypt_user( + "<USER_ID>", + "email@example.com", + "password", + "<PASSWORD_SALT>", + 8, + 65536, + 1, + 64, + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-session.md b/examples/2.0.x/server-rust/examples/users/create-session.md new file mode 100644 index 000000000..b19e7b8a1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-session.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_session( + "<USER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-sha-user.md b/examples/2.0.x/server-rust/examples/users/create-sha-user.md new file mode 100644 index 000000000..f4024a84f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-sha-user.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_sha_user( + "<USER_ID>", + "email@example.com", + "password", + Some(appwrite::enums::PasswordHash::Sha1), // optional + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-target.md b/examples/2.0.x/server-rust/examples/users/create-target.md new file mode 100644 index 000000000..680706db7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-target.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_target( + "<USER_ID>", + "<TARGET_ID>", + appwrite::enums::MessagingProviderType::Email, + "<IDENTIFIER>", + Some("<PROVIDER_ID>"), // optional + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create-token.md b/examples/2.0.x/server-rust/examples/users/create-token.md new file mode 100644 index 000000000..cfa329308 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create-token.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create_token( + "<USER_ID>", + Some(4), // optional + Some(60) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/create.md b/examples/2.0.x/server-rust/examples/users/create.md new file mode 100644 index 000000000..c22ebd52e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/create.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.create( + "<USER_ID>", + Some("email@example.com"), // optional + Some("+12065550100"), // optional + Some("password"), // optional + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/delete-identity.md b/examples/2.0.x/server-rust/examples/users/delete-identity.md new file mode 100644 index 000000000..928edf662 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/delete-identity.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + users.delete_identity( + "<IDENTITY_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-rust/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..2078f128d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + users.delete_mfa_authenticator( + "<USER_ID>", + appwrite::enums::AuthenticatorType::Totp + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/delete-session.md b/examples/2.0.x/server-rust/examples/users/delete-session.md new file mode 100644 index 000000000..4f3003832 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/delete-session.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + users.delete_session( + "<USER_ID>", + "<SESSION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/delete-sessions.md b/examples/2.0.x/server-rust/examples/users/delete-sessions.md new file mode 100644 index 000000000..1ef60aa4c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/delete-sessions.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + users.delete_sessions( + "<USER_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/delete-target.md b/examples/2.0.x/server-rust/examples/users/delete-target.md new file mode 100644 index 000000000..f3977c77a --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/delete-target.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + users.delete_target( + "<USER_ID>", + "<TARGET_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/delete.md b/examples/2.0.x/server-rust/examples/users/delete.md new file mode 100644 index 000000000..841831dfc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + users.delete( + "<USER_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-rust/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..b15bbf303 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/get-mfa-challenge.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.get_mfa_challenge( + "<USER_ID>", + "<CHALLENGE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-rust/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..33362296c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.get_mfa_recovery_codes( + "<USER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/get-prefs.md b/examples/2.0.x/server-rust/examples/users/get-prefs.md new file mode 100644 index 000000000..17447150c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/get-prefs.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.get_prefs( + "<USER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/get-target.md b/examples/2.0.x/server-rust/examples/users/get-target.md new file mode 100644 index 000000000..1a82ad773 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/get-target.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.get_target( + "<USER_ID>", + "<TARGET_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/get.md b/examples/2.0.x/server-rust/examples/users/get.md new file mode 100644 index 000000000..9c1628ae3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.get( + "<USER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/list-identities.md b/examples/2.0.x/server-rust/examples/users/list-identities.md new file mode 100644 index 000000000..4cb2d54da --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/list-identities.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.list_identities( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/list-memberships.md b/examples/2.0.x/server-rust/examples/users/list-memberships.md new file mode 100644 index 000000000..f9a3de4b4 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/list-memberships.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.list_memberships( + "<USER_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/list-mfa-factors.md b/examples/2.0.x/server-rust/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..4af4a7961 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/list-mfa-factors.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.list_mfa_factors( + "<USER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/list-sessions.md b/examples/2.0.x/server-rust/examples/users/list-sessions.md new file mode 100644 index 000000000..d2337f6dc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/list-sessions.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.list_sessions( + "<USER_ID>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/list-targets.md b/examples/2.0.x/server-rust/examples/users/list-targets.md new file mode 100644 index 000000000..591432196 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/list-targets.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.list_targets( + "<USER_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/list.md b/examples/2.0.x/server-rust/examples/users/list.md new file mode 100644 index 000000000..108a0a3ea --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.list( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-email-verification.md b/examples/2.0.x/server-rust/examples/users/update-email-verification.md new file mode 100644 index 000000000..e562d5b1f --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-email-verification.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_email_verification( + "<USER_ID>", + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-email.md b/examples/2.0.x/server-rust/examples/users/update-email.md new file mode 100644 index 000000000..24a073fee --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-email.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_email( + "<USER_ID>", + "email@example.com" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-impersonator.md b/examples/2.0.x/server-rust/examples/users/update-impersonator.md new file mode 100644 index 000000000..22a85a04b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-impersonator.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_impersonator( + "<USER_ID>", + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-labels.md b/examples/2.0.x/server-rust/examples/users/update-labels.md new file mode 100644 index 000000000..00922e3c2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-labels.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_labels( + "<USER_ID>", + vec![] + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-rust/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..f50cec106 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_mfa_recovery_codes( + "<USER_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-mfa.md b/examples/2.0.x/server-rust/examples/users/update-mfa.md new file mode 100644 index 000000000..0fad27cd1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-mfa.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_mfa( + "<USER_ID>", + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-name.md b/examples/2.0.x/server-rust/examples/users/update-name.md new file mode 100644 index 000000000..8dafad72b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-name.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_name( + "<USER_ID>", + "<NAME>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-password.md b/examples/2.0.x/server-rust/examples/users/update-password.md new file mode 100644 index 000000000..dc1aab353 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-password.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_password( + "<USER_ID>", + "password" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-phone-verification.md b/examples/2.0.x/server-rust/examples/users/update-phone-verification.md new file mode 100644 index 000000000..bd60510d2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-phone-verification.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_phone_verification( + "<USER_ID>", + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-phone.md b/examples/2.0.x/server-rust/examples/users/update-phone.md new file mode 100644 index 000000000..ea226002e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-phone.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_phone( + "<USER_ID>", + "+12065550100" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-prefs.md b/examples/2.0.x/server-rust/examples/users/update-prefs.md new file mode 100644 index 000000000..117845eab --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-prefs.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_prefs( + "<USER_ID>", + serde_json::json!({}) + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-status.md b/examples/2.0.x/server-rust/examples/users/update-status.md new file mode 100644 index 000000000..c34e76f18 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-status.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_status( + "<USER_ID>", + false + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/users/update-target.md b/examples/2.0.x/server-rust/examples/users/update-target.md new file mode 100644 index 000000000..a31537871 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/users/update-target.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::Users; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let users = Users::new(&client); + + let result = users.update_target( + "<USER_ID>", + "<TARGET_ID>", + Some("<IDENTIFIER>"), // optional + Some("<PROVIDER_ID>"), // optional + Some("<NAME>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-rust/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..101028800 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/create-collection.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.create_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + 1, + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/create-document.md b/examples/2.0.x/server-rust/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..bac5bd1d0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/create-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.create_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + serde_json::json!({}), + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-rust/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..d2aff1f09 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/create-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.create_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + vec![], + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/create-index.md b/examples/2.0.x/server-rust/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..02d30e230 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/create-index.md @@ -0,0 +1,28 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.create_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>", + appwrite::enums::VectorsDBIndexType::HnswEuclidean, + vec![], + Some(vec![appwrite::enums::OrderBy::Asc]), // optional + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-rust/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..cc1aaca69 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/create-operations.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.create_operations( + "<TRANSACTION_ID>", + Some(vec![serde_json::json!({"action":"create","databaseId":"<DATABASE_ID>","collectionId":"<COLLECTION_ID>","documentId":"<DOCUMENT_ID>","data":{"name":"Walter O'Brien"}})]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/create-query.md b/examples/2.0.x/server-rust/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..72ea46b9b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/create-query.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.create_query( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>"), // optional + Some(false), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-rust/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..a7b1919bc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/create-transaction.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.create_transaction( + Some(60) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/create.md b/examples/2.0.x/server-rust/examples/vectorsdb/create.md new file mode 100644 index 000000000..3911d8aca --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/create.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.create( + "<DATABASE_ID>", + "<NAME>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-rust/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..4a500dc9b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/delete-collection.md @@ -0,0 +1,21 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + vectors_db.delete_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-rust/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..0899b84ef --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/delete-document.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let vectors_db = VectorsDB::new(&client); + + vectors_db.delete_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some("<TRANSACTION_ID>") // optional + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-rust/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..a69a6a7eb --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/delete-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.delete_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-rust/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..865864fe5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/delete-index.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + vectors_db.delete_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-rust/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..1e2be2be7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + vectors_db.delete_transaction( + "<TRANSACTION_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/delete.md b/examples/2.0.x/server-rust/examples/vectorsdb/delete.md new file mode 100644 index 000000000..daea46232 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + vectors_db.delete( + "<DATABASE_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-rust/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..2aa56e75c --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/get-collection.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.get_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/get-document.md b/examples/2.0.x/server-rust/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..382353105 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/get-document.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.get_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/get-index.md b/examples/2.0.x/server-rust/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..e707c6818 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/get-index.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.get_index( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<KEY>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-rust/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..d3ddeaedc --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/get-transaction.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.get_transaction( + "<TRANSACTION_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/get.md b/examples/2.0.x/server-rust/examples/vectorsdb/get.md new file mode 100644 index 000000000..4009249d1 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.get( + "<DATABASE_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-rust/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..900820c09 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/list-collections.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.list_collections( + "<DATABASE_ID>", + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-rust/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..bea7001a6 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/list-documents.md @@ -0,0 +1,27 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.list_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some("<TRANSACTION_ID>"), // optional + Some(false), // optional + Some(0) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-rust/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..0a28c93f0 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/list-indexes.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.list_indexes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-rust/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..214670d44 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/list-transactions.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.list_transactions( + Some(vec![]) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/list.md b/examples/2.0.x/server-rust/examples/vectorsdb/list.md new file mode 100644 index 000000000..1cca57c54 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/list.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.list( + Some(vec![]), // optional + Some("<SEARCH>"), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-rust/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..86309ba68 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/update-collection.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.update_collection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + Some(1), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/update-document.md b/examples/2.0.x/server-rust/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..738c3c0ad --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/update-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.update_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-rust/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..d616e7305 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/update-documents.md @@ -0,0 +1,26 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.update_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + Some(serde_json::json!({})), // optional + Some(vec![]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-rust/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..75f9534c3 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/update-transaction.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.update_transaction( + "<TRANSACTION_ID>", + Some(false), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/update.md b/examples/2.0.x/server-rust/examples/vectorsdb/update.md new file mode 100644 index 000000000..0e5905ac2 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/update.md @@ -0,0 +1,24 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.update( + "<DATABASE_ID>", + "<NAME>", + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-rust/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..3bc89cca7 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/upsert-document.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; +use appwrite::permission::Permission; +use appwrite::role::Role; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_session(""); // The user session to authenticate with + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.upsert_document( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + Some(serde_json::json!({})), // optional + Some(vec![Permission::read(Role::any()).to_string()]), // optional + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-rust/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..c55611852 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,25 @@ +```rust +use appwrite::Client; +use appwrite::services::VectorsDB; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let vectors_db = VectorsDB::new(&client); + + let result = vectors_db.upsert_documents( + "<DATABASE_ID>", + "<COLLECTION_ID>", + vec![], + Some("<TRANSACTION_ID>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/webhooks/create.md b/examples/2.0.x/server-rust/examples/webhooks/create.md new file mode 100644 index 000000000..a14a6c1a5 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/webhooks/create.md @@ -0,0 +1,30 @@ +```rust +use appwrite::Client; +use appwrite::services::Webhooks; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let webhooks = Webhooks::new(&client); + + let result = webhooks.create( + "<WEBHOOK_ID>", + "https://example.com/webhook", + "<NAME>", + vec![], + Some(false), // optional + Some(false), // optional + Some("<AUTH_USERNAME>"), // optional + Some("password"), // optional + Some("<SECRET>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/webhooks/delete.md b/examples/2.0.x/server-rust/examples/webhooks/delete.md new file mode 100644 index 000000000..de187be5b --- /dev/null +++ b/examples/2.0.x/server-rust/examples/webhooks/delete.md @@ -0,0 +1,20 @@ +```rust +use appwrite::Client; +use appwrite::services::Webhooks; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let webhooks = Webhooks::new(&client); + + webhooks.delete( + "<WEBHOOK_ID>" + ).await?; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/webhooks/get.md b/examples/2.0.x/server-rust/examples/webhooks/get.md new file mode 100644 index 000000000..a2ccad14d --- /dev/null +++ b/examples/2.0.x/server-rust/examples/webhooks/get.md @@ -0,0 +1,22 @@ +```rust +use appwrite::Client; +use appwrite::services::Webhooks; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let webhooks = Webhooks::new(&client); + + let result = webhooks.get( + "<WEBHOOK_ID>" + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/webhooks/list.md b/examples/2.0.x/server-rust/examples/webhooks/list.md new file mode 100644 index 000000000..9da468e6e --- /dev/null +++ b/examples/2.0.x/server-rust/examples/webhooks/list.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Webhooks; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let webhooks = Webhooks::new(&client); + + let result = webhooks.list( + Some(vec![]), // optional + Some(false) // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/webhooks/update-secret.md b/examples/2.0.x/server-rust/examples/webhooks/update-secret.md new file mode 100644 index 000000000..d27ecbb31 --- /dev/null +++ b/examples/2.0.x/server-rust/examples/webhooks/update-secret.md @@ -0,0 +1,23 @@ +```rust +use appwrite::Client; +use appwrite::services::Webhooks; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let webhooks = Webhooks::new(&client); + + let result = webhooks.update_secret( + "<WEBHOOK_ID>", + Some("<SECRET>") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-rust/examples/webhooks/update.md b/examples/2.0.x/server-rust/examples/webhooks/update.md new file mode 100644 index 000000000..73d636ded --- /dev/null +++ b/examples/2.0.x/server-rust/examples/webhooks/update.md @@ -0,0 +1,29 @@ +```rust +use appwrite::Client; +use appwrite::services::Webhooks; + +#[tokio::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + let client = Client::new(); + client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint + client.set_project("<YOUR_PROJECT_ID>"); // Your project ID + client.set_key("<YOUR_API_KEY>"); // Your secret API key + + let webhooks = Webhooks::new(&client); + + let result = webhooks.update( + "<WEBHOOK_ID>", + "<NAME>", + "https://example.com/webhook", + vec![], + Some(false), // optional + Some(false), // optional + Some("<AUTH_USERNAME>"), // optional + Some("password") // optional + ).await?; + + let _ = result; + + Ok(()) +} +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-anonymous-session.md b/examples/2.0.x/server-swift/examples/account/create-anonymous-session.md new file mode 100644 index 000000000..a47dc0f54 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-anonymous-session.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.createAnonymousSession() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-email-password-session.md b/examples/2.0.x/server-swift/examples/account/create-email-password-session.md new file mode 100644 index 000000000..d3a5acf12 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-email-password-session.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.createEmailPasswordSession( + email: "email@example.com", + password: "password" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-email-token.md b/examples/2.0.x/server-swift/examples/account/create-email-token.md new file mode 100644 index 000000000..179c7e808 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-email-token.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createEmailToken( + userId: "<USER_ID>", + email: "email@example.com", + phrase: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-email-verification.md b/examples/2.0.x/server-swift/examples/account/create-email-verification.md new file mode 100644 index 000000000..c7ea6491d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-email-verification.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createEmailVerification( + url: "https://example.com" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-magic-url-token.md b/examples/2.0.x/server-swift/examples/account/create-magic-url-token.md new file mode 100644 index 000000000..fb168c7e5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-magic-url-token.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createMagicURLToken( + userId: "<USER_ID>", + email: "email@example.com", + url: "https://example.com", // optional + phrase: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-mfa-authenticator.md b/examples/2.0.x/server-swift/examples/account/create-mfa-authenticator.md new file mode 100644 index 000000000..6a8d37ebe --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-mfa-authenticator.md @@ -0,0 +1,16 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaType = try await account.createMFAAuthenticator( + type: .totp +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-mfa-challenge.md b/examples/2.0.x/server-swift/examples/account/create-mfa-challenge.md new file mode 100644 index 000000000..d6a19b858 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-mfa-challenge.md @@ -0,0 +1,16 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaChallenge = try await account.createMFAChallenge( + factor: .email +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-mfa-recovery-codes.md b/examples/2.0.x/server-swift/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 000000000..9c3147002 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaRecoveryCodes = try await account.createMFARecoveryCodes() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-o-auth-2-token.md b/examples/2.0.x/server-swift/examples/account/create-o-auth-2-token.md new file mode 100644 index 000000000..b33820893 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-o-auth-2-token.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let success = try await account.createOAuth2Token( + provider: .amazon, + success: "https://example.com", // optional + failure: "https://example.com", // optional + scopes: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-phone-token.md b/examples/2.0.x/server-swift/examples/account/create-phone-token.md new file mode 100644 index 000000000..9d43ba674 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-phone-token.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createPhoneToken( + userId: "<USER_ID>", + phone: "+12065550100" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-phone-verification.md b/examples/2.0.x/server-swift/examples/account/create-phone-verification.md new file mode 100644 index 000000000..87973f65d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-phone-verification.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createPhoneVerification() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-recovery.md b/examples/2.0.x/server-swift/examples/account/create-recovery.md new file mode 100644 index 000000000..6f88360ff --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-recovery.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createRecovery( + email: "email@example.com", + url: "https://example.com" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-session.md b/examples/2.0.x/server-swift/examples/account/create-session.md new file mode 100644 index 000000000..4d64f2fd1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-session.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.createSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create-verification.md b/examples/2.0.x/server-swift/examples/account/create-verification.md new file mode 100644 index 000000000..deb8a0b52 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create-verification.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createVerification( + url: "https://example.com" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/create.md b/examples/2.0.x/server-swift/examples/account/create.md new file mode 100644 index 000000000..8161264be --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/create.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.create( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/delete-identity.md b/examples/2.0.x/server-swift/examples/account/delete-identity.md new file mode 100644 index 000000000..87827cd1f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/delete-identity.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let result = try await account.deleteIdentity( + identityId: "<IDENTITY_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/delete-mfa-authenticator.md b/examples/2.0.x/server-swift/examples/account/delete-mfa-authenticator.md new file mode 100644 index 000000000..3d002f5a2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let result = try await account.deleteMFAAuthenticator( + type: .totp +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/delete-session.md b/examples/2.0.x/server-swift/examples/account/delete-session.md new file mode 100644 index 000000000..e1523301c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/delete-session.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let result = try await account.deleteSession( + sessionId: "<SESSION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/delete-sessions.md b/examples/2.0.x/server-swift/examples/account/delete-sessions.md new file mode 100644 index 000000000..23d87c694 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/delete-sessions.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let result = try await account.deleteSessions() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/get-mfa-recovery-codes.md b/examples/2.0.x/server-swift/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 000000000..812a074ad --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaRecoveryCodes = try await account.getMFARecoveryCodes() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/get-prefs.md b/examples/2.0.x/server-swift/examples/account/get-prefs.md new file mode 100644 index 000000000..c2c23ea16 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/get-prefs.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let preferences = try await account.getPrefs() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/get-session.md b/examples/2.0.x/server-swift/examples/account/get-session.md new file mode 100644 index 000000000..2d8eeeb20 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/get-session.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.getSession( + sessionId: "<SESSION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/get.md b/examples/2.0.x/server-swift/examples/account/get.md new file mode 100644 index 000000000..4ef00b6eb --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/get.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.get() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/list-identities.md b/examples/2.0.x/server-swift/examples/account/list-identities.md new file mode 100644 index 000000000..ed5b85750 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/list-identities.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let identityList = try await account.listIdentities( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/list-mfa-factors.md b/examples/2.0.x/server-swift/examples/account/list-mfa-factors.md new file mode 100644 index 000000000..996528898 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/list-mfa-factors.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaFactors = try await account.listMFAFactors() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/list-sessions.md b/examples/2.0.x/server-swift/examples/account/list-sessions.md new file mode 100644 index 000000000..7e263e7d2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/list-sessions.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let sessionList = try await account.listSessions() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-email-verification.md b/examples/2.0.x/server-swift/examples/account/update-email-verification.md new file mode 100644 index 000000000..8822d0cda --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-email-verification.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.updateEmailVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-email.md b/examples/2.0.x/server-swift/examples/account/update-email.md new file mode 100644 index 000000000..df903fe29 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-email.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateEmail( + email: "email@example.com", + password: "password" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-magic-url-session.md b/examples/2.0.x/server-swift/examples/account/update-magic-url-session.md new file mode 100644 index 000000000..5bc71b01c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-magic-url-session.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.updateMagicURLSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-mfa-authenticator.md b/examples/2.0.x/server-swift/examples/account/update-mfa-authenticator.md new file mode 100644 index 000000000..4c156a2ca --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-mfa-authenticator.md @@ -0,0 +1,17 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateMFAAuthenticator( + type: .totp, + otp: "<OTP>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-mfa-challenge.md b/examples/2.0.x/server-swift/examples/account/update-mfa-challenge.md new file mode 100644 index 000000000..9ee045d03 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-mfa-challenge.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.updateMFAChallenge( + challengeId: "<CHALLENGE_ID>", + otp: "<OTP>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-mfa-recovery-codes.md b/examples/2.0.x/server-swift/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 000000000..fabf3ff02 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaRecoveryCodes = try await account.updateMFARecoveryCodes() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-mfa.md b/examples/2.0.x/server-swift/examples/account/update-mfa.md new file mode 100644 index 000000000..a989d4aa8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-mfa.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateMFA( + mfa: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-name.md b/examples/2.0.x/server-swift/examples/account/update-name.md new file mode 100644 index 000000000..eaa7cd1f8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-name.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateName( + name: "<NAME>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-password.md b/examples/2.0.x/server-swift/examples/account/update-password.md new file mode 100644 index 000000000..96e97e047 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-password.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updatePassword( + password: "password", + oldPassword: "password" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-phone-session.md b/examples/2.0.x/server-swift/examples/account/update-phone-session.md new file mode 100644 index 000000000..90bade476 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-phone-session.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.updatePhoneSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-phone-verification.md b/examples/2.0.x/server-swift/examples/account/update-phone-verification.md new file mode 100644 index 000000000..66a3428af --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-phone-verification.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.updatePhoneVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-phone.md b/examples/2.0.x/server-swift/examples/account/update-phone.md new file mode 100644 index 000000000..d89e96275 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-phone.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updatePhone( + phone: "+12065550100", + password: "password" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-prefs.md b/examples/2.0.x/server-swift/examples/account/update-prefs.md new file mode 100644 index 000000000..b6e9f9cc4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-prefs.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updatePrefs( + prefs: [ + "language": "en", + "timezone": "UTC", + "darkTheme": true + ] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-recovery.md b/examples/2.0.x/server-swift/examples/account/update-recovery.md new file mode 100644 index 000000000..27eaa78ee --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-recovery.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.updateRecovery( + userId: "<USER_ID>", + secret: "<SECRET>", + password: "password" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-session.md b/examples/2.0.x/server-swift/examples/account/update-session.md new file mode 100644 index 000000000..62af972c8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-session.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.updateSession( + sessionId: "<SESSION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-status.md b/examples/2.0.x/server-swift/examples/account/update-status.md new file mode 100644 index 000000000..8b779636c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-status.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateStatus() + +``` diff --git a/examples/2.0.x/server-swift/examples/account/update-verification.md b/examples/2.0.x/server-swift/examples/account/update-verification.md new file mode 100644 index 000000000..68e1fb772 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/account/update-verification.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.updateVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/advisor/delete-report.md b/examples/2.0.x/server-swift/examples/advisor/delete-report.md new file mode 100644 index 000000000..693968935 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/advisor/delete-report.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let advisor = Advisor(client) + +let result = try await advisor.deleteReport( + reportId: "<REPORT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/advisor/get-insight.md b/examples/2.0.x/server-swift/examples/advisor/get-insight.md new file mode 100644 index 000000000..648d5036b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/advisor/get-insight.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let advisor = Advisor(client) + +let insight = try await advisor.getInsight( + reportId: "<REPORT_ID>", + insightId: "<INSIGHT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/advisor/get-report.md b/examples/2.0.x/server-swift/examples/advisor/get-report.md new file mode 100644 index 000000000..14682be0b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/advisor/get-report.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let advisor = Advisor(client) + +let report = try await advisor.getReport( + reportId: "<REPORT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/advisor/list-insights.md b/examples/2.0.x/server-swift/examples/advisor/list-insights.md new file mode 100644 index 000000000..73ccd6b19 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/advisor/list-insights.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let advisor = Advisor(client) + +let insightList = try await advisor.listInsights( + reportId: "<REPORT_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/advisor/list-reports.md b/examples/2.0.x/server-swift/examples/advisor/list-reports.md new file mode 100644 index 000000000..a59bd944a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/advisor/list-reports.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let advisor = Advisor(client) + +let reportList = try await advisor.listReports( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-browser.md b/examples/2.0.x/server-swift/examples/avatars/get-browser.md new file mode 100644 index 000000000..324540b47 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-browser.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getBrowser( + code: .avantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-credit-card.md b/examples/2.0.x/server-swift/examples/avatars/get-credit-card.md new file mode 100644 index 000000000..45b7d4bef --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-credit-card.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getCreditCard( + code: .americanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-favicon.md b/examples/2.0.x/server-swift/examples/avatars/get-favicon.md new file mode 100644 index 000000000..f0945dcaf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-favicon.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getFavicon( + url: "https://example.com" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-flag.md b/examples/2.0.x/server-swift/examples/avatars/get-flag.md new file mode 100644 index 000000000..d7cc8c6ab --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-flag.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getFlag( + code: .afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-image.md b/examples/2.0.x/server-swift/examples/avatars/get-image.md new file mode 100644 index 000000000..4f18af5a2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-image.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getImage( + url: "https://example.com", + width: 0, // optional + height: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-initials.md b/examples/2.0.x/server-swift/examples/avatars/get-initials.md new file mode 100644 index 000000000..b4e902277 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-initials.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getInitials( + name: "<NAME>", // optional + width: 0, // optional + height: 0, // optional + background: "FFFFFF" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-photo.md b/examples/2.0.x/server-swift/examples/avatars/get-photo.md new file mode 100644 index 000000000..29ea9fa5d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-photo.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: "png", // optional + rating: "g", // optional + userId: "current()", // optional + emailHash: "<EMAIL_HASH>", // optional + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-qr.md b/examples/2.0.x/server-swift/examples/avatars/get-qr.md new file mode 100644 index 000000000..c5bfa168e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-qr.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getQR( + text: "<TEXT>", + size: 1, // optional + margin: 0, // optional + download: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/avatars/get-screenshot.md b/examples/2.0.x/server-swift/examples/avatars/get-screenshot.md new file mode 100644 index 000000000..482905ea9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/avatars/get-screenshot.md @@ -0,0 +1,38 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getScreenshot( + url: "https://example.com", + headers: [ + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + ], // optional + viewportWidth: 1920, // optional + viewportHeight: 1080, // optional + scale: 2, // optional + theme: .dark, // optional + userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // optional + fullpage: true, // optional + locale: "en-US", // optional + timezone: .africaAbidjan, // optional + latitude: 37.7749, // optional + longitude: -122.4194, // optional + accuracy: 100, // optional + touch: true, // optional + permissions: [.geolocation, .notifications], // optional + sleep: 3, // optional + width: 800, // optional + height: 600, // optional + quality: 85, // optional + output: .jpeg // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-big-int-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-big-int-attribute.md new file mode 100644 index 000000000..506a044fc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-big-int-attribute.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeBigint = try await databases.createBigIntAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 1000000, // optional + default: 0, // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-boolean-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-boolean-attribute.md new file mode 100644 index 000000000..4c3dc0c04 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-boolean-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeBoolean = try await databases.createBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: false, // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-collection.md b/examples/2.0.x/server-swift/examples/databases/create-collection.md new file mode 100644 index 000000000..6d90e7ea4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-collection.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let collection = try await databases.createCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-datetime-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-datetime-attribute.md new file mode 100644 index 000000000..cd336603e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-datetime-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeDatetime = try await databases.createDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-document.md b/examples/2.0.x/server-swift/examples/databases/create-document.md new file mode 100644 index 000000000..24829794d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-document.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.createDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-documents.md b/examples/2.0.x/server-swift/examples/databases/create-documents.md new file mode 100644 index 000000000..1763ab133 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.createDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-email-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-email-attribute.md new file mode 100644 index 000000000..f26a08208 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-email-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeEmail = try await databases.createEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-enum-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-enum-attribute.md new file mode 100644 index 000000000..71303a7a7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-enum-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeEnum = try await databases.createEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-float-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-float-attribute.md new file mode 100644 index 000000000..47420d27f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-float-attribute.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeFloat = try await databases.createFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 100, // optional + default: 10.5, // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-index.md b/examples/2.0.x/server-swift/examples/databases/create-index.md new file mode 100644 index 000000000..ad4459aad --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-index.md @@ -0,0 +1,22 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let index = try await databases.createIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: .key, + attributes: [], + orders: [.asc], // optional + lengths: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-integer-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-integer-attribute.md new file mode 100644 index 000000000..d17899163 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-integer-attribute.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeInteger = try await databases.createIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 100, // optional + default: 10, // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-ip-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-ip-attribute.md new file mode 100644 index 000000000..4156aa576 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-ip-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeIp = try await databases.createIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-line-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-line-attribute.md new file mode 100644 index 000000000..b37e11485 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-line-attribute.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeLine = try await databases.createLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-longtext-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-longtext-attribute.md new file mode 100644 index 000000000..59e3287a4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-longtext-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeLongtext = try await databases.createLongtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-mediumtext-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-mediumtext-attribute.md new file mode 100644 index 000000000..b73a3b0fd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-mediumtext-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeMediumtext = try await databases.createMediumtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-operations.md b/examples/2.0.x/server-swift/examples/databases/create-operations.md new file mode 100644 index 000000000..dd2f77333 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-operations.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let transaction = try await databases.createOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-point-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-point-attribute.md new file mode 100644 index 000000000..414daa6f6 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-point-attribute.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributePoint = try await databases.createPointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [1, 2] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-polygon-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-polygon-attribute.md new file mode 100644 index 000000000..2499711f0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-polygon-attribute.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributePolygon = try await databases.createPolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-relationship-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-relationship-attribute.md new file mode 100644 index 000000000..4fb4e00a5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-relationship-attribute.md @@ -0,0 +1,23 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeRelationship = try await databases.createRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + relatedCollectionId: "<RELATED_COLLECTION_ID>", + type: .oneToOne, + twoWay: false, // optional + key: "<KEY>", // optional + twoWayKey: "<TWO_WAY_KEY>", // optional + onDelete: .cascade // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-string-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-string-attribute.md new file mode 100644 index 000000000..55a9e98df --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-string-attribute.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeString = try await databases.createStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-text-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-text-attribute.md new file mode 100644 index 000000000..930240354 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-text-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeText = try await databases.createTextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-transaction.md b/examples/2.0.x/server-swift/examples/databases/create-transaction.md new file mode 100644 index 000000000..993d15609 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let transaction = try await databases.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-url-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-url-attribute.md new file mode 100644 index 000000000..cfb6dbf28 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-url-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeUrl = try await databases.createUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create-varchar-attribute.md b/examples/2.0.x/server-swift/examples/databases/create-varchar-attribute.md new file mode 100644 index 000000000..cd4e90bf1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create-varchar-attribute.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeVarchar = try await databases.createVarcharAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/create.md b/examples/2.0.x/server-swift/examples/databases/create.md new file mode 100644 index 000000000..d2ef3bb6c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/create.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let database = try await databases.create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/decrement-document-attribute.md b/examples/2.0.x/server-swift/examples/databases/decrement-document-attribute.md new file mode 100644 index 000000000..ef2f7eb03 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.decrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, // optional + min: 0, // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/delete-attribute.md b/examples/2.0.x/server-swift/examples/databases/delete-attribute.md new file mode 100644 index 000000000..acb437bf4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/delete-attribute.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.deleteAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/delete-collection.md b/examples/2.0.x/server-swift/examples/databases/delete-collection.md new file mode 100644 index 000000000..2c41909c0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/delete-collection.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.deleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/delete-document.md b/examples/2.0.x/server-swift/examples/databases/delete-document.md new file mode 100644 index 000000000..84559d0ec --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/delete-document.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let result = try await databases.deleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/delete-documents.md b/examples/2.0.x/server-swift/examples/databases/delete-documents.md new file mode 100644 index 000000000..81a24778d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/delete-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.deleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/delete-index.md b/examples/2.0.x/server-swift/examples/databases/delete-index.md new file mode 100644 index 000000000..d10399a64 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/delete-index.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.deleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/delete-transaction.md b/examples/2.0.x/server-swift/examples/databases/delete-transaction.md new file mode 100644 index 000000000..220ad79b5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/delete-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.deleteTransaction( + transactionId: "<TRANSACTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/delete.md b/examples/2.0.x/server-swift/examples/databases/delete.md new file mode 100644 index 000000000..162c59bd2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.delete( + databaseId: "<DATABASE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/get-attribute.md b/examples/2.0.x/server-swift/examples/databases/get-attribute.md new file mode 100644 index 000000000..a92d4f9aa --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/get-attribute.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.getAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/get-collection.md b/examples/2.0.x/server-swift/examples/databases/get-collection.md new file mode 100644 index 000000000..af43c69b4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/get-collection.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let collection = try await databases.getCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/get-document.md b/examples/2.0.x/server-swift/examples/databases/get-document.md new file mode 100644 index 000000000..02daf3531 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/get-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.getDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/get-index.md b/examples/2.0.x/server-swift/examples/databases/get-index.md new file mode 100644 index 000000000..749c1f184 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/get-index.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let index = try await databases.getIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/get-transaction.md b/examples/2.0.x/server-swift/examples/databases/get-transaction.md new file mode 100644 index 000000000..41139294f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/get-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let transaction = try await databases.getTransaction( + transactionId: "<TRANSACTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/get.md b/examples/2.0.x/server-swift/examples/databases/get.md new file mode 100644 index 000000000..7f5817cfd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let database = try await databases.get( + databaseId: "<DATABASE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/increment-document-attribute.md b/examples/2.0.x/server-swift/examples/databases/increment-document-attribute.md new file mode 100644 index 000000000..1e7947ef9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/increment-document-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.incrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, // optional + max: 100, // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/list-attributes.md b/examples/2.0.x/server-swift/examples/databases/list-attributes.md new file mode 100644 index 000000000..04be770e2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/list-attributes.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeList = try await databases.listAttributes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/list-collections.md b/examples/2.0.x/server-swift/examples/databases/list-collections.md new file mode 100644 index 000000000..961399d56 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/list-collections.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let collectionList = try await databases.listCollections( + databaseId: "<DATABASE_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/list-documents.md b/examples/2.0.x/server-swift/examples/databases/list-documents.md new file mode 100644 index 000000000..75ef8c7b8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/list-documents.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let documentList = try await databases.listDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/list-indexes.md b/examples/2.0.x/server-swift/examples/databases/list-indexes.md new file mode 100644 index 000000000..45c3ea543 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/list-indexes.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let indexList = try await databases.listIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/list-transactions.md b/examples/2.0.x/server-swift/examples/databases/list-transactions.md new file mode 100644 index 000000000..4059ddbf3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/list-transactions.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let transactionList = try await databases.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/list.md b/examples/2.0.x/server-swift/examples/databases/list.md new file mode 100644 index 000000000..88b98c25a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let databaseList = try await databases.list( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-big-int-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-big-int-attribute.md new file mode 100644 index 000000000..a7705878f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-big-int-attribute.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeBigint = try await databases.updateBigIntAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 0, + min: 0, // optional + max: 1000000, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-boolean-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-boolean-attribute.md new file mode 100644 index 000000000..51916d405 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-boolean-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeBoolean = try await databases.updateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: false, + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-collection.md b/examples/2.0.x/server-swift/examples/databases/update-collection.md new file mode 100644 index 000000000..13d4dd51e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-collection.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let collection = try await databases.updateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", // optional + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-datetime-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-datetime-attribute.md new file mode 100644 index 000000000..5f5336af8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-datetime-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeDatetime = try await databases.updateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-document.md b/examples/2.0.x/server-swift/examples/databases/update-document.md new file mode 100644 index 000000000..d1e0bde06 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-document.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.updateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + ], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-documents.md b/examples/2.0.x/server-swift/examples/databases/update-documents.md new file mode 100644 index 000000000..7f7e641ce --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-documents.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.updateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + ], // optional + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-email-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-email-attribute.md new file mode 100644 index 000000000..fd627699f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-email-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeEmail = try await databases.updateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-enum-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-enum-attribute.md new file mode 100644 index 000000000..94dfdac8e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-enum-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeEnum = try await databases.updateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-float-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-float-attribute.md new file mode 100644 index 000000000..7e9d31dcf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-float-attribute.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeFloat = try await databases.updateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 10.5, + min: 0, // optional + max: 100, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-integer-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-integer-attribute.md new file mode 100644 index 000000000..0add61b47 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-integer-attribute.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeInteger = try await databases.updateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: 10, + min: 0, // optional + max: 100, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-ip-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-ip-attribute.md new file mode 100644 index 000000000..f0ba0c439 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-ip-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeIp = try await databases.updateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-line-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-line-attribute.md new file mode 100644 index 000000000..e402dc7d9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-line-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeLine = try await databases.updateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-longtext-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-longtext-attribute.md new file mode 100644 index 000000000..f75217088 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-longtext-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeLongtext = try await databases.updateLongtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-mediumtext-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-mediumtext-attribute.md new file mode 100644 index 000000000..490236cbb --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-mediumtext-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeMediumtext = try await databases.updateMediumtextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-point-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-point-attribute.md new file mode 100644 index 000000000..3e035787a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-point-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributePoint = try await databases.updatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [1, 2], // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-polygon-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-polygon-attribute.md new file mode 100644 index 000000000..9f298868d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-polygon-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributePolygon = try await databases.updatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-relationship-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-relationship-attribute.md new file mode 100644 index 000000000..d3945db87 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-relationship-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeRelationship = try await databases.updateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + onDelete: .cascade, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-string-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-string-attribute.md new file mode 100644 index 000000000..c438659b8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-string-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeString = try await databases.updateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-text-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-text-attribute.md new file mode 100644 index 000000000..5b1d6d23e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-text-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeText = try await databases.updateTextAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-transaction.md b/examples/2.0.x/server-swift/examples/databases/update-transaction.md new file mode 100644 index 000000000..7212240f2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-transaction.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let transaction = try await databases.updateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-url-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-url-attribute.md new file mode 100644 index 000000000..842a1efd4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-url-attribute.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeUrl = try await databases.updateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update-varchar-attribute.md b/examples/2.0.x/server-swift/examples/databases/update-varchar-attribute.md new file mode 100644 index 000000000..251d97ff5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update-varchar-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeVarchar = try await databases.updateVarcharAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/update.md b/examples/2.0.x/server-swift/examples/databases/update.md new file mode 100644 index 000000000..f60d38ab4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/update.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let database = try await databases.update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/upsert-document.md b/examples/2.0.x/server-swift/examples/databases/upsert-document.md new file mode 100644 index 000000000..ca7363fa6 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/upsert-document.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.upsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/databases/upsert-documents.md b/examples/2.0.x/server-swift/examples/databases/upsert-documents.md new file mode 100644 index 000000000..dbcc58e5e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/databases/upsert-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.upsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/create-collection.md b/examples/2.0.x/server-swift/examples/documentsdb/create-collection.md new file mode 100644 index 000000000..fc6bb0447 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/create-collection.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let collection = try await documentsDB.createCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/create-document.md b/examples/2.0.x/server-swift/examples/documentsdb/create-document.md new file mode 100644 index 000000000..fda294ad1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.createDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/create-documents.md b/examples/2.0.x/server-swift/examples/documentsdb/create-documents.md new file mode 100644 index 000000000..9b61a9eb4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.createDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/create-index.md b/examples/2.0.x/server-swift/examples/documentsdb/create-index.md new file mode 100644 index 000000000..fae314f85 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/create-index.md @@ -0,0 +1,22 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let index = try await documentsDB.createIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: .key, + attributes: [], + orders: [.asc], // optional + lengths: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/create-operations.md b/examples/2.0.x/server-swift/examples/documentsdb/create-operations.md new file mode 100644 index 000000000..2e256c685 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/create-operations.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.createOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/create-transaction.md b/examples/2.0.x/server-swift/examples/documentsdb/create-transaction.md new file mode 100644 index 000000000..9c31bf1b7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/create.md b/examples/2.0.x/server-swift/examples/documentsdb/create.md new file mode 100644 index 000000000..142efee6f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/create.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let database = try await documentsDB.create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/decrement-document-attribute.md b/examples/2.0.x/server-swift/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 000000000..ae6daf0cd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.decrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, // optional + min: 0, // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/delete-collection.md b/examples/2.0.x/server-swift/examples/documentsdb/delete-collection.md new file mode 100644 index 000000000..a1c703437 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/delete-collection.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.deleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/delete-document.md b/examples/2.0.x/server-swift/examples/documentsdb/delete-document.md new file mode 100644 index 000000000..a596a9baf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.deleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/delete-documents.md b/examples/2.0.x/server-swift/examples/documentsdb/delete-documents.md new file mode 100644 index 000000000..9c6e9c6ff --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/delete-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.deleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/delete-index.md b/examples/2.0.x/server-swift/examples/documentsdb/delete-index.md new file mode 100644 index 000000000..12651993d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/delete-index.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.deleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/delete-transaction.md b/examples/2.0.x/server-swift/examples/documentsdb/delete-transaction.md new file mode 100644 index 000000000..8f9f12ad2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.deleteTransaction( + transactionId: "<TRANSACTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/delete.md b/examples/2.0.x/server-swift/examples/documentsdb/delete.md new file mode 100644 index 000000000..7c34c3de9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let result = try await documentsDB.delete( + databaseId: "<DATABASE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/get-collection.md b/examples/2.0.x/server-swift/examples/documentsdb/get-collection.md new file mode 100644 index 000000000..177ff7430 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/get-collection.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let collection = try await documentsDB.getCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/get-document.md b/examples/2.0.x/server-swift/examples/documentsdb/get-document.md new file mode 100644 index 000000000..ec0ed9035 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.getDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/get-index.md b/examples/2.0.x/server-swift/examples/documentsdb/get-index.md new file mode 100644 index 000000000..19f3fb151 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/get-index.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let index = try await documentsDB.getIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/get-transaction.md b/examples/2.0.x/server-swift/examples/documentsdb/get-transaction.md new file mode 100644 index 000000000..90ca83f84 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.getTransaction( + transactionId: "<TRANSACTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/get.md b/examples/2.0.x/server-swift/examples/documentsdb/get.md new file mode 100644 index 000000000..87646fbbf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let database = try await documentsDB.get( + databaseId: "<DATABASE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/increment-document-attribute.md b/examples/2.0.x/server-swift/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 000000000..d8abb8f08 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.incrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "<ATTRIBUTE>", + value: 1, // optional + max: 100, // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/list-collections.md b/examples/2.0.x/server-swift/examples/documentsdb/list-collections.md new file mode 100644 index 000000000..42f4384e1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/list-collections.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let collectionList = try await documentsDB.listCollections( + databaseId: "<DATABASE_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/list-documents.md b/examples/2.0.x/server-swift/examples/documentsdb/list-documents.md new file mode 100644 index 000000000..72b84c013 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.listDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/list-indexes.md b/examples/2.0.x/server-swift/examples/documentsdb/list-indexes.md new file mode 100644 index 000000000..9140f3c67 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/list-indexes.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let indexList = try await documentsDB.listIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/list-transactions.md b/examples/2.0.x/server-swift/examples/documentsdb/list-transactions.md new file mode 100644 index 000000000..f6eec7146 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let transactionList = try await documentsDB.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/list.md b/examples/2.0.x/server-swift/examples/documentsdb/list.md new file mode 100644 index 000000000..b6a036cbf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let databaseList = try await documentsDB.list( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/update-collection.md b/examples/2.0.x/server-swift/examples/documentsdb/update-collection.md new file mode 100644 index 000000000..1e7df8c71 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/update-collection.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let collection = try await documentsDB.updateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + purge: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/update-document.md b/examples/2.0.x/server-swift/examples/documentsdb/update-document.md new file mode 100644 index 000000000..e74e305a0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.updateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/update-documents.md b/examples/2.0.x/server-swift/examples/documentsdb/update-documents.md new file mode 100644 index 000000000..8931c91d0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/update-documents.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.updateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: [:], // optional + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/update-transaction.md b/examples/2.0.x/server-swift/examples/documentsdb/update-transaction.md new file mode 100644 index 000000000..77ec18ea8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let transaction = try await documentsDB.updateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/update.md b/examples/2.0.x/server-swift/examples/documentsdb/update.md new file mode 100644 index 000000000..663dd99d2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/update.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let database = try await documentsDB.update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/upsert-document.md b/examples/2.0.x/server-swift/examples/documentsdb/upsert-document.md new file mode 100644 index 000000000..c3b603089 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let documentsDB = DocumentsDB(client) + +let document = try await documentsDB.upsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/documentsdb/upsert-documents.md b/examples/2.0.x/server-swift/examples/documentsdb/upsert-documents.md new file mode 100644 index 000000000..6e6ad9ea9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/documentsdb/upsert-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let documentsDB = DocumentsDB(client) + +let documentList = try await documentsDB.upsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/embeddings/create-text-embeddings.md b/examples/2.0.x/server-swift/examples/embeddings/create-text-embeddings.md new file mode 100644 index 000000000..85afbc743 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/embeddings/create-text-embeddings.md @@ -0,0 +1,17 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let embeddings = Embeddings(client) + +let embeddingList = try await embeddings.createTextEmbeddings( + texts: [], + model: .nomicEmbedText // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/create-deployment.md b/examples/2.0.x/server-swift/examples/functions/create-deployment.md new file mode 100644 index 000000000..b38a94405 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/create-deployment.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createDeployment( + functionId: "<FUNCTION_ID>", + code: InputFile.fromPath("file.png"), + activate: false, + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/create-duplicate-deployment.md b/examples/2.0.x/server-swift/examples/functions/create-duplicate-deployment.md new file mode 100644 index 000000000..4133a8adf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createDuplicateDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + buildId: "<BUILD_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/create-execution.md b/examples/2.0.x/server-swift/examples/functions/create-execution.md new file mode 100644 index 000000000..25c96eec9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/create-execution.md @@ -0,0 +1,22 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let functions = Functions(client) + +let execution = try await functions.createExecution( + functionId: "<FUNCTION_ID>", + body: "<BODY>", // optional + async: false, // optional + path: "<PATH>", // optional + method: .gET, // optional + headers: [:], // optional + scheduledAt: "<SCHEDULED_AT>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/create-template-deployment.md b/examples/2.0.x/server-swift/examples/functions/create-template-deployment.md new file mode 100644 index 000000000..65cba8d6b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/create-template-deployment.md @@ -0,0 +1,22 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createTemplateDeployment( + functionId: "<FUNCTION_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + type: .commit, + reference: "<REFERENCE>", + activate: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/create-variable.md b/examples/2.0.x/server-swift/examples/functions/create-variable.md new file mode 100644 index 000000000..6cc280ffd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/create-variable.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let variable = try await functions.createVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/create-vcs-deployment.md b/examples/2.0.x/server-swift/examples/functions/create-vcs-deployment.md new file mode 100644 index 000000000..d15745b6b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/create-vcs-deployment.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createVcsDeployment( + functionId: "<FUNCTION_ID>", + type: .branch, + reference: "<REFERENCE>", + activate: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/create.md b/examples/2.0.x/server-swift/examples/functions/create.md new file mode 100644 index 000000000..0b3e08d6a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/create.md @@ -0,0 +1,37 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let function = try await functions.create( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: .node145, + execute: ["any"], // optional + events: [], // optional + schedule: "0 0 * * *", // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>", // optional + scopes: [.projectRead], // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/delete-deployment.md b/examples/2.0.x/server-swift/examples/functions/delete-deployment.md new file mode 100644 index 000000000..5aa4a29c1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/delete-deployment.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let result = try await functions.deleteDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/delete-execution.md b/examples/2.0.x/server-swift/examples/functions/delete-execution.md new file mode 100644 index 000000000..3f38299de --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/delete-execution.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let result = try await functions.deleteExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/delete-variable.md b/examples/2.0.x/server-swift/examples/functions/delete-variable.md new file mode 100644 index 000000000..c62fbdb1c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/delete-variable.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let result = try await functions.deleteVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/delete.md b/examples/2.0.x/server-swift/examples/functions/delete.md new file mode 100644 index 000000000..26694f6e2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let result = try await functions.delete( + functionId: "<FUNCTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/get-deployment-download.md b/examples/2.0.x/server-swift/examples/functions/get-deployment-download.md new file mode 100644 index 000000000..6d3674e3f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/get-deployment-download.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let bytes = try await functions.getDeploymentDownload( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: .source, // optional + token: "<TOKEN>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/get-deployment.md b/examples/2.0.x/server-swift/examples/functions/get-deployment.md new file mode 100644 index 000000000..f0bfe2d5e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/get-deployment.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.getDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/get-execution.md b/examples/2.0.x/server-swift/examples/functions/get-execution.md new file mode 100644 index 000000000..93f301a11 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/get-execution.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let functions = Functions(client) + +let execution = try await functions.getExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/get-variable.md b/examples/2.0.x/server-swift/examples/functions/get-variable.md new file mode 100644 index 000000000..2d1d6b268 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/get-variable.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let variable = try await functions.getVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/get.md b/examples/2.0.x/server-swift/examples/functions/get.md new file mode 100644 index 000000000..b3a2694ff --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let function = try await functions.get( + functionId: "<FUNCTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/list-deployments.md b/examples/2.0.x/server-swift/examples/functions/list-deployments.md new file mode 100644 index 000000000..16a263249 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/list-deployments.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deploymentList = try await functions.listDeployments( + functionId: "<FUNCTION_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/list-executions.md b/examples/2.0.x/server-swift/examples/functions/list-executions.md new file mode 100644 index 000000000..86d87d8d1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/list-executions.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let functions = Functions(client) + +let executionList = try await functions.listExecutions( + functionId: "<FUNCTION_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/list-runtimes.md b/examples/2.0.x/server-swift/examples/functions/list-runtimes.md new file mode 100644 index 000000000..447e11eb3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/list-runtimes.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let runtimeList = try await functions.listRuntimes() + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/list-specifications.md b/examples/2.0.x/server-swift/examples/functions/list-specifications.md new file mode 100644 index 000000000..f351a57b1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/list-specifications.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let specificationList = try await functions.listSpecifications( + type: "runtimes" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/list-variables.md b/examples/2.0.x/server-swift/examples/functions/list-variables.md new file mode 100644 index 000000000..ff4d60c8f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/list-variables.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let variableList = try await functions.listVariables( + functionId: "<FUNCTION_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/list.md b/examples/2.0.x/server-swift/examples/functions/list.md new file mode 100644 index 000000000..a8f641ed0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let functionList = try await functions.list( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/update-deployment-status.md b/examples/2.0.x/server-swift/examples/functions/update-deployment-status.md new file mode 100644 index 000000000..a6c23a57b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/update-deployment-status.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.updateDeploymentStatus( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/update-function-deployment.md b/examples/2.0.x/server-swift/examples/functions/update-function-deployment.md new file mode 100644 index 000000000..71a50fa6c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/update-function-deployment.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let function = try await functions.updateFunctionDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/update-variable.md b/examples/2.0.x/server-swift/examples/functions/update-variable.md new file mode 100644 index 000000000..829e7fb5b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/update-variable.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let variable = try await functions.updateVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", // optional + value: "<VALUE>", // optional + secret: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/functions/update.md b/examples/2.0.x/server-swift/examples/functions/update.md new file mode 100644 index 000000000..37a471e1e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/functions/update.md @@ -0,0 +1,37 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let function = try await functions.update( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: .node145, // optional + execute: ["any"], // optional + events: [], // optional + schedule: "0 0 * * *", // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>", // optional + scopes: [.projectRead], // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/graphql/mutation.md b/examples/2.0.x/server-swift/examples/graphql/mutation.md new file mode 100644 index 000000000..9c3cf1168 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/graphql/mutation.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let graphql = Graphql(client) + +let any = try await graphql.mutation( + query: [:] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/graphql/query.md b/examples/2.0.x/server-swift/examples/graphql/query.md new file mode 100644 index 000000000..9ce16dcc7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/graphql/query.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let graphql = Graphql(client) + +let any = try await graphql.query( + query: [:] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/locale/get.md b/examples/2.0.x/server-swift/examples/locale/get.md new file mode 100644 index 000000000..ca305c0dc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/locale/get.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let locale = try await locale.get() + +``` diff --git a/examples/2.0.x/server-swift/examples/locale/list-codes.md b/examples/2.0.x/server-swift/examples/locale/list-codes.md new file mode 100644 index 000000000..dd0f9fb63 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/locale/list-codes.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let localeCodeList = try await locale.listCodes() + +``` diff --git a/examples/2.0.x/server-swift/examples/locale/list-continents.md b/examples/2.0.x/server-swift/examples/locale/list-continents.md new file mode 100644 index 000000000..f37daceff --- /dev/null +++ b/examples/2.0.x/server-swift/examples/locale/list-continents.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let continentList = try await locale.listContinents() + +``` diff --git a/examples/2.0.x/server-swift/examples/locale/list-countries-eu.md b/examples/2.0.x/server-swift/examples/locale/list-countries-eu.md new file mode 100644 index 000000000..b858b31d9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/locale/list-countries-eu.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let countryList = try await locale.listCountriesEU() + +``` diff --git a/examples/2.0.x/server-swift/examples/locale/list-countries-phones.md b/examples/2.0.x/server-swift/examples/locale/list-countries-phones.md new file mode 100644 index 000000000..739c490ba --- /dev/null +++ b/examples/2.0.x/server-swift/examples/locale/list-countries-phones.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let phoneList = try await locale.listCountriesPhones() + +``` diff --git a/examples/2.0.x/server-swift/examples/locale/list-countries.md b/examples/2.0.x/server-swift/examples/locale/list-countries.md new file mode 100644 index 000000000..8aa3bcf75 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/locale/list-countries.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let countryList = try await locale.listCountries() + +``` diff --git a/examples/2.0.x/server-swift/examples/locale/list-currencies.md b/examples/2.0.x/server-swift/examples/locale/list-currencies.md new file mode 100644 index 000000000..d1ce956b6 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/locale/list-currencies.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let currencyList = try await locale.listCurrencies() + +``` diff --git a/examples/2.0.x/server-swift/examples/locale/list-languages.md b/examples/2.0.x/server-swift/examples/locale/list-languages.md new file mode 100644 index 000000000..ed444bf58 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/locale/list-languages.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let languageList = try await locale.listLanguages() + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-apns-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-apns-provider.md new file mode 100644 index 000000000..5330efd9d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-apns-provider.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + authKey: "<AUTH_KEY>", // optional + authKeyId: "<AUTH_KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + bundleId: "<BUNDLE_ID>", // optional + sandbox: false, // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-email.md b/examples/2.0.x/server-swift/examples/messaging/create-email.md new file mode 100644 index 000000000..46322c9c0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-email.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.createEmail( + messageId: "<MESSAGE_ID>", + subject: "<SUBJECT>", + content: "<CONTENT>", + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-fcm-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-fcm-provider.md new file mode 100644 index 000000000..5b80c5ad8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-fcm-provider.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + serviceAccountJSON: [:], // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-mailgun-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-mailgun-provider.md new file mode 100644 index 000000000..03407e5c3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,24 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + domain: "example.com", // optional + isEuRegion: false, // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-msg-91-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-msg-91-provider.md new file mode 100644 index 000000000..674eff6b4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + templateId: "<TEMPLATE_ID>", // optional + senderId: "<SENDER_ID>", // optional + authKey: "<AUTH_KEY>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-push.md b/examples/2.0.x/server-swift/examples/messaging/create-push.md new file mode 100644 index 000000000..e2db2e6de --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-push.md @@ -0,0 +1,34 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.createPush( + messageId: "<MESSAGE_ID>", + title: "<TITLE>", // optional + body: "<BODY>", // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: [:], // optional + action: "<ACTION>", // optional + image: "<ID1:ID2>", // optional + icon: "<ICON>", // optional + sound: "<SOUND>", // optional + color: "<COLOR>", // optional + tag: "<TAG>", // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: .normal // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-resend-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-resend-provider.md new file mode 100644 index 000000000..77a8e24ed --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-resend-provider.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createResendProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-sendgrid-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 000000000..c6046018a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-ses-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-ses-provider.md new file mode 100644 index 000000000..5184d79a2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-ses-provider.md @@ -0,0 +1,24 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createSesProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + accessKey: "<ACCESS_KEY>", // optional + secretKey: "<SECRET_KEY>", // optional + region: "<REGION>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-sms.md b/examples/2.0.x/server-swift/examples/messaging/create-sms.md new file mode 100644 index 000000000..d2a1a7c48 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-sms.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.createSMS( + messageId: "<MESSAGE_ID>", + content: "<CONTENT>", + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-smtp-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-smtp-provider.md new file mode 100644 index 000000000..763770b3f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-smtp-provider.md @@ -0,0 +1,29 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + host: "<HOST>", + port: 587, // optional + username: "<USERNAME>", // optional + password: "password", // optional + encryption: .none, // optional + autoTLS: false, // optional + mailer: "<MAILER>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-subscriber.md b/examples/2.0.x/server-swift/examples/messaging/create-subscriber.md new file mode 100644 index 000000000..124604063 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-subscriber.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>") // Your secret JSON Web Token + +let messaging = Messaging(client) + +let subscriber = try await messaging.createSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>", + targetId: "<TARGET_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-telesign-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-telesign-provider.md new file mode 100644 index 000000000..984ca29df --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-telesign-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + customerId: "<CUSTOMER_ID>", // optional + apiKey: "<API_KEY>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-textmagic-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-textmagic-provider.md new file mode 100644 index 000000000..49a7ae2e7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + username: "<USERNAME>", // optional + apiKey: "<API_KEY>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-topic.md b/examples/2.0.x/server-swift/examples/messaging/create-topic.md new file mode 100644 index 000000000..73abd57a5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-topic.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let topic = try await messaging.createTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", + subscribe: ["any"] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-twilio-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-twilio-provider.md new file mode 100644 index 000000000..0db592229 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-twilio-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + accountSid: "<ACCOUNT_SID>", // optional + authToken: "<AUTH_TOKEN>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/create-vonage-provider.md b/examples/2.0.x/server-swift/examples/messaging/create-vonage-provider.md new file mode 100644 index 000000000..59a592078 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/create-vonage-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/delete-provider.md b/examples/2.0.x/server-swift/examples/messaging/delete-provider.md new file mode 100644 index 000000000..b4ec57801 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/delete-provider.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let result = try await messaging.deleteProvider( + providerId: "<PROVIDER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/delete-subscriber.md b/examples/2.0.x/server-swift/examples/messaging/delete-subscriber.md new file mode 100644 index 000000000..f1b06dede --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/delete-subscriber.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>") // Your secret JSON Web Token + +let messaging = Messaging(client) + +let result = try await messaging.deleteSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/delete-topic.md b/examples/2.0.x/server-swift/examples/messaging/delete-topic.md new file mode 100644 index 000000000..5f6c33ffe --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/delete-topic.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let result = try await messaging.deleteTopic( + topicId: "<TOPIC_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/delete.md b/examples/2.0.x/server-swift/examples/messaging/delete.md new file mode 100644 index 000000000..0c5e13461 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let result = try await messaging.delete( + messageId: "<MESSAGE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/get-message.md b/examples/2.0.x/server-swift/examples/messaging/get-message.md new file mode 100644 index 000000000..ca7b9dd7d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/get-message.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.getMessage( + messageId: "<MESSAGE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/get-provider.md b/examples/2.0.x/server-swift/examples/messaging/get-provider.md new file mode 100644 index 000000000..9331f7bad --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/get-provider.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.getProvider( + providerId: "<PROVIDER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/get-subscriber.md b/examples/2.0.x/server-swift/examples/messaging/get-subscriber.md new file mode 100644 index 000000000..ece8b41f3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/get-subscriber.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let subscriber = try await messaging.getSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/get-topic.md b/examples/2.0.x/server-swift/examples/messaging/get-topic.md new file mode 100644 index 000000000..4f19c7181 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/get-topic.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let topic = try await messaging.getTopic( + topicId: "<TOPIC_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/list-messages.md b/examples/2.0.x/server-swift/examples/messaging/list-messages.md new file mode 100644 index 000000000..e4da82c87 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/list-messages.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let messageList = try await messaging.listMessages( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/list-providers.md b/examples/2.0.x/server-swift/examples/messaging/list-providers.md new file mode 100644 index 000000000..36f83d38d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/list-providers.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let providerList = try await messaging.listProviders( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/list-subscribers.md b/examples/2.0.x/server-swift/examples/messaging/list-subscribers.md new file mode 100644 index 000000000..cc84e6cd7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/list-subscribers.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let subscriberList = try await messaging.listSubscribers( + topicId: "<TOPIC_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/list-targets.md b/examples/2.0.x/server-swift/examples/messaging/list-targets.md new file mode 100644 index 000000000..8927e8853 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/list-targets.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let targetList = try await messaging.listTargets( + messageId: "<MESSAGE_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/list-topics.md b/examples/2.0.x/server-swift/examples/messaging/list-topics.md new file mode 100644 index 000000000..57526d45f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/list-topics.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let topicList = try await messaging.listTopics( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-apns-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-apns-provider.md new file mode 100644 index 000000000..a5a5aa12b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-apns-provider.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + authKey: "<AUTH_KEY>", // optional + authKeyId: "<AUTH_KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + bundleId: "<BUNDLE_ID>", // optional + sandbox: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-email.md b/examples/2.0.x/server-swift/examples/messaging/update-email.md new file mode 100644 index 000000000..3f2fc0c99 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-email.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.updateEmail( + messageId: "<MESSAGE_ID>", + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: "<SUBJECT>", // optional + content: "<CONTENT>", // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional + attachments: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-fcm-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-fcm-provider.md new file mode 100644 index 000000000..bc98b1c9f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-fcm-provider.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + serviceAccountJSON: [:] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-mailgun-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-mailgun-provider.md new file mode 100644 index 000000000..afecdef11 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,24 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + apiKey: "<API_KEY>", // optional + domain: "example.com", // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-msg-91-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-msg-91-provider.md new file mode 100644 index 000000000..adaf9bd14 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + templateId: "<TEMPLATE_ID>", // optional + senderId: "<SENDER_ID>", // optional + authKey: "<AUTH_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-push.md b/examples/2.0.x/server-swift/examples/messaging/update-push.md new file mode 100644 index 000000000..3266d4af4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-push.md @@ -0,0 +1,34 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.updatePush( + messageId: "<MESSAGE_ID>", + topics: [], // optional + users: [], // optional + targets: [], // optional + title: "<TITLE>", // optional + body: "<BODY>", // optional + data: [:], // optional + action: "<ACTION>", // optional + image: "<ID1:ID2>", // optional + icon: "<ICON>", // optional + sound: "<SOUND>", // optional + color: "<COLOR>", // optional + tag: "<TAG>", // optional + badge: 1, // optional + draft: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: .normal // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-resend-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-resend-provider.md new file mode 100644 index 000000000..a36982b2c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-resend-provider.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateResendProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-sendgrid-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 000000000..28b489ac5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-ses-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-ses-provider.md new file mode 100644 index 000000000..3a3b9387d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-ses-provider.md @@ -0,0 +1,24 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateSesProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + accessKey: "<ACCESS_KEY>", // optional + secretKey: "<SECRET_KEY>", // optional + region: "<REGION>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-sms.md b/examples/2.0.x/server-swift/examples/messaging/update-sms.md new file mode 100644 index 000000000..668625ffe --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-sms.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.updateSMS( + messageId: "<MESSAGE_ID>", + topics: [], // optional + users: [], // optional + targets: [], // optional + content: "<CONTENT>", // optional + draft: false, // optional + scheduledAt: "2020-10-15T06:38:00.000+00:00" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-smtp-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-smtp-provider.md new file mode 100644 index 000000000..c9d2a5e5f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-smtp-provider.md @@ -0,0 +1,29 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + host: "<HOST>", // optional + port: 1, // optional + username: "<USERNAME>", // optional + password: "password", // optional + encryption: .none, // optional + autoTLS: false, // optional + mailer: "<MAILER>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-telesign-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-telesign-provider.md new file mode 100644 index 000000000..2ce8a03ea --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-telesign-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + customerId: "<CUSTOMER_ID>", // optional + apiKey: "<API_KEY>", // optional + from: "<FROM>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-textmagic-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-textmagic-provider.md new file mode 100644 index 000000000..b43d55ae1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + username: "<USERNAME>", // optional + apiKey: "<API_KEY>", // optional + from: "<FROM>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-topic.md b/examples/2.0.x/server-swift/examples/messaging/update-topic.md new file mode 100644 index 000000000..4a3cf737f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-topic.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let topic = try await messaging.updateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", // optional + subscribe: ["any"] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-twilio-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-twilio-provider.md new file mode 100644 index 000000000..959f7f9e4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-twilio-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + accountSid: "<ACCOUNT_SID>", // optional + authToken: "<AUTH_TOKEN>", // optional + from: "<FROM>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/messaging/update-vonage-provider.md b/examples/2.0.x/server-swift/examples/messaging/update-vonage-provider.md new file mode 100644 index 000000000..fc1ed2487 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/messaging/update-vonage-provider.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + from: "<FROM>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/organization/create-project.md b/examples/2.0.x/server-swift/examples/organization/create-project.md new file mode 100644 index 000000000..436dc1780 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/organization/create-project.md @@ -0,0 +1,18 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let organization = Organization(client) + +let project = try await organization.createProject( + projectId: "<PROJECT_ID>", + name: "<NAME>", + region: .default // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/organization/delete-project.md b/examples/2.0.x/server-swift/examples/organization/delete-project.md new file mode 100644 index 000000000..4906d7d0b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/organization/delete-project.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let organization = Organization(client) + +let result = try await organization.deleteProject( + projectId: "<PROJECT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/organization/get-project.md b/examples/2.0.x/server-swift/examples/organization/get-project.md new file mode 100644 index 000000000..b0180fb10 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/organization/get-project.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let organization = Organization(client) + +let project = try await organization.getProject( + projectId: "<PROJECT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/organization/list-projects.md b/examples/2.0.x/server-swift/examples/organization/list-projects.md new file mode 100644 index 000000000..b4a93bce5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/organization/list-projects.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let organization = Organization(client) + +let projectList = try await organization.listProjects( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/organization/update-project.md b/examples/2.0.x/server-swift/examples/organization/update-project.md new file mode 100644 index 000000000..63fb44dbf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/organization/update-project.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let organization = Organization(client) + +let project = try await organization.updateProject( + projectId: "<PROJECT_ID>", + name: "<NAME>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/presences/delete.md b/examples/2.0.x/server-swift/examples/presences/delete.md new file mode 100644 index 000000000..80d57c887 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/presences/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let presences = Presences(client) + +let result = try await presences.delete( + presenceId: "<PRESENCE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/presences/get.md b/examples/2.0.x/server-swift/examples/presences/get.md new file mode 100644 index 000000000..802d74f62 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/presences/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let presences = Presences(client) + +let presence = try await presences.get( + presenceId: "<PRESENCE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/presences/list.md b/examples/2.0.x/server-swift/examples/presences/list.md new file mode 100644 index 000000000..1123abd00 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/presences/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let presences = Presences(client) + +let presenceList = try await presences.list( + queries: [], // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/presences/update.md b/examples/2.0.x/server-swift/examples/presences/update.md new file mode 100644 index 000000000..67a993e96 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/presences/update.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let presences = Presences(client) + +let presence = try await presences.update( + presenceId: "<PRESENCE_ID>", + userId: "<USER_ID>", + status: "<STATUS>", // optional + expiresAt: "2020-10-15T06:38:00.000+00:00", // optional + metadata: [:], // optional + permissions: [Permission.read(Role.any())], // optional + purge: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/presences/upsert.md b/examples/2.0.x/server-swift/examples/presences/upsert.md new file mode 100644 index 000000000..edba3b102 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/presences/upsert.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let presences = Presences(client) + +let presence = try await presences.upsert( + presenceId: "<PRESENCE_ID>", + userId: "<USER_ID>", + status: "<STATUS>", + permissions: [Permission.read(Role.any())], // optional + expiresAt: "2020-10-15T06:38:00.000+00:00", // optional + metadata: [:] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-android-platform.md b/examples/2.0.x/server-swift/examples/project/create-android-platform.md new file mode 100644 index 000000000..c024b4222 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-android-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformAndroid = try await project.createAndroidPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + applicationId: "<APPLICATION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-apple-platform.md b/examples/2.0.x/server-swift/examples/project/create-apple-platform.md new file mode 100644 index 000000000..88556791d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-apple-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformApple = try await project.createApplePlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + bundleIdentifier: "<BUNDLE_IDENTIFIER>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-ephemeral-key.md b/examples/2.0.x/server-swift/examples/project/create-ephemeral-key.md new file mode 100644 index 000000000..c4310ecf7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-ephemeral-key.md @@ -0,0 +1,17 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let ephemeralKey = try await project.createEphemeralKey( + scopes: [.projectRead], + duration: 600 +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-linux-platform.md b/examples/2.0.x/server-swift/examples/project/create-linux-platform.md new file mode 100644 index 000000000..276eea1a9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-linux-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformLinux = try await project.createLinuxPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageName: "<PACKAGE_NAME>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-mock-phone.md b/examples/2.0.x/server-swift/examples/project/create-mock-phone.md new file mode 100644 index 000000000..d55045e52 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-mock-phone.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let mockNumber = try await project.createMockPhone( + number: "+12065550100", + otp: "<OTP>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-smtp-test.md b/examples/2.0.x/server-swift/examples/project/create-smtp-test.md new file mode 100644 index 000000000..7f58a2797 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-smtp-test.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.createSMTPTest( + emails: [] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-variable.md b/examples/2.0.x/server-swift/examples/project/create-variable.md new file mode 100644 index 000000000..f9a6c3999 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-variable.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let variable = try await project.createVariable( + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-web-platform.md b/examples/2.0.x/server-swift/examples/project/create-web-platform.md new file mode 100644 index 000000000..4623c92a2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-web-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformWeb = try await project.createWebPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + hostname: "app.example.com" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/create-windows-platform.md b/examples/2.0.x/server-swift/examples/project/create-windows-platform.md new file mode 100644 index 000000000..764da9d02 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/create-windows-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformWindows = try await project.createWindowsPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageIdentifierName: "<PACKAGE_IDENTIFIER_NAME>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/delete-key.md b/examples/2.0.x/server-swift/examples/project/delete-key.md new file mode 100644 index 000000000..4552cc726 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/delete-key.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.deleteKey( + keyId: "<KEY_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/delete-mock-phone.md b/examples/2.0.x/server-swift/examples/project/delete-mock-phone.md new file mode 100644 index 000000000..b7276924a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/delete-mock-phone.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.deleteMockPhone( + number: "+12065550100" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/delete-platform.md b/examples/2.0.x/server-swift/examples/project/delete-platform.md new file mode 100644 index 000000000..744ca26bf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/delete-platform.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.deletePlatform( + platformId: "<PLATFORM_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/delete-variable.md b/examples/2.0.x/server-swift/examples/project/delete-variable.md new file mode 100644 index 000000000..e9fc657d2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/delete-variable.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.deleteVariable( + variableId: "<VARIABLE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/delete.md b/examples/2.0.x/server-swift/examples/project/delete.md new file mode 100644 index 000000000..e21a359a3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/delete.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.delete() + +``` diff --git a/examples/2.0.x/server-swift/examples/project/get-email-template.md b/examples/2.0.x/server-swift/examples/project/get-email-template.md new file mode 100644 index 000000000..7d32751a8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/get-email-template.md @@ -0,0 +1,17 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let emailTemplate = try await project.getEmailTemplate( + templateId: .verification, + locale: .af // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/get-key.md b/examples/2.0.x/server-swift/examples/project/get-key.md new file mode 100644 index 000000000..d988df3cc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/get-key.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let key = try await project.getKey( + keyId: "<KEY_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/get-mock-phone.md b/examples/2.0.x/server-swift/examples/project/get-mock-phone.md new file mode 100644 index 000000000..c37f50f95 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/get-mock-phone.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let mockNumber = try await project.getMockPhone( + number: "+12065550100" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/get-o-auth-2-provider.md b/examples/2.0.x/server-swift/examples/project/get-o-auth-2-provider.md new file mode 100644 index 000000000..3fc503cdf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,16 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.getOAuth2Provider( + providerId: .amazon +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/get-platform.md b/examples/2.0.x/server-swift/examples/project/get-platform.md new file mode 100644 index 000000000..407f92fd1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/get-platform.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.getPlatform( + platformId: "<PLATFORM_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/get-policy.md b/examples/2.0.x/server-swift/examples/project/get-policy.md new file mode 100644 index 000000000..56a46ff13 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/get-policy.md @@ -0,0 +1,16 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let result = try await project.getPolicy( + policyId: .passwordDictionary +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/get-variable.md b/examples/2.0.x/server-swift/examples/project/get-variable.md new file mode 100644 index 000000000..33b8c9695 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/get-variable.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let variable = try await project.getVariable( + variableId: "<VARIABLE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/get.md b/examples/2.0.x/server-swift/examples/project/get.md new file mode 100644 index 000000000..6302f484a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/get.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.get() + +``` diff --git a/examples/2.0.x/server-swift/examples/project/list-email-templates.md b/examples/2.0.x/server-swift/examples/project/list-email-templates.md new file mode 100644 index 000000000..e135eb231 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/list-email-templates.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let emailTemplateList = try await project.listEmailTemplates( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/list-keys.md b/examples/2.0.x/server-swift/examples/project/list-keys.md new file mode 100644 index 000000000..ad3eb7e55 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/list-keys.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let keyList = try await project.listKeys( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/list-mock-phones.md b/examples/2.0.x/server-swift/examples/project/list-mock-phones.md new file mode 100644 index 000000000..5a1119297 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/list-mock-phones.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let mockNumberList = try await project.listMockPhones( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/list-o-auth-2-providers.md b/examples/2.0.x/server-swift/examples/project/list-o-auth-2-providers.md new file mode 100644 index 000000000..06b53932f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2ProviderList = try await project.listOAuth2Providers( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/list-platforms.md b/examples/2.0.x/server-swift/examples/project/list-platforms.md new file mode 100644 index 000000000..c4d8d038d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/list-platforms.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformList = try await project.listPlatforms( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/list-policies.md b/examples/2.0.x/server-swift/examples/project/list-policies.md new file mode 100644 index 000000000..5dd4fc41c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/list-policies.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let policyList = try await project.listPolicies( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/list-variables.md b/examples/2.0.x/server-swift/examples/project/list-variables.md new file mode 100644 index 000000000..fd6d6a03f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/list-variables.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let variableList = try await project.listVariables( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-android-platform.md b/examples/2.0.x/server-swift/examples/project/update-android-platform.md new file mode 100644 index 000000000..e881bfece --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-android-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformAndroid = try await project.updateAndroidPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + applicationId: "<APPLICATION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-apple-platform.md b/examples/2.0.x/server-swift/examples/project/update-apple-platform.md new file mode 100644 index 000000000..8e4bdcb2b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-apple-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformApple = try await project.updateApplePlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + bundleIdentifier: "<BUNDLE_IDENTIFIER>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-auth-method.md b/examples/2.0.x/server-swift/examples/project/update-auth-method.md new file mode 100644 index 000000000..1512ab09b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-auth-method.md @@ -0,0 +1,17 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateAuthMethod( + methodId: .emailPassword, + enabled: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-email-template.md b/examples/2.0.x/server-swift/examples/project/update-email-template.md new file mode 100644 index 000000000..917e169cb --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-email-template.md @@ -0,0 +1,23 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let emailTemplate = try await project.updateEmailTemplate( + templateId: .verification, + locale: .af, // optional + subject: "<SUBJECT>", // optional + message: "<MESSAGE>", // optional + senderName: "<SENDER_NAME>", // optional + senderEmail: "email@example.com", // optional + replyToEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-key.md b/examples/2.0.x/server-swift/examples/project/update-key.md new file mode 100644 index 000000000..b94b74f13 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-key.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let key = try await project.updateKey( + keyId: "<KEY_ID>", + name: "<NAME>", + scopes: [.projectRead], + expire: "2020-10-15T06:38:00.000+00:00" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-labels.md b/examples/2.0.x/server-swift/examples/project/update-labels.md new file mode 100644 index 000000000..fe290de25 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-labels.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateLabels( + labels: [] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-linux-platform.md b/examples/2.0.x/server-swift/examples/project/update-linux-platform.md new file mode 100644 index 000000000..6d079a677 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-linux-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformLinux = try await project.updateLinuxPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageName: "<PACKAGE_NAME>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-membership-privacy-policy.md b/examples/2.0.x/server-swift/examples/project/update-membership-privacy-policy.md new file mode 100644 index 000000000..70c29fc5a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateMembershipPrivacyPolicy( + userId: false, // optional + userEmail: false, // optional + userPhone: false, // optional + userName: false, // optional + userMFA: false, // optional + userAccessedAt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-mfa-factors-policy.md b/examples/2.0.x/server-swift/examples/project/update-mfa-factors-policy.md new file mode 100644 index 000000000..73b1652e1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-mfa-factors-policy.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateMFAFactorsPolicy( + totp: false, // optional + email: false, // optional + phone: false, // optional + custom: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-mock-phone.md b/examples/2.0.x/server-swift/examples/project/update-mock-phone.md new file mode 100644 index 000000000..4181189b3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-mock-phone.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let mockNumber = try await project.updateMockPhone( + number: "+12065550100", + otp: "<OTP>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-amazon.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 000000000..729f57b2e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Amazon = try await project.updateOAuth2Amazon( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-apple.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-apple.md new file mode 100644 index 000000000..9a5e4a23f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Apple = try await project.updateOAuth2Apple( + serviceId: "<SERVICE_ID>", // optional + keyId: "<KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + p8File: "<P8_FILE>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-appwrite.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-appwrite.md new file mode 100644 index 000000000..6af65dfd3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-appwrite.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Appwrite = try await project.updateOAuth2Appwrite( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-auth-0.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 000000000..32fa12df4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Auth0 = try await project.updateOAuth2Auth0( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + endpoint: "<ENDPOINT>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-authentik.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 000000000..e627e0e36 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Authentik = try await project.updateOAuth2Authentik( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + endpoint: "<ENDPOINT>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-autodesk.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 000000000..a20dc1a0b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Autodesk = try await project.updateOAuth2Autodesk( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-bitbucket.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 000000000..d147529b3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Bitbucket = try await project.updateOAuth2Bitbucket( + key: "<KEY>", // optional + secret: "<SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-bitly.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 000000000..5d4e87c98 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Bitly = try await project.updateOAuth2Bitly( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-box.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-box.md new file mode 100644 index 000000000..9a11d94d3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-box.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Box = try await project.updateOAuth2Box( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-cloudflare.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-cloudflare.md new file mode 100644 index 000000000..fc092bb9d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-cloudflare.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Cloudflare = try await project.updateOAuth2Cloudflare( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-dailymotion.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 000000000..598ae75eb --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Dailymotion = try await project.updateOAuth2Dailymotion( + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-discord.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-discord.md new file mode 100644 index 000000000..bdab08003 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Discord = try await project.updateOAuth2Discord( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-disqus.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 000000000..ec7f71955 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Disqus = try await project.updateOAuth2Disqus( + publicKey: "<PUBLIC_KEY>", // optional + secretKey: "<SECRET_KEY>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-dropbox.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 000000000..81a1fde31 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Dropbox = try await project.updateOAuth2Dropbox( + appKey: "<APP_KEY>", // optional + appSecret: "<APP_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-etsy.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 000000000..252eb52eb --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Etsy = try await project.updateOAuth2Etsy( + keyString: "<KEY_STRING>", // optional + sharedSecret: "<SHARED_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-facebook.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 000000000..b2775c8af --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Facebook = try await project.updateOAuth2Facebook( + appId: "<APP_ID>", // optional + appSecret: "<APP_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-figma.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-figma.md new file mode 100644 index 000000000..a29c713d1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Figma = try await project.updateOAuth2Figma( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-fusion-auth.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 000000000..64adf24f5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2FusionAuth = try await project.updateOAuth2FusionAuth( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + endpoint: "<ENDPOINT>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-git-hub.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 000000000..3a31b270c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Github = try await project.updateOAuth2GitHub( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-gitlab.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 000000000..35fd4da04 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Gitlab = try await project.updateOAuth2Gitlab( + applicationId: "<APPLICATION_ID>", // optional + secret: "<SECRET>", // optional + endpoint: "https://example.com", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-google.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-google.md new file mode 100644 index 000000000..49309b242 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-google.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Google = try await project.updateOAuth2Google( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + prompt: [.none], // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-hugging-face.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 000000000..7c0750e03 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2HuggingFace = try await project.updateOAuth2HuggingFace( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-keycloak.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 000000000..90f37c1c1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Keycloak = try await project.updateOAuth2Keycloak( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + endpoint: "<ENDPOINT>", // optional + realmName: "<REALM_NAME>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-kick.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-kick.md new file mode 100644 index 000000000..091f4651e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Kick = try await project.updateOAuth2Kick( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-linkedin.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 000000000..5045d05aa --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Linkedin = try await project.updateOAuth2Linkedin( + clientId: "<CLIENT_ID>", // optional + primaryClientSecret: "<PRIMARY_CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-microsoft.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 000000000..1ec4428ba --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Microsoft = try await project.updateOAuth2Microsoft( + applicationId: "<APPLICATION_ID>", // optional + applicationSecret: "<APPLICATION_SECRET>", // optional + tenant: "<TENANT>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-notion.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-notion.md new file mode 100644 index 000000000..531a55591 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Notion = try await project.updateOAuth2Notion( + oauthClientId: "<OAUTH_CLIENT_ID>", // optional + oauthClientSecret: "<OAUTH_CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-oidc.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 000000000..8fe0ed2c3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,24 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Oidc = try await project.updateOAuth2Oidc( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + wellKnownURL: "https://example.com", // optional + authorizationURL: "https://example.com", // optional + tokenURL: "https://example.com", // optional + userInfoURL: "https://example.com", // optional + prompt: [.none], // optional + maxAge: 0, // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-okta.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-okta.md new file mode 100644 index 000000000..51331bee7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Okta = try await project.updateOAuth2Okta( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + domain: "example.com", // optional + authorizationServerId: "<AUTHORIZATION_SERVER_ID>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-paypal-sandbox.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 000000000..148ac7c30 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Paypal = try await project.updateOAuth2PaypalSandbox( + clientId: "<CLIENT_ID>", // optional + secretKey: "<SECRET_KEY>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-paypal.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 000000000..893314fb9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Paypal = try await project.updateOAuth2Paypal( + clientId: "<CLIENT_ID>", // optional + secretKey: "<SECRET_KEY>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-podio.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-podio.md new file mode 100644 index 000000000..489d1b47a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Podio = try await project.updateOAuth2Podio( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-resend.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-resend.md new file mode 100644 index 000000000..5c16e7d11 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-resend.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Resend = try await project.updateOAuth2Resend( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-salesforce.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 000000000..65eb7468b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Salesforce = try await project.updateOAuth2Salesforce( + customerKey: "<CUSTOMER_KEY>", // optional + customerSecret: "<CUSTOMER_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-slack.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-slack.md new file mode 100644 index 000000000..b60e30216 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Slack = try await project.updateOAuth2Slack( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-spotify.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 000000000..6d7570eec --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Spotify = try await project.updateOAuth2Spotify( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-stripe.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 000000000..a600e6f99 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Stripe = try await project.updateOAuth2Stripe( + clientId: "<CLIENT_ID>", // optional + apiSecretKey: "<API_SECRET_KEY>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-tradeshift-sandbox.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 000000000..bbfad0edf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Tradeshift = try await project.updateOAuth2TradeshiftSandbox( + oauth2ClientId: "<OAUTH2_CLIENT_ID>", // optional + oauth2ClientSecret: "<OAUTH2_CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-tradeshift.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 000000000..83f93be73 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Tradeshift = try await project.updateOAuth2Tradeshift( + oauth2ClientId: "<OAUTH2_CLIENT_ID>", // optional + oauth2ClientSecret: "<OAUTH2_CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-twitch.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 000000000..b2bcda440 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Twitch = try await project.updateOAuth2Twitch( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-word-press.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 000000000..0025d2e5c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2WordPress = try await project.updateOAuth2WordPress( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-yahoo.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 000000000..dd6bb966f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Yahoo = try await project.updateOAuth2Yahoo( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-yandex.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 000000000..0aa910d35 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Yandex = try await project.updateOAuth2Yandex( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-zoho.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 000000000..db4f04043 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Zoho = try await project.updateOAuth2Zoho( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2-zoom.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 000000000..2adc273c8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2Zoom = try await project.updateOAuth2Zoom( + clientId: "<CLIENT_ID>", // optional + clientSecret: "<CLIENT_SECRET>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-o-auth-2x.md b/examples/2.0.x/server-swift/examples/project/update-o-auth-2x.md new file mode 100644 index 000000000..e04f13b25 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-o-auth-2x.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let oAuth2X = try await project.updateOAuth2X( + customerKey: "<CUSTOMER_KEY>", // optional + secretKey: "<SECRET_KEY>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-password-dictionary-policy.md b/examples/2.0.x/server-swift/examples/project/update-password-dictionary-policy.md new file mode 100644 index 000000000..dd32d0e74 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updatePasswordDictionaryPolicy( + enabled: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-password-history-policy.md b/examples/2.0.x/server-swift/examples/project/update-password-history-policy.md new file mode 100644 index 000000000..8c864e9cc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-password-history-policy.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updatePasswordHistoryPolicy( + total: 1 +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-password-personal-data-policy.md b/examples/2.0.x/server-swift/examples/project/update-password-personal-data-policy.md new file mode 100644 index 000000000..155a9fa73 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updatePasswordPersonalDataPolicy( + enabled: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-password-strength-policy.md b/examples/2.0.x/server-swift/examples/project/update-password-strength-policy.md new file mode 100644 index 000000000..57b127903 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-password-strength-policy.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let policyPasswordStrength = try await project.updatePasswordStrengthPolicy( + min: 8, // optional + uppercase: false, // optional + lowercase: false, // optional + number: false, // optional + symbols: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-protocol.md b/examples/2.0.x/server-swift/examples/project/update-protocol.md new file mode 100644 index 000000000..e2b7637f6 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-protocol.md @@ -0,0 +1,17 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateProtocol( + protocolId: .rest, + enabled: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-service.md b/examples/2.0.x/server-swift/examples/project/update-service.md new file mode 100644 index 000000000..fc4edf817 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-service.md @@ -0,0 +1,17 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateService( + serviceId: .account, + enabled: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-session-alert-policy.md b/examples/2.0.x/server-swift/examples/project/update-session-alert-policy.md new file mode 100644 index 000000000..b6391d595 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-session-alert-policy.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateSessionAlertPolicy( + enabled: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-session-duration-policy.md b/examples/2.0.x/server-swift/examples/project/update-session-duration-policy.md new file mode 100644 index 000000000..1463c84a1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-session-duration-policy.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateSessionDurationPolicy( + duration: 60 +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-session-invalidation-policy.md b/examples/2.0.x/server-swift/examples/project/update-session-invalidation-policy.md new file mode 100644 index 000000000..c7ae97a54 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateSessionInvalidationPolicy( + enabled: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-session-limit-policy.md b/examples/2.0.x/server-swift/examples/project/update-session-limit-policy.md new file mode 100644 index 000000000..bbff0f750 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-session-limit-policy.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateSessionLimitPolicy( + total: 1 +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-smtp.md b/examples/2.0.x/server-swift/examples/project/update-smtp.md new file mode 100644 index 000000000..4bee4d119 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-smtp.md @@ -0,0 +1,25 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateSMTP( + host: "example.com", // optional + port: 587, // optional + username: "<USERNAME>", // optional + password: "password", // optional + senderEmail: "email@example.com", // optional + senderName: "<SENDER_NAME>", // optional + replyToEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + secure: .tls, // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-user-limit-policy.md b/examples/2.0.x/server-swift/examples/project/update-user-limit-policy.md new file mode 100644 index 000000000..e8080b6a8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-user-limit-policy.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let project = try await project.updateUserLimitPolicy( + total: 0 +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-variable.md b/examples/2.0.x/server-swift/examples/project/update-variable.md new file mode 100644 index 000000000..a7df7adad --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-variable.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let variable = try await project.updateVariable( + variableId: "<VARIABLE_ID>", + key: "<KEY>", // optional + value: "<VALUE>", // optional + secret: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-web-platform.md b/examples/2.0.x/server-swift/examples/project/update-web-platform.md new file mode 100644 index 000000000..3e78f60e5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-web-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformWeb = try await project.updateWebPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + hostname: "app.example.com" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/project/update-windows-platform.md b/examples/2.0.x/server-swift/examples/project/update-windows-platform.md new file mode 100644 index 000000000..26b028f26 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/project/update-windows-platform.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let project = Project(client) + +let platformWindows = try await project.updateWindowsPlatform( + platformId: "<PLATFORM_ID>", + name: "<NAME>", + packageIdentifierName: "<PACKAGE_IDENTIFIER_NAME>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/proxy/create-api-rule.md b/examples/2.0.x/server-swift/examples/proxy/create-api-rule.md new file mode 100644 index 000000000..38671549c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/proxy/create-api-rule.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let proxy = Proxy(client) + +let proxyRule = try await proxy.createAPIRule( + domain: "example.com" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/proxy/create-function-rule.md b/examples/2.0.x/server-swift/examples/proxy/create-function-rule.md new file mode 100644 index 000000000..b7d074fd4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/proxy/create-function-rule.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let proxy = Proxy(client) + +let proxyRule = try await proxy.createFunctionRule( + domain: "example.com", + functionId: "<FUNCTION_ID>", + branch: "<BRANCH>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/proxy/create-redirect-rule.md b/examples/2.0.x/server-swift/examples/proxy/create-redirect-rule.md new file mode 100644 index 000000000..ba2b280dc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/proxy/create-redirect-rule.md @@ -0,0 +1,20 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let proxy = Proxy(client) + +let proxyRule = try await proxy.createRedirectRule( + domain: "example.com", + url: "https://example.com", + statusCode: .movedPermanently, + resourceId: "<RESOURCE_ID>", + resourceType: .site +) + +``` diff --git a/examples/2.0.x/server-swift/examples/proxy/create-site-rule.md b/examples/2.0.x/server-swift/examples/proxy/create-site-rule.md new file mode 100644 index 000000000..f03efbe5c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/proxy/create-site-rule.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let proxy = Proxy(client) + +let proxyRule = try await proxy.createSiteRule( + domain: "example.com", + siteId: "<SITE_ID>", + branch: "<BRANCH>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/proxy/delete-rule.md b/examples/2.0.x/server-swift/examples/proxy/delete-rule.md new file mode 100644 index 000000000..019361f8a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/proxy/delete-rule.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let proxy = Proxy(client) + +let result = try await proxy.deleteRule( + ruleId: "<RULE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/proxy/get-rule.md b/examples/2.0.x/server-swift/examples/proxy/get-rule.md new file mode 100644 index 000000000..0a91b3cf7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/proxy/get-rule.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let proxy = Proxy(client) + +let proxyRule = try await proxy.getRule( + ruleId: "<RULE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/proxy/list-rules.md b/examples/2.0.x/server-swift/examples/proxy/list-rules.md new file mode 100644 index 000000000..bb252ac88 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/proxy/list-rules.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let proxy = Proxy(client) + +let proxyRuleList = try await proxy.listRules( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/proxy/update-rule-status.md b/examples/2.0.x/server-swift/examples/proxy/update-rule-status.md new file mode 100644 index 000000000..fc65fbfab --- /dev/null +++ b/examples/2.0.x/server-swift/examples/proxy/update-rule-status.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let proxy = Proxy(client) + +let proxyRule = try await proxy.updateRuleStatus( + ruleId: "<RULE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/create-deployment.md b/examples/2.0.x/server-swift/examples/sites/create-deployment.md new file mode 100644 index 000000000..9dd28d874 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/create-deployment.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createDeployment( + siteId: "<SITE_ID>", + code: InputFile.fromPath("file.png"), + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + activate: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/create-duplicate-deployment.md b/examples/2.0.x/server-swift/examples/sites/create-duplicate-deployment.md new file mode 100644 index 000000000..713f301c8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createDuplicateDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/create-template-deployment.md b/examples/2.0.x/server-swift/examples/sites/create-template-deployment.md new file mode 100644 index 000000000..3bd90c077 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/create-template-deployment.md @@ -0,0 +1,22 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createTemplateDeployment( + siteId: "<SITE_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + type: .branch, + reference: "<REFERENCE>", + activate: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/create-variable.md b/examples/2.0.x/server-swift/examples/sites/create-variable.md new file mode 100644 index 000000000..12f8beb62 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/create-variable.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.createVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/create-vcs-deployment.md b/examples/2.0.x/server-swift/examples/sites/create-vcs-deployment.md new file mode 100644 index 000000000..aac865a02 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/create-vcs-deployment.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createVcsDeployment( + siteId: "<SITE_ID>", + type: .branch, + reference: "<REFERENCE>", + activate: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/create.md b/examples/2.0.x/server-swift/examples/sites/create.md new file mode 100644 index 000000000..2bcf4a707 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/create.md @@ -0,0 +1,39 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.create( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: .analog, + buildRuntime: .node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + startCommand: "<START_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + adapter: .static, // optional + installationId: "<INSTALLATION_ID>", // optional + fallbackFile: "<FALLBACK_FILE>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0, // optional + scopes: [.projectRead] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/delete-deployment.md b/examples/2.0.x/server-swift/examples/sites/delete-deployment.md new file mode 100644 index 000000000..018be7a4b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/delete-deployment.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/delete-log.md b/examples/2.0.x/server-swift/examples/sites/delete-log.md new file mode 100644 index 000000000..2b88a5650 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/delete-log.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/delete-variable.md b/examples/2.0.x/server-swift/examples/sites/delete-variable.md new file mode 100644 index 000000000..513b8232e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/delete-variable.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/delete.md b/examples/2.0.x/server-swift/examples/sites/delete.md new file mode 100644 index 000000000..c71618cf7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.delete( + siteId: "<SITE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/get-deployment-download.md b/examples/2.0.x/server-swift/examples/sites/get-deployment-download.md new file mode 100644 index 000000000..d3e391ccd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/get-deployment-download.md @@ -0,0 +1,19 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let bytes = try await sites.getDeploymentDownload( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: .source, // optional + token: "<TOKEN>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/get-deployment.md b/examples/2.0.x/server-swift/examples/sites/get-deployment.md new file mode 100644 index 000000000..03413bb40 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/get-deployment.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.getDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/get-log.md b/examples/2.0.x/server-swift/examples/sites/get-log.md new file mode 100644 index 000000000..608a2611a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/get-log.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let execution = try await sites.getLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/get-variable.md b/examples/2.0.x/server-swift/examples/sites/get-variable.md new file mode 100644 index 000000000..4f22a1905 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/get-variable.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.getVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/get.md b/examples/2.0.x/server-swift/examples/sites/get.md new file mode 100644 index 000000000..be7ab735d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.get( + siteId: "<SITE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/list-deployments.md b/examples/2.0.x/server-swift/examples/sites/list-deployments.md new file mode 100644 index 000000000..3427c09f3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/list-deployments.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deploymentList = try await sites.listDeployments( + siteId: "<SITE_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/list-frameworks.md b/examples/2.0.x/server-swift/examples/sites/list-frameworks.md new file mode 100644 index 000000000..f4fe3a699 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/list-frameworks.md @@ -0,0 +1,13 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let frameworkList = try await sites.listFrameworks() + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/list-logs.md b/examples/2.0.x/server-swift/examples/sites/list-logs.md new file mode 100644 index 000000000..bc532302e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/list-logs.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let executionList = try await sites.listLogs( + siteId: "<SITE_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/list-specifications.md b/examples/2.0.x/server-swift/examples/sites/list-specifications.md new file mode 100644 index 000000000..a75edd555 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/list-specifications.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let specificationList = try await sites.listSpecifications( + type: "runtimes" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/list-variables.md b/examples/2.0.x/server-swift/examples/sites/list-variables.md new file mode 100644 index 000000000..a32762a53 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/list-variables.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let variableList = try await sites.listVariables( + siteId: "<SITE_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/list.md b/examples/2.0.x/server-swift/examples/sites/list.md new file mode 100644 index 000000000..9d5f7763f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let siteList = try await sites.list( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/update-deployment-status.md b/examples/2.0.x/server-swift/examples/sites/update-deployment-status.md new file mode 100644 index 000000000..4b9364be2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/update-deployment-status.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.updateDeploymentStatus( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/update-site-deployment.md b/examples/2.0.x/server-swift/examples/sites/update-site-deployment.md new file mode 100644 index 000000000..880060d0b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/update-site-deployment.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.updateSiteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/update-variable.md b/examples/2.0.x/server-swift/examples/sites/update-variable.md new file mode 100644 index 000000000..a79f3a4bb --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/update-variable.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.updateVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", // optional + value: "<VALUE>", // optional + secret: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/sites/update.md b/examples/2.0.x/server-swift/examples/sites/update.md new file mode 100644 index 000000000..1cb9a5d25 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/sites/update.md @@ -0,0 +1,39 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.update( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: .analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + startCommand: "<START_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + buildRuntime: .node145, // optional + adapter: .static, // optional + fallbackFile: "<FALLBACK_FILE>", // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + providerBranches: [], // optional + providerPaths: [], // optional + buildSpecification: "s-1vcpu-512mb", // optional + runtimeSpecification: "s-1vcpu-512mb", // optional + deploymentRetention: 0, // optional + scopes: [.projectRead] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/create-bucket.md b/examples/2.0.x/server-swift/examples/storage/create-bucket.md new file mode 100644 index 000000000..89ccc8e43 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/create-bucket.md @@ -0,0 +1,26 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let bucket = try await storage.createBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: [Permission.read(Role.any())], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .none, // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/create-file.md b/examples/2.0.x/server-swift/examples/storage/create-file.md new file mode 100644 index 000000000..fb714398c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/create-file.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let file = try await storage.createFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + file: InputFile.fromPath("file.png"), + permissions: [Permission.read(Role.any())], // optional + folder: "photos/2026" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/delete-bucket.md b/examples/2.0.x/server-swift/examples/storage/delete-bucket.md new file mode 100644 index 000000000..43c58231f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/delete-bucket.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let result = try await storage.deleteBucket( + bucketId: "<BUCKET_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/delete-file.md b/examples/2.0.x/server-swift/examples/storage/delete-file.md new file mode 100644 index 000000000..2f6295244 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/delete-file.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let result = try await storage.deleteFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/get-bucket.md b/examples/2.0.x/server-swift/examples/storage/get-bucket.md new file mode 100644 index 000000000..e261e7b69 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/get-bucket.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let bucket = try await storage.getBucket( + bucketId: "<BUCKET_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/get-file-download.md b/examples/2.0.x/server-swift/examples/storage/get-file-download.md new file mode 100644 index 000000000..2efb755f7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/get-file-download.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let bytes = try await storage.getFileDownload( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/get-file-preview.md b/examples/2.0.x/server-swift/examples/storage/get-file-preview.md new file mode 100644 index 000000000..436af624f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/get-file-preview.md @@ -0,0 +1,29 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let bytes = try await storage.getFilePreview( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + width: 0, // optional + height: 0, // optional + gravity: .center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: "FFFFFF", // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: "FFFFFF", // optional + output: .jpg, // optional + token: "<TOKEN>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/get-file-view.md b/examples/2.0.x/server-swift/examples/storage/get-file-view.md new file mode 100644 index 000000000..df514f7e4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/get-file-view.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let bytes = try await storage.getFileView( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/get-file.md b/examples/2.0.x/server-swift/examples/storage/get-file.md new file mode 100644 index 000000000..36b999cff --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/get-file.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let file = try await storage.getFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/list-buckets.md b/examples/2.0.x/server-swift/examples/storage/list-buckets.md new file mode 100644 index 000000000..86e84bd34 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/list-buckets.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let bucketList = try await storage.listBuckets( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/list-files.md b/examples/2.0.x/server-swift/examples/storage/list-files.md new file mode 100644 index 000000000..7102270f3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/list-files.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let fileList = try await storage.listFiles( + bucketId: "<BUCKET_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/update-bucket.md b/examples/2.0.x/server-swift/examples/storage/update-bucket.md new file mode 100644 index 000000000..a5b66e39f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/update-bucket.md @@ -0,0 +1,26 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let bucket = try await storage.updateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: [Permission.read(Role.any())], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .none, // optional + encryption: false, // optional + antivirus: false, // optional + transformations: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/storage/update-file.md b/examples/2.0.x/server-swift/examples/storage/update-file.md new file mode 100644 index 000000000..aa02fd86f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/storage/update-file.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let file = try await storage.updateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + name: "<NAME>", // optional + permissions: [Permission.read(Role.any())] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-big-int-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-big-int-column.md new file mode 100644 index 000000000..e00c1f02c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnBigint = try await tablesDB.createBigIntColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 1000000, // optional + default: 0, // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-boolean-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-boolean-column.md new file mode 100644 index 000000000..34774998e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnBoolean = try await tablesDB.createBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: false, // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-datetime-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-datetime-column.md new file mode 100644 index 000000000..52f91f641 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnDatetime = try await tablesDB.createDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-email-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-email-column.md new file mode 100644 index 000000000..46ea4b22a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-email-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnEmail = try await tablesDB.createEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-enum-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-enum-column.md new file mode 100644 index 000000000..277e46b9d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-enum-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnEnum = try await tablesDB.createEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-float-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-float-column.md new file mode 100644 index 000000000..54146f430 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-float-column.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnFloat = try await tablesDB.createFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 100, // optional + default: 10.5, // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-index.md b/examples/2.0.x/server-swift/examples/tablesdb/create-index.md new file mode 100644 index 000000000..ae3723efc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-index.md @@ -0,0 +1,22 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIndex = try await tablesDB.createIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + type: .key, + columns: [], + orders: [.asc], // optional + lengths: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-integer-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-integer-column.md new file mode 100644 index 000000000..4d1dca993 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-integer-column.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnInteger = try await tablesDB.createIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + min: 0, // optional + max: 100, // optional + default: 10, // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-ip-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-ip-column.md new file mode 100644 index 000000000..da8c34979 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-ip-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIp = try await tablesDB.createIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-line-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-line-column.md new file mode 100644 index 000000000..f62782d67 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-line-column.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnLine = try await tablesDB.createLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-longtext-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-longtext-column.md new file mode 100644 index 000000000..85152c302 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-longtext-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnLongtext = try await tablesDB.createLongtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-mediumtext-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-mediumtext-column.md new file mode 100644 index 000000000..f32f56299 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-mediumtext-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnMediumtext = try await tablesDB.createMediumtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-operations.md b/examples/2.0.x/server-swift/examples/tablesdb/create-operations.md new file mode 100644 index 000000000..3f673a5b4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-operations.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let transaction = try await tablesDB.createOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-point-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-point-column.md new file mode 100644 index 000000000..091d8fae4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-point-column.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnPoint = try await tablesDB.createPointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [1, 2] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-polygon-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-polygon-column.md new file mode 100644 index 000000000..454e8fb8d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnPolygon = try await tablesDB.createPolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-relationship-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-relationship-column.md new file mode 100644 index 000000000..ec981e369 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,23 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnRelationship = try await tablesDB.createRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + relatedTableId: "<RELATED_TABLE_ID>", + type: .oneToOne, + twoWay: false, // optional + key: "<KEY>", // optional + twoWayKey: "<TWO_WAY_KEY>", // optional + onDelete: .cascade // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-row.md b/examples/2.0.x/server-swift/examples/tablesdb/create-row.md new file mode 100644 index 000000000..535ee521e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-row.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.createRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-rows.md b/examples/2.0.x/server-swift/examples/tablesdb/create-rows.md new file mode 100644 index 000000000..0a8380717 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-rows.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.createRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: [], + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-string-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-string-column.md new file mode 100644 index 000000000..c59ec1e35 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-string-column.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnString = try await tablesDB.createStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-table.md b/examples/2.0.x/server-swift/examples/tablesdb/create-table.md new file mode 100644 index 000000000..d8c537dcc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-table.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let table = try await tablesDB.createTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: [Permission.read(Role.any())], // optional + rowSecurity: false, // optional + enabled: false, // optional + columns: [], // optional + indexes: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-text-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-text-column.md new file mode 100644 index 000000000..cb79ec132 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-text-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnText = try await tablesDB.createTextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-transaction.md b/examples/2.0.x/server-swift/examples/tablesdb/create-transaction.md new file mode 100644 index 000000000..efa765097 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let transaction = try await tablesDB.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-url-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-url-column.md new file mode 100644 index 000000000..958904df8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-url-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnUrl = try await tablesDB.createUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", // optional + array: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create-varchar-column.md b/examples/2.0.x/server-swift/examples/tablesdb/create-varchar-column.md new file mode 100644 index 000000000..1845b7ad3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create-varchar-column.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnVarchar = try await tablesDB.createVarcharColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + size: 1, + required: false, + default: "Hello World", // optional + array: false, // optional + encrypt: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/create.md b/examples/2.0.x/server-swift/examples/tablesdb/create.md new file mode 100644 index 000000000..91fe76a73 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/create.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let database = try await tablesDB.create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/decrement-row-column.md b/examples/2.0.x/server-swift/examples/tablesdb/decrement-row-column.md new file mode 100644 index 000000000..2a36505fc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.decrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "<COLUMN>", + value: 1, // optional + min: 0, // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/delete-column.md b/examples/2.0.x/server-swift/examples/tablesdb/delete-column.md new file mode 100644 index 000000000..fe4d718b4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/delete-column.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/delete-index.md b/examples/2.0.x/server-swift/examples/tablesdb/delete-index.md new file mode 100644 index 000000000..1eaf3f493 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/delete-index.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/delete-row.md b/examples/2.0.x/server-swift/examples/tablesdb/delete-row.md new file mode 100644 index 000000000..89b575fc0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/delete-row.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/delete-rows.md b/examples/2.0.x/server-swift/examples/tablesdb/delete-rows.md new file mode 100644 index 000000000..0ab77ec63 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/delete-rows.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.deleteRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/delete-table.md b/examples/2.0.x/server-swift/examples/tablesdb/delete-table.md new file mode 100644 index 000000000..b5e613f4c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/delete-table.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/delete-transaction.md b/examples/2.0.x/server-swift/examples/tablesdb/delete-transaction.md new file mode 100644 index 000000000..90c4c4b77 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/delete-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteTransaction( + transactionId: "<TRANSACTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/delete.md b/examples/2.0.x/server-swift/examples/tablesdb/delete.md new file mode 100644 index 000000000..0341da342 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.delete( + databaseId: "<DATABASE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/get-column.md b/examples/2.0.x/server-swift/examples/tablesdb/get-column.md new file mode 100644 index 000000000..f9ede3ea6 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/get-column.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.getColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/get-index.md b/examples/2.0.x/server-swift/examples/tablesdb/get-index.md new file mode 100644 index 000000000..62cf2ebb4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/get-index.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIndex = try await tablesDB.getIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/get-row.md b/examples/2.0.x/server-swift/examples/tablesdb/get-row.md new file mode 100644 index 000000000..72ef92fec --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/get-row.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.getRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/get-table.md b/examples/2.0.x/server-swift/examples/tablesdb/get-table.md new file mode 100644 index 000000000..b3a68b5de --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/get-table.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let table = try await tablesDB.getTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/get-transaction.md b/examples/2.0.x/server-swift/examples/tablesdb/get-transaction.md new file mode 100644 index 000000000..faf6677a3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/get-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let transaction = try await tablesDB.getTransaction( + transactionId: "<TRANSACTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/get.md b/examples/2.0.x/server-swift/examples/tablesdb/get.md new file mode 100644 index 000000000..b94686d2a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let database = try await tablesDB.get( + databaseId: "<DATABASE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/increment-row-column.md b/examples/2.0.x/server-swift/examples/tablesdb/increment-row-column.md new file mode 100644 index 000000000..23eedda53 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/increment-row-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.incrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "<COLUMN>", + value: 1, // optional + max: 100, // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/list-columns.md b/examples/2.0.x/server-swift/examples/tablesdb/list-columns.md new file mode 100644 index 000000000..1a4ce6b19 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/list-columns.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnList = try await tablesDB.listColumns( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/list-indexes.md b/examples/2.0.x/server-swift/examples/tablesdb/list-indexes.md new file mode 100644 index 000000000..49cb529a8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/list-indexes.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIndexList = try await tablesDB.listIndexes( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/list-rows.md b/examples/2.0.x/server-swift/examples/tablesdb/list-rows.md new file mode 100644 index 000000000..6be251796 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/list-rows.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.listRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/list-tables.md b/examples/2.0.x/server-swift/examples/tablesdb/list-tables.md new file mode 100644 index 000000000..a611a8f4a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/list-tables.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let tableList = try await tablesDB.listTables( + databaseId: "<DATABASE_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/list-transactions.md b/examples/2.0.x/server-swift/examples/tablesdb/list-transactions.md new file mode 100644 index 000000000..bf51907bd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/list-transactions.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let transactionList = try await tablesDB.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/list.md b/examples/2.0.x/server-swift/examples/tablesdb/list.md new file mode 100644 index 000000000..4ac684caf --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let databaseList = try await tablesDB.list( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-big-int-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-big-int-column.md new file mode 100644 index 000000000..880db9b10 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnBigint = try await tablesDB.updateBigIntColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 0, + min: 0, // optional + max: 1000000, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-boolean-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-boolean-column.md new file mode 100644 index 000000000..36a31cd4c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnBoolean = try await tablesDB.updateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: false, + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-datetime-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-datetime-column.md new file mode 100644 index 000000000..beff84768 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnDatetime = try await tablesDB.updateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "2020-10-15T06:38:00.000+00:00", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-email-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-email-column.md new file mode 100644 index 000000000..7983ca694 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-email-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnEmail = try await tablesDB.updateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "email@example.com", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-enum-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-enum-column.md new file mode 100644 index 000000000..764bfc697 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-enum-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnEnum = try await tablesDB.updateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + elements: ["active", "inactive"], + required: false, + default: "active", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-float-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-float-column.md new file mode 100644 index 000000000..731075c4c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-float-column.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnFloat = try await tablesDB.updateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 10.5, + min: 0, // optional + max: 100, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-integer-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-integer-column.md new file mode 100644 index 000000000..14e7294f4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-integer-column.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnInteger = try await tablesDB.updateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: 10, + min: 0, // optional + max: 100, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-ip-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-ip-column.md new file mode 100644 index 000000000..81b5f61bc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-ip-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIp = try await tablesDB.updateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "192.0.2.0", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-line-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-line-column.md new file mode 100644 index 000000000..b93956330 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-line-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnLine = try await tablesDB.updateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-longtext-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-longtext-column.md new file mode 100644 index 000000000..575b069e0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-longtext-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnLongtext = try await tablesDB.updateLongtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-mediumtext-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-mediumtext-column.md new file mode 100644 index 000000000..e1da8afbd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-mediumtext-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnMediumtext = try await tablesDB.updateMediumtextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-point-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-point-column.md new file mode 100644 index 000000000..241070a7c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-point-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnPoint = try await tablesDB.updatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [1, 2], // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-polygon-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-polygon-column.md new file mode 100644 index 000000000..95db86fc1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnPolygon = try await tablesDB.updatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-relationship-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-relationship-column.md new file mode 100644 index 000000000..1690fa461 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnRelationship = try await tablesDB.updateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + onDelete: .cascade, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-row.md b/examples/2.0.x/server-swift/examples/tablesdb/update-row.md new file mode 100644 index 000000000..da34394b6 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-row.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.updateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + ], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-rows.md b/examples/2.0.x/server-swift/examples/tablesdb/update-rows.md new file mode 100644 index 000000000..934e441e3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-rows.md @@ -0,0 +1,25 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.updateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + ], // optional + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-string-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-string-column.md new file mode 100644 index 000000000..4e8c2a12d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-string-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnString = try await tablesDB.updateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-table.md b/examples/2.0.x/server-swift/examples/tablesdb/update-table.md new file mode 100644 index 000000000..f05bb4c86 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-table.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let table = try await tablesDB.updateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", // optional + permissions: [Permission.read(Role.any())], // optional + rowSecurity: false, // optional + enabled: false, // optional + purge: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-text-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-text-column.md new file mode 100644 index 000000000..457b396e2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-text-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnText = try await tablesDB.updateTextColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-transaction.md b/examples/2.0.x/server-swift/examples/tablesdb/update-transaction.md new file mode 100644 index 000000000..69abac950 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-transaction.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let transaction = try await tablesDB.updateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-url-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-url-column.md new file mode 100644 index 000000000..0230f3092 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-url-column.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnUrl = try await tablesDB.updateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "https://example.com", + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update-varchar-column.md b/examples/2.0.x/server-swift/examples/tablesdb/update-varchar-column.md new file mode 100644 index 000000000..c3d2d0d8c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update-varchar-column.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnVarchar = try await tablesDB.updateVarcharColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "<KEY>", + required: false, + default: "Hello World", + size: 1, // optional + newKey: "<NEW_KEY>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/update.md b/examples/2.0.x/server-swift/examples/tablesdb/update.md new file mode 100644 index 000000000..b1c2c665b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/update.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let database = try await tablesDB.update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/upsert-row.md b/examples/2.0.x/server-swift/examples/tablesdb/upsert-row.md new file mode 100644 index 000000000..c84ee4b98 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/upsert-row.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.upsertRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + ], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tablesdb/upsert-rows.md b/examples/2.0.x/server-swift/examples/tablesdb/upsert-rows.md new file mode 100644 index 000000000..457ea5c58 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tablesdb/upsert-rows.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.upsertRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: [], + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/create-membership.md b/examples/2.0.x/server-swift/examples/teams/create-membership.md new file mode 100644 index 000000000..bed0624bc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/create-membership.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membership = try await teams.createMembership( + teamId: "<TEAM_ID>", + roles: [], + email: "email@example.com", // optional + userId: "<USER_ID>", // optional + phone: "+12065550100", // optional + url: "https://example.com", // optional + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/create.md b/examples/2.0.x/server-swift/examples/teams/create.md new file mode 100644 index 000000000..0aadb201a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/create.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let team = try await teams.create( + teamId: "<TEAM_ID>", + name: "<NAME>", + roles: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/delete-membership.md b/examples/2.0.x/server-swift/examples/teams/delete-membership.md new file mode 100644 index 000000000..fb1c47830 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/delete-membership.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let result = try await teams.deleteMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/delete.md b/examples/2.0.x/server-swift/examples/teams/delete.md new file mode 100644 index 000000000..e6b1dcbf2 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let result = try await teams.delete( + teamId: "<TEAM_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/get-membership.md b/examples/2.0.x/server-swift/examples/teams/get-membership.md new file mode 100644 index 000000000..a2d73f27f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/get-membership.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membership = try await teams.getMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/get-prefs.md b/examples/2.0.x/server-swift/examples/teams/get-prefs.md new file mode 100644 index 000000000..210d6c99a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/get-prefs.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let preferences = try await teams.getPrefs( + teamId: "<TEAM_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/get.md b/examples/2.0.x/server-swift/examples/teams/get.md new file mode 100644 index 000000000..fc7734ffb --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let team = try await teams.get( + teamId: "<TEAM_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/list-memberships.md b/examples/2.0.x/server-swift/examples/teams/list-memberships.md new file mode 100644 index 000000000..0df4809fc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/list-memberships.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membershipList = try await teams.listMemberships( + teamId: "<TEAM_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/list.md b/examples/2.0.x/server-swift/examples/teams/list.md new file mode 100644 index 000000000..4b36faf54 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let teamList = try await teams.list( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/update-membership-status.md b/examples/2.0.x/server-swift/examples/teams/update-membership-status.md new file mode 100644 index 000000000..b03cdb4b4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/update-membership-status.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membership = try await teams.updateMembershipStatus( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + userId: "<USER_ID>", + secret: "<SECRET>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/update-membership.md b/examples/2.0.x/server-swift/examples/teams/update-membership.md new file mode 100644 index 000000000..b2cce9df7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/update-membership.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membership = try await teams.updateMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + roles: [] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/update-name.md b/examples/2.0.x/server-swift/examples/teams/update-name.md new file mode 100644 index 000000000..e2e9b1c0e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/update-name.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let team = try await teams.updateName( + teamId: "<TEAM_ID>", + name: "<NAME>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/teams/update-prefs.md b/examples/2.0.x/server-swift/examples/teams/update-prefs.md new file mode 100644 index 000000000..572f32b37 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/teams/update-prefs.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let preferences = try await teams.updatePrefs( + teamId: "<TEAM_ID>", + prefs: [:] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tokens/create-file-token.md b/examples/2.0.x/server-swift/examples/tokens/create-file-token.md new file mode 100644 index 000000000..a1502fe6c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tokens/create-file-token.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.createFileToken( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + expire: "2020-10-15T06:38:00.000+00:00" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tokens/delete.md b/examples/2.0.x/server-swift/examples/tokens/delete.md new file mode 100644 index 000000000..fc82daf5a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tokens/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let result = try await tokens.delete( + tokenId: "<TOKEN_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tokens/get.md b/examples/2.0.x/server-swift/examples/tokens/get.md new file mode 100644 index 000000000..825d8d68a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tokens/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.get( + tokenId: "<TOKEN_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tokens/list.md b/examples/2.0.x/server-swift/examples/tokens/list.md new file mode 100644 index 000000000..3429e2c3f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tokens/list.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let resourceTokenList = try await tokens.list( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/tokens/update.md b/examples/2.0.x/server-swift/examples/tokens/update.md new file mode 100644 index 000000000..276a9e751 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/tokens/update.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.update( + tokenId: "<TOKEN_ID>", + expire: "2020-10-15T06:38:00.000+00:00" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-argon-2-user.md b/examples/2.0.x/server-swift/examples/users/create-argon-2-user.md new file mode 100644 index 000000000..b2233a91c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-argon-2-user.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createArgon2User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-bcrypt-user.md b/examples/2.0.x/server-swift/examples/users/create-bcrypt-user.md new file mode 100644 index 000000000..58e32f4de --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-bcrypt-user.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createBcryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-jwt.md b/examples/2.0.x/server-swift/examples/users/create-jwt.md new file mode 100644 index 000000000..e5d210802 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-jwt.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let jwt = try await users.createJWT( + userId: "<USER_ID>", + sessionId: "recent()", // optional + duration: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-md-5-user.md b/examples/2.0.x/server-swift/examples/users/create-md-5-user.md new file mode 100644 index 000000000..979548e20 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-md-5-user.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createMD5User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-mfa-recovery-codes.md b/examples/2.0.x/server-swift/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 000000000..a9c3a8479 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaRecoveryCodes = try await users.createMFARecoveryCodes( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-ph-pass-user.md b/examples/2.0.x/server-swift/examples/users/create-ph-pass-user.md new file mode 100644 index 000000000..2df63ec2c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-ph-pass-user.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createPHPassUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-scrypt-modified-user.md b/examples/2.0.x/server-swift/examples/users/create-scrypt-modified-user.md new file mode 100644 index 000000000..707db0d0f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createScryptModifiedUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordSaltSeparator: "<PASSWORD_SALT_SEPARATOR>", + passwordSignerKey: "<PASSWORD_SIGNER_KEY>", + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-scrypt-user.md b/examples/2.0.x/server-swift/examples/users/create-scrypt-user.md new file mode 100644 index 000000000..0c2591d6f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-scrypt-user.md @@ -0,0 +1,23 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createScryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordCpu: 8, + passwordMemory: 65536, + passwordParallel: 1, + passwordLength: 64, + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-session.md b/examples/2.0.x/server-swift/examples/users/create-session.md new file mode 100644 index 000000000..46849ece0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-session.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let session = try await users.createSession( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-sha-user.md b/examples/2.0.x/server-swift/examples/users/create-sha-user.md new file mode 100644 index 000000000..efbf7b7cd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-sha-user.md @@ -0,0 +1,20 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createSHAUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordVersion: .sha1, // optional + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-target.md b/examples/2.0.x/server-swift/examples/users/create-target.md new file mode 100644 index 000000000..e0d7d2c6f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-target.md @@ -0,0 +1,21 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let target = try await users.createTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + providerType: .email, + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>", // optional + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create-token.md b/examples/2.0.x/server-swift/examples/users/create-token.md new file mode 100644 index 000000000..ec1957fd8 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create-token.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let token = try await users.createToken( + userId: "<USER_ID>", + length: 4, // optional + expire: 60 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/create.md b/examples/2.0.x/server-swift/examples/users/create.md new file mode 100644 index 000000000..fb168bbd6 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/create.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.create( + userId: "<USER_ID>", + email: "email@example.com", // optional + phone: "+12065550100", // optional + password: "password", // optional + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/delete-identity.md b/examples/2.0.x/server-swift/examples/users/delete-identity.md new file mode 100644 index 000000000..5c9a22254 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/delete-identity.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteIdentity( + identityId: "<IDENTITY_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/delete-mfa-authenticator.md b/examples/2.0.x/server-swift/examples/users/delete-mfa-authenticator.md new file mode 100644 index 000000000..92cc125c1 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,17 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteMFAAuthenticator( + userId: "<USER_ID>", + type: .totp +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/delete-session.md b/examples/2.0.x/server-swift/examples/users/delete-session.md new file mode 100644 index 000000000..f54504e1b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/delete-session.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteSession( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/delete-sessions.md b/examples/2.0.x/server-swift/examples/users/delete-sessions.md new file mode 100644 index 000000000..f719e6ad3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/delete-sessions.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteSessions( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/delete-target.md b/examples/2.0.x/server-swift/examples/users/delete-target.md new file mode 100644 index 000000000..b2fee1ae9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/delete-target.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/delete.md b/examples/2.0.x/server-swift/examples/users/delete.md new file mode 100644 index 000000000..57c549cb5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.delete( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/get-mfa-challenge.md b/examples/2.0.x/server-swift/examples/users/get-mfa-challenge.md new file mode 100644 index 000000000..5726db874 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/get-mfa-challenge.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaChallengeSecret = try await users.getMFAChallenge( + userId: "<USER_ID>", + challengeId: "<CHALLENGE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/get-mfa-recovery-codes.md b/examples/2.0.x/server-swift/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 000000000..bca1a13fc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaRecoveryCodes = try await users.getMFARecoveryCodes( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/get-prefs.md b/examples/2.0.x/server-swift/examples/users/get-prefs.md new file mode 100644 index 000000000..5ed3429a0 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/get-prefs.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let preferences = try await users.getPrefs( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/get-target.md b/examples/2.0.x/server-swift/examples/users/get-target.md new file mode 100644 index 000000000..8b211888a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/get-target.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let target = try await users.getTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/get.md b/examples/2.0.x/server-swift/examples/users/get.md new file mode 100644 index 000000000..2ced7fb3c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.get( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/list-identities.md b/examples/2.0.x/server-swift/examples/users/list-identities.md new file mode 100644 index 000000000..d2617efe3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/list-identities.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let identityList = try await users.listIdentities( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/list-memberships.md b/examples/2.0.x/server-swift/examples/users/list-memberships.md new file mode 100644 index 000000000..b2311539b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/list-memberships.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let membershipList = try await users.listMemberships( + userId: "<USER_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/list-mfa-factors.md b/examples/2.0.x/server-swift/examples/users/list-mfa-factors.md new file mode 100644 index 000000000..ac8ca02de --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/list-mfa-factors.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaFactors = try await users.listMFAFactors( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/list-sessions.md b/examples/2.0.x/server-swift/examples/users/list-sessions.md new file mode 100644 index 000000000..8f084c40e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/list-sessions.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let sessionList = try await users.listSessions( + userId: "<USER_ID>", + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/list-targets.md b/examples/2.0.x/server-swift/examples/users/list-targets.md new file mode 100644 index 000000000..f0428187e --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/list-targets.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let targetList = try await users.listTargets( + userId: "<USER_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/list.md b/examples/2.0.x/server-swift/examples/users/list.md new file mode 100644 index 000000000..4720e0443 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let userList = try await users.list( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-email-verification.md b/examples/2.0.x/server-swift/examples/users/update-email-verification.md new file mode 100644 index 000000000..c8889edb6 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-email-verification.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateEmailVerification( + userId: "<USER_ID>", + emailVerification: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-email.md b/examples/2.0.x/server-swift/examples/users/update-email.md new file mode 100644 index 000000000..f3f705c90 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-email.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateEmail( + userId: "<USER_ID>", + email: "email@example.com" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-impersonator.md b/examples/2.0.x/server-swift/examples/users/update-impersonator.md new file mode 100644 index 000000000..86cd532c5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-impersonator.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateImpersonator( + userId: "<USER_ID>", + impersonator: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-labels.md b/examples/2.0.x/server-swift/examples/users/update-labels.md new file mode 100644 index 000000000..67d4b95dd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-labels.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateLabels( + userId: "<USER_ID>", + labels: [] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-mfa-recovery-codes.md b/examples/2.0.x/server-swift/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 000000000..987cd941d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaRecoveryCodes = try await users.updateMFARecoveryCodes( + userId: "<USER_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-mfa.md b/examples/2.0.x/server-swift/examples/users/update-mfa.md new file mode 100644 index 000000000..56b44f33a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-mfa.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateMFA( + userId: "<USER_ID>", + mfa: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-name.md b/examples/2.0.x/server-swift/examples/users/update-name.md new file mode 100644 index 000000000..38c63415d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-name.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateName( + userId: "<USER_ID>", + name: "<NAME>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-password.md b/examples/2.0.x/server-swift/examples/users/update-password.md new file mode 100644 index 000000000..b0bcd862f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-password.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updatePassword( + userId: "<USER_ID>", + password: "password" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-phone-verification.md b/examples/2.0.x/server-swift/examples/users/update-phone-verification.md new file mode 100644 index 000000000..91e332422 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-phone-verification.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updatePhoneVerification( + userId: "<USER_ID>", + phoneVerification: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-phone.md b/examples/2.0.x/server-swift/examples/users/update-phone.md new file mode 100644 index 000000000..17d0095fe --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-phone.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updatePhone( + userId: "<USER_ID>", + number: "+12065550100" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-prefs.md b/examples/2.0.x/server-swift/examples/users/update-prefs.md new file mode 100644 index 000000000..21d2ef06c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-prefs.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let preferences = try await users.updatePrefs( + userId: "<USER_ID>", + prefs: [:] +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-status.md b/examples/2.0.x/server-swift/examples/users/update-status.md new file mode 100644 index 000000000..fdf0dcac3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-status.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateStatus( + userId: "<USER_ID>", + status: false +) + +``` diff --git a/examples/2.0.x/server-swift/examples/users/update-target.md b/examples/2.0.x/server-swift/examples/users/update-target.md new file mode 100644 index 000000000..7114e7e90 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/users/update-target.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let target = try await users.updateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>", // optional + providerId: "<PROVIDER_ID>", // optional + name: "<NAME>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/create-collection.md b/examples/2.0.x/server-swift/examples/vectorsdb/create-collection.md new file mode 100644 index 000000000..27682380d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/create-collection.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let vectorsdbCollection = try await vectorsDB.createCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + dimension: 1, + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/create-document.md b/examples/2.0.x/server-swift/examples/vectorsdb/create-document.md new file mode 100644 index 000000000..636f7f24c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/create-document.md @@ -0,0 +1,30 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.createDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [ + "embeddings": [ + "0": 0.12, + "1": -0.55, + "2": 0.88, + "3": 1.02 + ], + "metadata": [ + "key": "value" + ] + ], + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/create-documents.md b/examples/2.0.x/server-swift/examples/vectorsdb/create-documents.md new file mode 100644 index 000000000..c25ee2bc3 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/create-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.createDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/create-index.md b/examples/2.0.x/server-swift/examples/vectorsdb/create-index.md new file mode 100644 index 000000000..9aca64180 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/create-index.md @@ -0,0 +1,22 @@ +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let index = try await vectorsDB.createIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>", + type: .hnswEuclidean, + attributes: [], + orders: [.asc], // optional + lengths: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/create-operations.md b/examples/2.0.x/server-swift/examples/vectorsdb/create-operations.md new file mode 100644 index 000000000..9f2870646 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.createOperations( + transactionId: "<TRANSACTION_ID>", + operations: [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/create-query.md b/examples/2.0.x/server-swift/examples/vectorsdb/create-query.md new file mode 100644 index 000000000..7191e8718 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.createQuery( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/create-transaction.md b/examples/2.0.x/server-swift/examples/vectorsdb/create-transaction.md new file mode 100644 index 000000000..981b1946a --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.createTransaction( + ttl: 60 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/create.md b/examples/2.0.x/server-swift/examples/vectorsdb/create.md new file mode 100644 index 000000000..6d5f9b137 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/create.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let database = try await vectorsDB.create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/delete-collection.md b/examples/2.0.x/server-swift/examples/vectorsdb/delete-collection.md new file mode 100644 index 000000000..1cd184c69 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/delete-collection.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.deleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/delete-document.md b/examples/2.0.x/server-swift/examples/vectorsdb/delete-document.md new file mode 100644 index 000000000..0bd2dd424 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.deleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/delete-documents.md b/examples/2.0.x/server-swift/examples/vectorsdb/delete-documents.md new file mode 100644 index 000000000..54211abdc --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/delete-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.deleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/delete-index.md b/examples/2.0.x/server-swift/examples/vectorsdb/delete-index.md new file mode 100644 index 000000000..e8ddd15d7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/delete-index.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.deleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/delete-transaction.md b/examples/2.0.x/server-swift/examples/vectorsdb/delete-transaction.md new file mode 100644 index 000000000..9f7c88ff7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.deleteTransaction( + transactionId: "<TRANSACTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/delete.md b/examples/2.0.x/server-swift/examples/vectorsdb/delete.md new file mode 100644 index 000000000..eb1383f47 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let result = try await vectorsDB.delete( + databaseId: "<DATABASE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/get-collection.md b/examples/2.0.x/server-swift/examples/vectorsdb/get-collection.md new file mode 100644 index 000000000..7be38081c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/get-collection.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let vectorsdbCollection = try await vectorsDB.getCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/get-document.md b/examples/2.0.x/server-swift/examples/vectorsdb/get-document.md new file mode 100644 index 000000000..7f8d004f7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.getDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/get-index.md b/examples/2.0.x/server-swift/examples/vectorsdb/get-index.md new file mode 100644 index 000000000..9fe7ba8c4 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/get-index.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let index = try await vectorsDB.getIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "<KEY>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/get-transaction.md b/examples/2.0.x/server-swift/examples/vectorsdb/get-transaction.md new file mode 100644 index 000000000..83908c55d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.getTransaction( + transactionId: "<TRANSACTION_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/get.md b/examples/2.0.x/server-swift/examples/vectorsdb/get.md new file mode 100644 index 000000000..18ef8466d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let database = try await vectorsDB.get( + databaseId: "<DATABASE_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/list-collections.md b/examples/2.0.x/server-swift/examples/vectorsdb/list-collections.md new file mode 100644 index 000000000..0c002b62c --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/list-collections.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let vectorsdbCollectionList = try await vectorsDB.listCollections( + databaseId: "<DATABASE_ID>", + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/list-documents.md b/examples/2.0.x/server-swift/examples/vectorsdb/list-documents.md new file mode 100644 index 000000000..f09c4d06d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.listDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + transactionId: "<TRANSACTION_ID>", // optional + total: false, // optional + ttl: 0 // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/list-indexes.md b/examples/2.0.x/server-swift/examples/vectorsdb/list-indexes.md new file mode 100644 index 000000000..bafc8eaa9 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/list-indexes.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let indexList = try await vectorsDB.listIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/list-transactions.md b/examples/2.0.x/server-swift/examples/vectorsdb/list-transactions.md new file mode 100644 index 000000000..5a4f5e63d --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let transactionList = try await vectorsDB.listTransactions( + queries: [] // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/list.md b/examples/2.0.x/server-swift/examples/vectorsdb/list.md new file mode 100644 index 000000000..669eeeb5f --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/list.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let databaseList = try await vectorsDB.list( + queries: [], // optional + search: "<SEARCH>", // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/update-collection.md b/examples/2.0.x/server-swift/examples/vectorsdb/update-collection.md new file mode 100644 index 000000000..0abc0fc0b --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/update-collection.md @@ -0,0 +1,21 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let vectorsdbCollection = try await vectorsDB.updateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + dimension: 1, // optional + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/update-document.md b/examples/2.0.x/server-swift/examples/vectorsdb/update-document.md new file mode 100644 index 000000000..b60a0edee --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.updateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/update-documents.md b/examples/2.0.x/server-swift/examples/vectorsdb/update-documents.md new file mode 100644 index 000000000..c89d78e93 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/update-documents.md @@ -0,0 +1,19 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.updateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: [:], // optional + queries: [], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/update-transaction.md b/examples/2.0.x/server-swift/examples/vectorsdb/update-transaction.md new file mode 100644 index 000000000..17d502901 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let transaction = try await vectorsDB.updateTransaction( + transactionId: "<TRANSACTION_ID>", + commit: false, // optional + rollback: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/update.md b/examples/2.0.x/server-swift/examples/vectorsdb/update.md new file mode 100644 index 000000000..25b98feb7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/update.md @@ -0,0 +1,17 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let database = try await vectorsDB.update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/upsert-document.md b/examples/2.0.x/server-swift/examples/vectorsdb/upsert-document.md new file mode 100644 index 000000000..c91a48004 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let vectorsDB = VectorsDB(client) + +let document = try await vectorsDB.upsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/vectorsdb/upsert-documents.md b/examples/2.0.x/server-swift/examples/vectorsdb/upsert-documents.md new file mode 100644 index 000000000..32d773bce --- /dev/null +++ b/examples/2.0.x/server-swift/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,18 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let vectorsDB = VectorsDB(client) + +let documentList = try await vectorsDB.upsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [], + transactionId: "<TRANSACTION_ID>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/webhooks/create.md b/examples/2.0.x/server-swift/examples/webhooks/create.md new file mode 100644 index 000000000..b9ff80bf5 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/webhooks/create.md @@ -0,0 +1,23 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let webhooks = Webhooks(client) + +let webhook = try await webhooks.create( + webhookId: "<WEBHOOK_ID>", + url: "https://example.com/webhook", + name: "<NAME>", + events: [], + enabled: false, // optional + tls: false, // optional + authUsername: "<AUTH_USERNAME>", // optional + authPassword: "password", // optional + secret: "<SECRET>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/webhooks/delete.md b/examples/2.0.x/server-swift/examples/webhooks/delete.md new file mode 100644 index 000000000..337c001cd --- /dev/null +++ b/examples/2.0.x/server-swift/examples/webhooks/delete.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let webhooks = Webhooks(client) + +let result = try await webhooks.delete( + webhookId: "<WEBHOOK_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/webhooks/get.md b/examples/2.0.x/server-swift/examples/webhooks/get.md new file mode 100644 index 000000000..7710218d7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/webhooks/get.md @@ -0,0 +1,15 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let webhooks = Webhooks(client) + +let webhook = try await webhooks.get( + webhookId: "<WEBHOOK_ID>" +) + +``` diff --git a/examples/2.0.x/server-swift/examples/webhooks/list.md b/examples/2.0.x/server-swift/examples/webhooks/list.md new file mode 100644 index 000000000..d6dbf7713 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/webhooks/list.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let webhooks = Webhooks(client) + +let webhookList = try await webhooks.list( + queries: [], // optional + total: false // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/webhooks/update-secret.md b/examples/2.0.x/server-swift/examples/webhooks/update-secret.md new file mode 100644 index 000000000..1a29763f7 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/webhooks/update-secret.md @@ -0,0 +1,16 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let webhooks = Webhooks(client) + +let webhook = try await webhooks.updateSecret( + webhookId: "<WEBHOOK_ID>", + secret: "<SECRET>" // optional +) + +``` diff --git a/examples/2.0.x/server-swift/examples/webhooks/update.md b/examples/2.0.x/server-swift/examples/webhooks/update.md new file mode 100644 index 000000000..063639128 --- /dev/null +++ b/examples/2.0.x/server-swift/examples/webhooks/update.md @@ -0,0 +1,22 @@ +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let webhooks = Webhooks(client) + +let webhook = try await webhooks.update( + webhookId: "<WEBHOOK_ID>", + name: "<NAME>", + url: "https://example.com/webhook", + events: [], + enabled: false, // optional + tls: false, // optional + authUsername: "<AUTH_USERNAME>", // optional + authPassword: "password" // optional +) + +``` diff --git a/specs/2.0.x/open-api3-2.0.x-client.json b/specs/2.0.x/open-api3-2.0.x-client.json new file mode 100644 index 000000000..071e1484d --- /dev/null +++ b/specs/2.0.x/open-api3-2.0.x-client.json @@ -0,0 +1,22064 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "2.0.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1", + "description": "Appwrite Cloud endpoint." + }, + { + "url": "https:\/\/{region}.cloud.appwrite.io\/v1", + "description": "Appwrite Cloud regional endpoint. Replace `{region}` with your project region.", + "variables": { + "region": { + "default": "fra", + "description": "Appwrite Cloud region." + } + } + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "New user password. Must be between 8 and 256 chars.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "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.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-jwt.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "duration": { + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "type": "integer", + "default": 900, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "description": "Enable or disable MFA.", + "type": "boolean", + "example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "description": "Valid verification token.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenges": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.", + "type": "string", + "example": "email", + "title": "AuthenticationFactor", + "oneOf": [ + { + "type": "string", + "enum": [ + "email" + ], + "title": "email" + }, + { + "type": "string", + "enum": [ + "phone" + ], + "title": "phone" + }, + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + }, + { + "type": "string", + "enum": [ + "recoverycode" + ], + "title": "recoverycode" + }, + { + "type": "string", + "enum": [ + "custom" + ], + "title": "custom" + } + ] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "description": "ID of the challenge.", + "type": "string", + "example": "<CHALLENGE_ID>" + }, + "otp": { + "description": "Valid verification token.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "description": "New user password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + }, + "oldPassword": { + "description": "Current user password. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "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.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "example": "+12065550100", + "format": "phone" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "description": "Prefs key-value JSON object.", + "type": "object", + "default": {}, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "url": { + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project 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.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid reset token.", + "type": "string", + "example": "<SECRET>" + }, + "password": { + "description": "New user password. Must be between 8 and 256 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-anonymous-session.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-email-password-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-magic-url-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "No content", + "content": { + "text\/html": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-o-auth-2-session.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "example": "amazon", + "title": "OAuthProvider", + "oneOf": [ + { + "type": "string", + "enum": [ + "amazon" + ], + "title": "amazon" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "appwrite" + ], + "title": "appwrite" + }, + { + "type": "string", + "enum": [ + "auth0" + ], + "title": "auth0" + }, + { + "type": "string", + "enum": [ + "authentik" + ], + "title": "authentik" + }, + { + "type": "string", + "enum": [ + "autodesk" + ], + "title": "autodesk" + }, + { + "type": "string", + "enum": [ + "bitbucket" + ], + "title": "bitbucket" + }, + { + "type": "string", + "enum": [ + "bitly" + ], + "title": "bitly" + }, + { + "type": "string", + "enum": [ + "box" + ], + "title": "box" + }, + { + "type": "string", + "enum": [ + "cloudflare" + ], + "title": "cloudflare" + }, + { + "type": "string", + "enum": [ + "dailymotion" + ], + "title": "dailymotion" + }, + { + "type": "string", + "enum": [ + "discord" + ], + "title": "discord" + }, + { + "type": "string", + "enum": [ + "disqus" + ], + "title": "disqus" + }, + { + "type": "string", + "enum": [ + "dropbox" + ], + "title": "dropbox" + }, + { + "type": "string", + "enum": [ + "etsy" + ], + "title": "etsy" + }, + { + "type": "string", + "enum": [ + "facebook" + ], + "title": "facebook" + }, + { + "type": "string", + "enum": [ + "figma" + ], + "title": "figma" + }, + { + "type": "string", + "enum": [ + "fusionauth" + ], + "title": "fusionauth" + }, + { + "type": "string", + "enum": [ + "github" + ], + "title": "github" + }, + { + "type": "string", + "enum": [ + "gitlab" + ], + "title": "gitlab" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + }, + { + "type": "string", + "enum": [ + "huggingface" + ], + "title": "huggingface" + }, + { + "type": "string", + "enum": [ + "keycloak" + ], + "title": "keycloak" + }, + { + "type": "string", + "enum": [ + "kick" + ], + "title": "kick" + }, + { + "type": "string", + "enum": [ + "linkedin" + ], + "title": "linkedin" + }, + { + "type": "string", + "enum": [ + "microsoft" + ], + "title": "microsoft" + }, + { + "type": "string", + "enum": [ + "notion" + ], + "title": "notion" + }, + { + "type": "string", + "enum": [ + "oidc" + ], + "title": "oidc" + }, + { + "type": "string", + "enum": [ + "okta" + ], + "title": "okta" + }, + { + "type": "string", + "enum": [ + "paypal" + ], + "title": "paypal" + }, + { + "type": "string", + "enum": [ + "paypalSandbox" + ], + "title": "paypalSandbox" + }, + { + "type": "string", + "enum": [ + "podio" + ], + "title": "podio" + }, + { + "type": "string", + "enum": [ + "resend" + ], + "title": "resend" + }, + { + "type": "string", + "enum": [ + "salesforce" + ], + "title": "salesforce" + }, + { + "type": "string", + "enum": [ + "slack" + ], + "title": "slack" + }, + { + "type": "string", + "enum": [ + "spotify" + ], + "title": "spotify" + }, + { + "type": "string", + "enum": [ + "stripe" + ], + "title": "stripe" + }, + { + "type": "string", + "enum": [ + "tradeshift" + ], + "title": "tradeshift" + }, + { + "type": "string", + "enum": [ + "tradeshiftBox" + ], + "title": "tradeshiftBox" + }, + { + "type": "string", + "enum": [ + "twitch" + ], + "title": "twitch" + }, + { + "type": "string", + "enum": [ + "wordpress" + ], + "title": "wordpress" + }, + { + "type": "string", + "enum": [ + "x" + ], + "title": "x" + }, + { + "type": "string", + "enum": [ + "yahoo" + ], + "title": "yahoo" + }, + { + "type": "string", + "enum": [ + "yammer" + ], + "title": "yammer" + }, + { + "type": "string", + "enum": [ + "yandex" + ], + "title": "yandex" + }, + { + "type": "string", + "enum": [ + "zoho" + ], + "title": "zoho" + }, + { + "type": "string", + "enum": [ + "zoom" + ], + "title": "zoom" + } + ] + }, + "in": "path" + }, + { + "name": "success", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "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.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-phone-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "pushTargets", + "demo": "account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TARGET_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "identifier": { + "description": "The target identifier (token, email, phone etc.)", + "type": "string", + "example": "<IDENTIFIER>" + }, + "providerId": { + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "type": "string", + "default": "", + "example": "<PROVIDER_ID>" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + } + } + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "pushTargets", + "demo": "account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "description": "The target identifier (token, email, phone etc.)", + "type": "string", + "example": "<IDENTIFIER>" + } + }, + "required": [ + "identifier" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "pushTargets", + "demo": "account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-email-token.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-magic-url-token.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "url": { + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project 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.", + "type": "string", + "default": "", + "example": "https:\/\/example.com", + "format": "url" + }, + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content", + "content": { + "text\/html": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-o-auth-2-token.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "example": "amazon", + "title": "OAuthProvider", + "oneOf": [ + { + "type": "string", + "enum": [ + "amazon" + ], + "title": "amazon" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "appwrite" + ], + "title": "appwrite" + }, + { + "type": "string", + "enum": [ + "auth0" + ], + "title": "auth0" + }, + { + "type": "string", + "enum": [ + "authentik" + ], + "title": "authentik" + }, + { + "type": "string", + "enum": [ + "autodesk" + ], + "title": "autodesk" + }, + { + "type": "string", + "enum": [ + "bitbucket" + ], + "title": "bitbucket" + }, + { + "type": "string", + "enum": [ + "bitly" + ], + "title": "bitly" + }, + { + "type": "string", + "enum": [ + "box" + ], + "title": "box" + }, + { + "type": "string", + "enum": [ + "cloudflare" + ], + "title": "cloudflare" + }, + { + "type": "string", + "enum": [ + "dailymotion" + ], + "title": "dailymotion" + }, + { + "type": "string", + "enum": [ + "discord" + ], + "title": "discord" + }, + { + "type": "string", + "enum": [ + "disqus" + ], + "title": "disqus" + }, + { + "type": "string", + "enum": [ + "dropbox" + ], + "title": "dropbox" + }, + { + "type": "string", + "enum": [ + "etsy" + ], + "title": "etsy" + }, + { + "type": "string", + "enum": [ + "facebook" + ], + "title": "facebook" + }, + { + "type": "string", + "enum": [ + "figma" + ], + "title": "figma" + }, + { + "type": "string", + "enum": [ + "fusionauth" + ], + "title": "fusionauth" + }, + { + "type": "string", + "enum": [ + "github" + ], + "title": "github" + }, + { + "type": "string", + "enum": [ + "gitlab" + ], + "title": "gitlab" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + }, + { + "type": "string", + "enum": [ + "huggingface" + ], + "title": "huggingface" + }, + { + "type": "string", + "enum": [ + "keycloak" + ], + "title": "keycloak" + }, + { + "type": "string", + "enum": [ + "kick" + ], + "title": "kick" + }, + { + "type": "string", + "enum": [ + "linkedin" + ], + "title": "linkedin" + }, + { + "type": "string", + "enum": [ + "microsoft" + ], + "title": "microsoft" + }, + { + "type": "string", + "enum": [ + "notion" + ], + "title": "notion" + }, + { + "type": "string", + "enum": [ + "oidc" + ], + "title": "oidc" + }, + { + "type": "string", + "enum": [ + "okta" + ], + "title": "okta" + }, + { + "type": "string", + "enum": [ + "paypal" + ], + "title": "paypal" + }, + { + "type": "string", + "enum": [ + "paypalSandbox" + ], + "title": "paypalSandbox" + }, + { + "type": "string", + "enum": [ + "podio" + ], + "title": "podio" + }, + { + "type": "string", + "enum": [ + "resend" + ], + "title": "resend" + }, + { + "type": "string", + "enum": [ + "salesforce" + ], + "title": "salesforce" + }, + { + "type": "string", + "enum": [ + "slack" + ], + "title": "slack" + }, + { + "type": "string", + "enum": [ + "spotify" + ], + "title": "spotify" + }, + { + "type": "string", + "enum": [ + "stripe" + ], + "title": "stripe" + }, + { + "type": "string", + "enum": [ + "tradeshift" + ], + "title": "tradeshift" + }, + { + "type": "string", + "enum": [ + "tradeshiftBox" + ], + "title": "tradeshiftBox" + }, + { + "type": "string", + "enum": [ + "twitch" + ], + "title": "twitch" + }, + { + "type": "string", + "enum": [ + "wordpress" + ], + "title": "wordpress" + }, + { + "type": "string", + "enum": [ + "x" + ], + "title": "x" + }, + { + "type": "string", + "enum": [ + "yahoo" + ], + "title": "yahoo" + }, + { + "type": "string", + "enum": [ + "yammer" + ], + "title": "yammer" + }, + { + "type": "string", + "enum": [ + "yandex" + ], + "title": "yandex" + }, + { + "type": "string", + "enum": [ + "zoho" + ], + "title": "zoho" + }, + { + "type": "string", + "enum": [ + "zoom" + ], + "title": "zoom" + } + ] + }, + "in": "path" + }, + { + "name": "success", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "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.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-phone-token.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "example": "+12065550100", + "format": "phone" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verifications\/email": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateEmailVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createEmailVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "url" + ], + "required": [ + "url" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "demo": "account\/create-email-verification.md", + "public": true + }, + { + "name": "createVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "url" + ], + "required": [ + "url" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "demo": "account\/create-verification.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createEmailVerification" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateEmailVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "updateEmailVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "secret" + ], + "required": [ + "userId", + "secret" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "demo": "account\/update-email-verification.md", + "public": true + }, + { + "name": "updateVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "secret" + ], + "required": [ + "userId", + "secret" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "demo": "account\/update-verification.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateEmailVerification" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verifications\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "example": "aa", + "title": "Browser", + "oneOf": [ + { + "type": "string", + "enum": [ + "aa" + ], + "title": "Avant Browser" + }, + { + "type": "string", + "enum": [ + "an" + ], + "title": "Android WebView Beta" + }, + { + "type": "string", + "enum": [ + "ch" + ], + "title": "Google Chrome" + }, + { + "type": "string", + "enum": [ + "ci" + ], + "title": "Google Chrome (iOS)" + }, + { + "type": "string", + "enum": [ + "cm" + ], + "title": "Google Chrome (Mobile)" + }, + { + "type": "string", + "enum": [ + "cr" + ], + "title": "Chromium" + }, + { + "type": "string", + "enum": [ + "ff" + ], + "title": "Mozilla Firefox" + }, + { + "type": "string", + "enum": [ + "sf" + ], + "title": "Safari" + }, + { + "type": "string", + "enum": [ + "mf" + ], + "title": "Mobile Safari" + }, + { + "type": "string", + "enum": [ + "ps" + ], + "title": "Microsoft Edge" + }, + { + "type": "string", + "enum": [ + "oi" + ], + "title": "Microsoft Edge (iOS)" + }, + { + "type": "string", + "enum": [ + "om" + ], + "title": "Opera Mini" + }, + { + "type": "string", + "enum": [ + "op" + ], + "title": "Opera" + }, + { + "type": "string", + "enum": [ + "on" + ], + "title": "Opera (Next)" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "example": "amex", + "title": "CreditCard", + "oneOf": [ + { + "type": "string", + "enum": [ + "amex" + ], + "title": "American Express" + }, + { + "type": "string", + "enum": [ + "argencard" + ], + "title": "Argencard" + }, + { + "type": "string", + "enum": [ + "cabal" + ], + "title": "Cabal" + }, + { + "type": "string", + "enum": [ + "cencosud" + ], + "title": "Cencosud" + }, + { + "type": "string", + "enum": [ + "diners" + ], + "title": "Diners Club" + }, + { + "type": "string", + "enum": [ + "discover" + ], + "title": "Discover" + }, + { + "type": "string", + "enum": [ + "elo" + ], + "title": "Elo" + }, + { + "type": "string", + "enum": [ + "hipercard" + ], + "title": "Hipercard" + }, + { + "type": "string", + "enum": [ + "jcb" + ], + "title": "JCB" + }, + { + "type": "string", + "enum": [ + "mastercard" + ], + "title": "Mastercard" + }, + { + "type": "string", + "enum": [ + "naranja" + ], + "title": "Naranja" + }, + { + "type": "string", + "enum": [ + "targeta-shopping" + ], + "title": "Tarjeta Shopping" + }, + { + "type": "string", + "enum": [ + "unionpay" + ], + "title": "Union Pay" + }, + { + "type": "string", + "enum": [ + "visa" + ], + "title": "Visa" + }, + { + "type": "string", + "enum": [ + "mir" + ], + "title": "MIR" + }, + { + "type": "string", + "enum": [ + "maestro" + ], + "title": "Maestro" + }, + { + "type": "string", + "enum": [ + "rupay" + ], + "title": "Rupay" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "example": "af", + "title": "Flag", + "oneOf": [ + { + "type": "string", + "enum": [ + "af" + ], + "title": "Afghanistan" + }, + { + "type": "string", + "enum": [ + "ao" + ], + "title": "Angola" + }, + { + "type": "string", + "enum": [ + "al" + ], + "title": "Albania" + }, + { + "type": "string", + "enum": [ + "ad" + ], + "title": "Andorra" + }, + { + "type": "string", + "enum": [ + "ae" + ], + "title": "United Arab Emirates" + }, + { + "type": "string", + "enum": [ + "ar" + ], + "title": "Argentina" + }, + { + "type": "string", + "enum": [ + "am" + ], + "title": "Armenia" + }, + { + "type": "string", + "enum": [ + "ag" + ], + "title": "Antigua and Barbuda" + }, + { + "type": "string", + "enum": [ + "au" + ], + "title": "Australia" + }, + { + "type": "string", + "enum": [ + "at" + ], + "title": "Austria" + }, + { + "type": "string", + "enum": [ + "az" + ], + "title": "Azerbaijan" + }, + { + "type": "string", + "enum": [ + "bi" + ], + "title": "Burundi" + }, + { + "type": "string", + "enum": [ + "be" + ], + "title": "Belgium" + }, + { + "type": "string", + "enum": [ + "bj" + ], + "title": "Benin" + }, + { + "type": "string", + "enum": [ + "bf" + ], + "title": "Burkina Faso" + }, + { + "type": "string", + "enum": [ + "bd" + ], + "title": "Bangladesh" + }, + { + "type": "string", + "enum": [ + "bg" + ], + "title": "Bulgaria" + }, + { + "type": "string", + "enum": [ + "bh" + ], + "title": "Bahrain" + }, + { + "type": "string", + "enum": [ + "bs" + ], + "title": "Bahamas" + }, + { + "type": "string", + "enum": [ + "ba" + ], + "title": "Bosnia and Herzegovina" + }, + { + "type": "string", + "enum": [ + "by" + ], + "title": "Belarus" + }, + { + "type": "string", + "enum": [ + "bz" + ], + "title": "Belize" + }, + { + "type": "string", + "enum": [ + "bo" + ], + "title": "Bolivia" + }, + { + "type": "string", + "enum": [ + "br" + ], + "title": "Brazil" + }, + { + "type": "string", + "enum": [ + "bb" + ], + "title": "Barbados" + }, + { + "type": "string", + "enum": [ + "bn" + ], + "title": "Brunei Darussalam" + }, + { + "type": "string", + "enum": [ + "bt" + ], + "title": "Bhutan" + }, + { + "type": "string", + "enum": [ + "bw" + ], + "title": "Botswana" + }, + { + "type": "string", + "enum": [ + "cf" + ], + "title": "Central African Republic" + }, + { + "type": "string", + "enum": [ + "ca" + ], + "title": "Canada" + }, + { + "type": "string", + "enum": [ + "ch" + ], + "title": "Switzerland" + }, + { + "type": "string", + "enum": [ + "cl" + ], + "title": "Chile" + }, + { + "type": "string", + "enum": [ + "cn" + ], + "title": "China" + }, + { + "type": "string", + "enum": [ + "ci" + ], + "title": "C\u00f4te d'Ivoire" + }, + { + "type": "string", + "enum": [ + "cm" + ], + "title": "Cameroon" + }, + { + "type": "string", + "enum": [ + "cd" + ], + "title": "Democratic Republic of the Congo" + }, + { + "type": "string", + "enum": [ + "cg" + ], + "title": "Republic of the Congo" + }, + { + "type": "string", + "enum": [ + "co" + ], + "title": "Colombia" + }, + { + "type": "string", + "enum": [ + "km" + ], + "title": "Comoros" + }, + { + "type": "string", + "enum": [ + "cv" + ], + "title": "Cape Verde" + }, + { + "type": "string", + "enum": [ + "cr" + ], + "title": "Costa Rica" + }, + { + "type": "string", + "enum": [ + "cu" + ], + "title": "Cuba" + }, + { + "type": "string", + "enum": [ + "cy" + ], + "title": "Cyprus" + }, + { + "type": "string", + "enum": [ + "cz" + ], + "title": "Czech Republic" + }, + { + "type": "string", + "enum": [ + "de" + ], + "title": "Germany" + }, + { + "type": "string", + "enum": [ + "dj" + ], + "title": "Djibouti" + }, + { + "type": "string", + "enum": [ + "dm" + ], + "title": "Dominica" + }, + { + "type": "string", + "enum": [ + "dk" + ], + "title": "Denmark" + }, + { + "type": "string", + "enum": [ + "do" + ], + "title": "Dominican Republic" + }, + { + "type": "string", + "enum": [ + "dz" + ], + "title": "Algeria" + }, + { + "type": "string", + "enum": [ + "ec" + ], + "title": "Ecuador" + }, + { + "type": "string", + "enum": [ + "eg" + ], + "title": "Egypt" + }, + { + "type": "string", + "enum": [ + "er" + ], + "title": "Eritrea" + }, + { + "type": "string", + "enum": [ + "es" + ], + "title": "Spain" + }, + { + "type": "string", + "enum": [ + "ee" + ], + "title": "Estonia" + }, + { + "type": "string", + "enum": [ + "et" + ], + "title": "Ethiopia" + }, + { + "type": "string", + "enum": [ + "fi" + ], + "title": "Finland" + }, + { + "type": "string", + "enum": [ + "fj" + ], + "title": "Fiji" + }, + { + "type": "string", + "enum": [ + "fr" + ], + "title": "France" + }, + { + "type": "string", + "enum": [ + "fm" + ], + "title": "Micronesia (Federated States of)" + }, + { + "type": "string", + "enum": [ + "ga" + ], + "title": "Gabon" + }, + { + "type": "string", + "enum": [ + "gb" + ], + "title": "United Kingdom" + }, + { + "type": "string", + "enum": [ + "ge" + ], + "title": "Georgia" + }, + { + "type": "string", + "enum": [ + "gh" + ], + "title": "Ghana" + }, + { + "type": "string", + "enum": [ + "gn" + ], + "title": "Guinea" + }, + { + "type": "string", + "enum": [ + "gm" + ], + "title": "Gambia" + }, + { + "type": "string", + "enum": [ + "gw" + ], + "title": "Guinea-Bissau" + }, + { + "type": "string", + "enum": [ + "gq" + ], + "title": "Equatorial Guinea" + }, + { + "type": "string", + "enum": [ + "gr" + ], + "title": "Greece" + }, + { + "type": "string", + "enum": [ + "gd" + ], + "title": "Grenada" + }, + { + "type": "string", + "enum": [ + "gt" + ], + "title": "Guatemala" + }, + { + "type": "string", + "enum": [ + "gy" + ], + "title": "Guyana" + }, + { + "type": "string", + "enum": [ + "hn" + ], + "title": "Honduras" + }, + { + "type": "string", + "enum": [ + "hr" + ], + "title": "Croatia" + }, + { + "type": "string", + "enum": [ + "ht" + ], + "title": "Haiti" + }, + { + "type": "string", + "enum": [ + "hu" + ], + "title": "Hungary" + }, + { + "type": "string", + "enum": [ + "id" + ], + "title": "Indonesia" + }, + { + "type": "string", + "enum": [ + "in" + ], + "title": "India" + }, + { + "type": "string", + "enum": [ + "ie" + ], + "title": "Ireland" + }, + { + "type": "string", + "enum": [ + "ir" + ], + "title": "Iran (Islamic Republic of)" + }, + { + "type": "string", + "enum": [ + "iq" + ], + "title": "Iraq" + }, + { + "type": "string", + "enum": [ + "is" + ], + "title": "Iceland" + }, + { + "type": "string", + "enum": [ + "il" + ], + "title": "Israel" + }, + { + "type": "string", + "enum": [ + "it" + ], + "title": "Italy" + }, + { + "type": "string", + "enum": [ + "jm" + ], + "title": "Jamaica" + }, + { + "type": "string", + "enum": [ + "jo" + ], + "title": "Jordan" + }, + { + "type": "string", + "enum": [ + "jp" + ], + "title": "Japan" + }, + { + "type": "string", + "enum": [ + "kz" + ], + "title": "Kazakhstan" + }, + { + "type": "string", + "enum": [ + "ke" + ], + "title": "Kenya" + }, + { + "type": "string", + "enum": [ + "kg" + ], + "title": "Kyrgyzstan" + }, + { + "type": "string", + "enum": [ + "kh" + ], + "title": "Cambodia" + }, + { + "type": "string", + "enum": [ + "ki" + ], + "title": "Kiribati" + }, + { + "type": "string", + "enum": [ + "kn" + ], + "title": "Saint Kitts and Nevis" + }, + { + "type": "string", + "enum": [ + "kr" + ], + "title": "South Korea" + }, + { + "type": "string", + "enum": [ + "kw" + ], + "title": "Kuwait" + }, + { + "type": "string", + "enum": [ + "la" + ], + "title": "Lao People's Democratic Republic" + }, + { + "type": "string", + "enum": [ + "lb" + ], + "title": "Lebanon" + }, + { + "type": "string", + "enum": [ + "lr" + ], + "title": "Liberia" + }, + { + "type": "string", + "enum": [ + "ly" + ], + "title": "Libya" + }, + { + "type": "string", + "enum": [ + "lc" + ], + "title": "Saint Lucia" + }, + { + "type": "string", + "enum": [ + "li" + ], + "title": "Liechtenstein" + }, + { + "type": "string", + "enum": [ + "lk" + ], + "title": "Sri Lanka" + }, + { + "type": "string", + "enum": [ + "ls" + ], + "title": "Lesotho" + }, + { + "type": "string", + "enum": [ + "lt" + ], + "title": "Lithuania" + }, + { + "type": "string", + "enum": [ + "lu" + ], + "title": "Luxembourg" + }, + { + "type": "string", + "enum": [ + "lv" + ], + "title": "Latvia" + }, + { + "type": "string", + "enum": [ + "ma" + ], + "title": "Morocco" + }, + { + "type": "string", + "enum": [ + "mc" + ], + "title": "Monaco" + }, + { + "type": "string", + "enum": [ + "md" + ], + "title": "Moldova" + }, + { + "type": "string", + "enum": [ + "mg" + ], + "title": "Madagascar" + }, + { + "type": "string", + "enum": [ + "mv" + ], + "title": "Maldives" + }, + { + "type": "string", + "enum": [ + "mx" + ], + "title": "Mexico" + }, + { + "type": "string", + "enum": [ + "mh" + ], + "title": "Marshall Islands" + }, + { + "type": "string", + "enum": [ + "mk" + ], + "title": "North Macedonia" + }, + { + "type": "string", + "enum": [ + "ml" + ], + "title": "Mali" + }, + { + "type": "string", + "enum": [ + "mt" + ], + "title": "Malta" + }, + { + "type": "string", + "enum": [ + "mm" + ], + "title": "Myanmar" + }, + { + "type": "string", + "enum": [ + "me" + ], + "title": "Montenegro" + }, + { + "type": "string", + "enum": [ + "mn" + ], + "title": "Mongolia" + }, + { + "type": "string", + "enum": [ + "mz" + ], + "title": "Mozambique" + }, + { + "type": "string", + "enum": [ + "mr" + ], + "title": "Mauritania" + }, + { + "type": "string", + "enum": [ + "mu" + ], + "title": "Mauritius" + }, + { + "type": "string", + "enum": [ + "mw" + ], + "title": "Malawi" + }, + { + "type": "string", + "enum": [ + "my" + ], + "title": "Malaysia" + }, + { + "type": "string", + "enum": [ + "na" + ], + "title": "Namibia" + }, + { + "type": "string", + "enum": [ + "ne" + ], + "title": "Niger" + }, + { + "type": "string", + "enum": [ + "ng" + ], + "title": "Nigeria" + }, + { + "type": "string", + "enum": [ + "ni" + ], + "title": "Nicaragua" + }, + { + "type": "string", + "enum": [ + "nl" + ], + "title": "Netherlands" + }, + { + "type": "string", + "enum": [ + "no" + ], + "title": "Norway" + }, + { + "type": "string", + "enum": [ + "np" + ], + "title": "Nepal" + }, + { + "type": "string", + "enum": [ + "nr" + ], + "title": "Nauru" + }, + { + "type": "string", + "enum": [ + "nz" + ], + "title": "New Zealand" + }, + { + "type": "string", + "enum": [ + "om" + ], + "title": "Oman" + }, + { + "type": "string", + "enum": [ + "pk" + ], + "title": "Pakistan" + }, + { + "type": "string", + "enum": [ + "pa" + ], + "title": "Panama" + }, + { + "type": "string", + "enum": [ + "pe" + ], + "title": "Peru" + }, + { + "type": "string", + "enum": [ + "ph" + ], + "title": "Philippines" + }, + { + "type": "string", + "enum": [ + "pw" + ], + "title": "Palau" + }, + { + "type": "string", + "enum": [ + "pg" + ], + "title": "Papua New Guinea" + }, + { + "type": "string", + "enum": [ + "pl" + ], + "title": "Poland" + }, + { + "type": "string", + "enum": [ + "pf" + ], + "title": "French Polynesia" + }, + { + "type": "string", + "enum": [ + "kp" + ], + "title": "North Korea" + }, + { + "type": "string", + "enum": [ + "pt" + ], + "title": "Portugal" + }, + { + "type": "string", + "enum": [ + "py" + ], + "title": "Paraguay" + }, + { + "type": "string", + "enum": [ + "qa" + ], + "title": "Qatar" + }, + { + "type": "string", + "enum": [ + "ro" + ], + "title": "Romania" + }, + { + "type": "string", + "enum": [ + "ru" + ], + "title": "Russia" + }, + { + "type": "string", + "enum": [ + "rw" + ], + "title": "Rwanda" + }, + { + "type": "string", + "enum": [ + "sa" + ], + "title": "Saudi Arabia" + }, + { + "type": "string", + "enum": [ + "sd" + ], + "title": "Sudan" + }, + { + "type": "string", + "enum": [ + "sn" + ], + "title": "Senegal" + }, + { + "type": "string", + "enum": [ + "sg" + ], + "title": "Singapore" + }, + { + "type": "string", + "enum": [ + "sb" + ], + "title": "Solomon Islands" + }, + { + "type": "string", + "enum": [ + "sl" + ], + "title": "Sierra Leone" + }, + { + "type": "string", + "enum": [ + "sv" + ], + "title": "El Salvador" + }, + { + "type": "string", + "enum": [ + "sm" + ], + "title": "San Marino" + }, + { + "type": "string", + "enum": [ + "so" + ], + "title": "Somalia" + }, + { + "type": "string", + "enum": [ + "rs" + ], + "title": "Serbia" + }, + { + "type": "string", + "enum": [ + "ss" + ], + "title": "South Sudan" + }, + { + "type": "string", + "enum": [ + "st" + ], + "title": "Sao Tome and Principe" + }, + { + "type": "string", + "enum": [ + "sr" + ], + "title": "Suriname" + }, + { + "type": "string", + "enum": [ + "sk" + ], + "title": "Slovakia" + }, + { + "type": "string", + "enum": [ + "si" + ], + "title": "Slovenia" + }, + { + "type": "string", + "enum": [ + "se" + ], + "title": "Sweden" + }, + { + "type": "string", + "enum": [ + "sz" + ], + "title": "Eswatini" + }, + { + "type": "string", + "enum": [ + "sc" + ], + "title": "Seychelles" + }, + { + "type": "string", + "enum": [ + "sy" + ], + "title": "Syria" + }, + { + "type": "string", + "enum": [ + "td" + ], + "title": "Chad" + }, + { + "type": "string", + "enum": [ + "tg" + ], + "title": "Togo" + }, + { + "type": "string", + "enum": [ + "th" + ], + "title": "Thailand" + }, + { + "type": "string", + "enum": [ + "tj" + ], + "title": "Tajikistan" + }, + { + "type": "string", + "enum": [ + "tm" + ], + "title": "Turkmenistan" + }, + { + "type": "string", + "enum": [ + "tl" + ], + "title": "Timor-Leste" + }, + { + "type": "string", + "enum": [ + "to" + ], + "title": "Tonga" + }, + { + "type": "string", + "enum": [ + "tt" + ], + "title": "Trinidad and Tobago" + }, + { + "type": "string", + "enum": [ + "tn" + ], + "title": "Tunisia" + }, + { + "type": "string", + "enum": [ + "tr" + ], + "title": "Turkey" + }, + { + "type": "string", + "enum": [ + "tv" + ], + "title": "Tuvalu" + }, + { + "type": "string", + "enum": [ + "tz" + ], + "title": "Tanzania" + }, + { + "type": "string", + "enum": [ + "ug" + ], + "title": "Uganda" + }, + { + "type": "string", + "enum": [ + "ua" + ], + "title": "Ukraine" + }, + { + "type": "string", + "enum": [ + "uy" + ], + "title": "Uruguay" + }, + { + "type": "string", + "enum": [ + "us" + ], + "title": "United States" + }, + { + "type": "string", + "enum": [ + "uz" + ], + "title": "Uzbekistan" + }, + { + "type": "string", + "enum": [ + "va" + ], + "title": "Vatican City" + }, + { + "type": "string", + "enum": [ + "vc" + ], + "title": "Saint Vincent and the Grenadines" + }, + { + "type": "string", + "enum": [ + "ve" + ], + "title": "Venezuela" + }, + { + "type": "string", + "enum": [ + "vn" + ], + "title": "Vietnam" + }, + { + "type": "string", + "enum": [ + "vu" + ], + "title": "Vanuatu" + }, + { + "type": "string", + "enum": [ + "ws" + ], + "title": "Samoa" + }, + { + "type": "string", + "enum": [ + "ye" + ], + "title": "Yemen" + }, + { + "type": "string", + "enum": [ + "za" + ], + "title": "South Africa" + }, + { + "type": "string", + "enum": [ + "zm" + ], + "title": "Zambia" + }, + { + "type": "string", + "enum": [ + "zw" + ], + "title": "Zimbabwe" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 400 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<NAME>", + "default": "" + }, + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/photo": { + "get": { + "summary": "Get user photo", + "operationId": "avatarsGetPhoto", + "tags": [ + "avatars" + ], + "description": "Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.\n\nPassing `userId` \u2014 `current()` for the authenticated user \u2014 resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and\/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-photo.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "width", + "description": "Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "height", + "description": "Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Output image quality between 0 and 100. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "output", + "description": "Output image format. Defaults to 'png'.", + "required": false, + "schema": { + "type": "string", + "example": "png", + "default": "png" + }, + "in": "query" + }, + { + "name": "rating", + "description": "Maximum image rating to fetch from Gravatar\/Libravatar. Defaults to 'g'.", + "required": false, + "schema": { + "type": "string", + "example": "g", + "default": "g" + }, + "in": "query" + }, + { + "name": "userId", + "description": "User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed.", + "required": false, + "schema": { + "type": "string", + "example": "current()", + "default": "" + }, + "in": "query" + }, + { + "name": "emailHash", + "description": "SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself.", + "required": false, + "schema": { + "type": "string", + "example": "<EMAIL_HASH>", + "default": "" + }, + "in": "query" + }, + { + "name": "name", + "description": "Name to render initials from instead of the user's own name. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<NAME>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "example": "<TEXT>" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/avatars\/screenshots": { + "get": { + "summary": "Get webpage screenshot", + "operationId": "avatarsGetScreenshot", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.\n\nYou can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.\n\nWhen width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-screenshot.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to capture.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "headers", + "description": "HTTP headers to send with the browser request. Defaults to empty.", + "required": false, + "schema": { + "type": "object", + "default": [], + "example": { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + } + }, + "in": "query" + }, + { + "name": "viewportWidth", + "description": "Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1920, + "default": 1280 + }, + "in": "query" + }, + { + "name": "viewportHeight", + "description": "Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1080, + "default": 720 + }, + "in": "query" + }, + { + "name": "scale", + "description": "Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 2, + "default": 1 + }, + "in": "query" + }, + { + "name": "theme", + "description": "Browser theme. Pass \"light\" or \"dark\". Defaults to \"light\".", + "required": false, + "schema": { + "type": "string", + "example": "dark", + "title": "BrowserTheme", + "oneOf": [ + { + "type": "string", + "enum": [ + "light" + ], + "title": "light" + }, + { + "type": "string", + "enum": [ + "dark" + ], + "title": "dark" + } + ], + "default": "light" + }, + "in": "query" + }, + { + "name": "userAgent", + "description": "Custom user agent string. Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "Mozilla\/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit\/605.1.15", + "default": "" + }, + "in": "query" + }, + { + "name": "fullpage", + "description": "Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": true, + "default": false + }, + "in": "query" + }, + { + "name": "locale", + "description": "Browser locale (e.g., \"en-US\", \"fr-FR\"). Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "en-US", + "default": "" + }, + "in": "query" + }, + { + "name": "timezone", + "description": "IANA timezone identifier (e.g., \"America\/New_York\", \"Europe\/London\"). Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "America\/New_York", + "title": "Timezone", + "oneOf": [ + { + "type": "string", + "enum": [ + "africa\/abidjan" + ], + "title": "africa\/abidjan" + }, + { + "type": "string", + "enum": [ + "africa\/accra" + ], + "title": "africa\/accra" + }, + { + "type": "string", + "enum": [ + "africa\/addis_ababa" + ], + "title": "africa\/addis_ababa" + }, + { + "type": "string", + "enum": [ + "africa\/algiers" + ], + "title": "africa\/algiers" + }, + { + "type": "string", + "enum": [ + "africa\/asmara" + ], + "title": "africa\/asmara" + }, + { + "type": "string", + "enum": [ + "africa\/bamako" + ], + "title": "africa\/bamako" + }, + { + "type": "string", + "enum": [ + "africa\/bangui" + ], + "title": "africa\/bangui" + }, + { + "type": "string", + "enum": [ + "africa\/banjul" + ], + "title": "africa\/banjul" + }, + { + "type": "string", + "enum": [ + "africa\/bissau" + ], + "title": "africa\/bissau" + }, + { + "type": "string", + "enum": [ + "africa\/blantyre" + ], + "title": "africa\/blantyre" + }, + { + "type": "string", + "enum": [ + "africa\/brazzaville" + ], + "title": "africa\/brazzaville" + }, + { + "type": "string", + "enum": [ + "africa\/bujumbura" + ], + "title": "africa\/bujumbura" + }, + { + "type": "string", + "enum": [ + "africa\/cairo" + ], + "title": "africa\/cairo" + }, + { + "type": "string", + "enum": [ + "africa\/casablanca" + ], + "title": "africa\/casablanca" + }, + { + "type": "string", + "enum": [ + "africa\/ceuta" + ], + "title": "africa\/ceuta" + }, + { + "type": "string", + "enum": [ + "africa\/conakry" + ], + "title": "africa\/conakry" + }, + { + "type": "string", + "enum": [ + "africa\/dakar" + ], + "title": "africa\/dakar" + }, + { + "type": "string", + "enum": [ + "africa\/dar_es_salaam" + ], + "title": "africa\/dar_es_salaam" + }, + { + "type": "string", + "enum": [ + "africa\/djibouti" + ], + "title": "africa\/djibouti" + }, + { + "type": "string", + "enum": [ + "africa\/douala" + ], + "title": "africa\/douala" + }, + { + "type": "string", + "enum": [ + "africa\/el_aaiun" + ], + "title": "africa\/el_aaiun" + }, + { + "type": "string", + "enum": [ + "africa\/freetown" + ], + "title": "africa\/freetown" + }, + { + "type": "string", + "enum": [ + "africa\/gaborone" + ], + "title": "africa\/gaborone" + }, + { + "type": "string", + "enum": [ + "africa\/harare" + ], + "title": "africa\/harare" + }, + { + "type": "string", + "enum": [ + "africa\/johannesburg" + ], + "title": "africa\/johannesburg" + }, + { + "type": "string", + "enum": [ + "africa\/juba" + ], + "title": "africa\/juba" + }, + { + "type": "string", + "enum": [ + "africa\/kampala" + ], + "title": "africa\/kampala" + }, + { + "type": "string", + "enum": [ + "africa\/khartoum" + ], + "title": "africa\/khartoum" + }, + { + "type": "string", + "enum": [ + "africa\/kigali" + ], + "title": "africa\/kigali" + }, + { + "type": "string", + "enum": [ + "africa\/kinshasa" + ], + "title": "africa\/kinshasa" + }, + { + "type": "string", + "enum": [ + "africa\/lagos" + ], + "title": "africa\/lagos" + }, + { + "type": "string", + "enum": [ + "africa\/libreville" + ], + "title": "africa\/libreville" + }, + { + "type": "string", + "enum": [ + "africa\/lome" + ], + "title": "africa\/lome" + }, + { + "type": "string", + "enum": [ + "africa\/luanda" + ], + "title": "africa\/luanda" + }, + { + "type": "string", + "enum": [ + "africa\/lubumbashi" + ], + "title": "africa\/lubumbashi" + }, + { + "type": "string", + "enum": [ + "africa\/lusaka" + ], + "title": "africa\/lusaka" + }, + { + "type": "string", + "enum": [ + "africa\/malabo" + ], + "title": "africa\/malabo" + }, + { + "type": "string", + "enum": [ + "africa\/maputo" + ], + "title": "africa\/maputo" + }, + { + "type": "string", + "enum": [ + "africa\/maseru" + ], + "title": "africa\/maseru" + }, + { + "type": "string", + "enum": [ + "africa\/mbabane" + ], + "title": "africa\/mbabane" + }, + { + "type": "string", + "enum": [ + "africa\/mogadishu" + ], + "title": "africa\/mogadishu" + }, + { + "type": "string", + "enum": [ + "africa\/monrovia" + ], + "title": "africa\/monrovia" + }, + { + "type": "string", + "enum": [ + "africa\/nairobi" + ], + "title": "africa\/nairobi" + }, + { + "type": "string", + "enum": [ + "africa\/ndjamena" + ], + "title": "africa\/ndjamena" + }, + { + "type": "string", + "enum": [ + "africa\/niamey" + ], + "title": "africa\/niamey" + }, + { + "type": "string", + "enum": [ + "africa\/nouakchott" + ], + "title": "africa\/nouakchott" + }, + { + "type": "string", + "enum": [ + "africa\/ouagadougou" + ], + "title": "africa\/ouagadougou" + }, + { + "type": "string", + "enum": [ + "africa\/porto-novo" + ], + "title": "africa\/porto-novo" + }, + { + "type": "string", + "enum": [ + "africa\/sao_tome" + ], + "title": "africa\/sao_tome" + }, + { + "type": "string", + "enum": [ + "africa\/tripoli" + ], + "title": "africa\/tripoli" + }, + { + "type": "string", + "enum": [ + "africa\/tunis" + ], + "title": "africa\/tunis" + }, + { + "type": "string", + "enum": [ + "africa\/windhoek" + ], + "title": "africa\/windhoek" + }, + { + "type": "string", + "enum": [ + "america\/adak" + ], + "title": "america\/adak" + }, + { + "type": "string", + "enum": [ + "america\/anchorage" + ], + "title": "america\/anchorage" + }, + { + "type": "string", + "enum": [ + "america\/anguilla" + ], + "title": "america\/anguilla" + }, + { + "type": "string", + "enum": [ + "america\/antigua" + ], + "title": "america\/antigua" + }, + { + "type": "string", + "enum": [ + "america\/araguaina" + ], + "title": "america\/araguaina" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/buenos_aires" + ], + "title": "america\/argentina\/buenos_aires" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/catamarca" + ], + "title": "america\/argentina\/catamarca" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/cordoba" + ], + "title": "america\/argentina\/cordoba" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/jujuy" + ], + "title": "america\/argentina\/jujuy" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/la_rioja" + ], + "title": "america\/argentina\/la_rioja" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/mendoza" + ], + "title": "america\/argentina\/mendoza" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/rio_gallegos" + ], + "title": "america\/argentina\/rio_gallegos" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/salta" + ], + "title": "america\/argentina\/salta" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/san_juan" + ], + "title": "america\/argentina\/san_juan" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/san_luis" + ], + "title": "america\/argentina\/san_luis" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/tucuman" + ], + "title": "america\/argentina\/tucuman" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/ushuaia" + ], + "title": "america\/argentina\/ushuaia" + }, + { + "type": "string", + "enum": [ + "america\/aruba" + ], + "title": "america\/aruba" + }, + { + "type": "string", + "enum": [ + "america\/asuncion" + ], + "title": "america\/asuncion" + }, + { + "type": "string", + "enum": [ + "america\/atikokan" + ], + "title": "america\/atikokan" + }, + { + "type": "string", + "enum": [ + "america\/bahia" + ], + "title": "america\/bahia" + }, + { + "type": "string", + "enum": [ + "america\/bahia_banderas" + ], + "title": "america\/bahia_banderas" + }, + { + "type": "string", + "enum": [ + "america\/barbados" + ], + "title": "america\/barbados" + }, + { + "type": "string", + "enum": [ + "america\/belem" + ], + "title": "america\/belem" + }, + { + "type": "string", + "enum": [ + "america\/belize" + ], + "title": "america\/belize" + }, + { + "type": "string", + "enum": [ + "america\/blanc-sablon" + ], + "title": "america\/blanc-sablon" + }, + { + "type": "string", + "enum": [ + "america\/boa_vista" + ], + "title": "america\/boa_vista" + }, + { + "type": "string", + "enum": [ + "america\/bogota" + ], + "title": "america\/bogota" + }, + { + "type": "string", + "enum": [ + "america\/boise" + ], + "title": "america\/boise" + }, + { + "type": "string", + "enum": [ + "america\/cambridge_bay" + ], + "title": "america\/cambridge_bay" + }, + { + "type": "string", + "enum": [ + "america\/campo_grande" + ], + "title": "america\/campo_grande" + }, + { + "type": "string", + "enum": [ + "america\/cancun" + ], + "title": "america\/cancun" + }, + { + "type": "string", + "enum": [ + "america\/caracas" + ], + "title": "america\/caracas" + }, + { + "type": "string", + "enum": [ + "america\/cayenne" + ], + "title": "america\/cayenne" + }, + { + "type": "string", + "enum": [ + "america\/cayman" + ], + "title": "america\/cayman" + }, + { + "type": "string", + "enum": [ + "america\/chicago" + ], + "title": "america\/chicago" + }, + { + "type": "string", + "enum": [ + "america\/chihuahua" + ], + "title": "america\/chihuahua" + }, + { + "type": "string", + "enum": [ + "america\/ciudad_juarez" + ], + "title": "america\/ciudad_juarez" + }, + { + "type": "string", + "enum": [ + "america\/costa_rica" + ], + "title": "america\/costa_rica" + }, + { + "type": "string", + "enum": [ + "america\/coyhaique" + ], + "title": "america\/coyhaique" + }, + { + "type": "string", + "enum": [ + "america\/creston" + ], + "title": "america\/creston" + }, + { + "type": "string", + "enum": [ + "america\/cuiaba" + ], + "title": "america\/cuiaba" + }, + { + "type": "string", + "enum": [ + "america\/curacao" + ], + "title": "america\/curacao" + }, + { + "type": "string", + "enum": [ + "america\/danmarkshavn" + ], + "title": "america\/danmarkshavn" + }, + { + "type": "string", + "enum": [ + "america\/dawson" + ], + "title": "america\/dawson" + }, + { + "type": "string", + "enum": [ + "america\/dawson_creek" + ], + "title": "america\/dawson_creek" + }, + { + "type": "string", + "enum": [ + "america\/denver" + ], + "title": "america\/denver" + }, + { + "type": "string", + "enum": [ + "america\/detroit" + ], + "title": "america\/detroit" + }, + { + "type": "string", + "enum": [ + "america\/dominica" + ], + "title": "america\/dominica" + }, + { + "type": "string", + "enum": [ + "america\/edmonton" + ], + "title": "america\/edmonton" + }, + { + "type": "string", + "enum": [ + "america\/eirunepe" + ], + "title": "america\/eirunepe" + }, + { + "type": "string", + "enum": [ + "america\/el_salvador" + ], + "title": "america\/el_salvador" + }, + { + "type": "string", + "enum": [ + "america\/fort_nelson" + ], + "title": "america\/fort_nelson" + }, + { + "type": "string", + "enum": [ + "america\/fortaleza" + ], + "title": "america\/fortaleza" + }, + { + "type": "string", + "enum": [ + "america\/glace_bay" + ], + "title": "america\/glace_bay" + }, + { + "type": "string", + "enum": [ + "america\/goose_bay" + ], + "title": "america\/goose_bay" + }, + { + "type": "string", + "enum": [ + "america\/grand_turk" + ], + "title": "america\/grand_turk" + }, + { + "type": "string", + "enum": [ + "america\/grenada" + ], + "title": "america\/grenada" + }, + { + "type": "string", + "enum": [ + "america\/guadeloupe" + ], + "title": "america\/guadeloupe" + }, + { + "type": "string", + "enum": [ + "america\/guatemala" + ], + "title": "america\/guatemala" + }, + { + "type": "string", + "enum": [ + "america\/guayaquil" + ], + "title": "america\/guayaquil" + }, + { + "type": "string", + "enum": [ + "america\/guyana" + ], + "title": "america\/guyana" + }, + { + "type": "string", + "enum": [ + "america\/halifax" + ], + "title": "america\/halifax" + }, + { + "type": "string", + "enum": [ + "america\/havana" + ], + "title": "america\/havana" + }, + { + "type": "string", + "enum": [ + "america\/hermosillo" + ], + "title": "america\/hermosillo" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/indianapolis" + ], + "title": "america\/indiana\/indianapolis" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/knox" + ], + "title": "america\/indiana\/knox" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/marengo" + ], + "title": "america\/indiana\/marengo" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/petersburg" + ], + "title": "america\/indiana\/petersburg" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/tell_city" + ], + "title": "america\/indiana\/tell_city" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/vevay" + ], + "title": "america\/indiana\/vevay" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/vincennes" + ], + "title": "america\/indiana\/vincennes" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/winamac" + ], + "title": "america\/indiana\/winamac" + }, + { + "type": "string", + "enum": [ + "america\/inuvik" + ], + "title": "america\/inuvik" + }, + { + "type": "string", + "enum": [ + "america\/iqaluit" + ], + "title": "america\/iqaluit" + }, + { + "type": "string", + "enum": [ + "america\/jamaica" + ], + "title": "america\/jamaica" + }, + { + "type": "string", + "enum": [ + "america\/juneau" + ], + "title": "america\/juneau" + }, + { + "type": "string", + "enum": [ + "america\/kentucky\/louisville" + ], + "title": "america\/kentucky\/louisville" + }, + { + "type": "string", + "enum": [ + "america\/kentucky\/monticello" + ], + "title": "america\/kentucky\/monticello" + }, + { + "type": "string", + "enum": [ + "america\/kralendijk" + ], + "title": "america\/kralendijk" + }, + { + "type": "string", + "enum": [ + "america\/la_paz" + ], + "title": "america\/la_paz" + }, + { + "type": "string", + "enum": [ + "america\/lima" + ], + "title": "america\/lima" + }, + { + "type": "string", + "enum": [ + "america\/los_angeles" + ], + "title": "america\/los_angeles" + }, + { + "type": "string", + "enum": [ + "america\/lower_princes" + ], + "title": "america\/lower_princes" + }, + { + "type": "string", + "enum": [ + "america\/maceio" + ], + "title": "america\/maceio" + }, + { + "type": "string", + "enum": [ + "america\/managua" + ], + "title": "america\/managua" + }, + { + "type": "string", + "enum": [ + "america\/manaus" + ], + "title": "america\/manaus" + }, + { + "type": "string", + "enum": [ + "america\/marigot" + ], + "title": "america\/marigot" + }, + { + "type": "string", + "enum": [ + "america\/martinique" + ], + "title": "america\/martinique" + }, + { + "type": "string", + "enum": [ + "america\/matamoros" + ], + "title": "america\/matamoros" + }, + { + "type": "string", + "enum": [ + "america\/mazatlan" + ], + "title": "america\/mazatlan" + }, + { + "type": "string", + "enum": [ + "america\/menominee" + ], + "title": "america\/menominee" + }, + { + "type": "string", + "enum": [ + "america\/merida" + ], + "title": "america\/merida" + }, + { + "type": "string", + "enum": [ + "america\/metlakatla" + ], + "title": "america\/metlakatla" + }, + { + "type": "string", + "enum": [ + "america\/mexico_city" + ], + "title": "america\/mexico_city" + }, + { + "type": "string", + "enum": [ + "america\/miquelon" + ], + "title": "america\/miquelon" + }, + { + "type": "string", + "enum": [ + "america\/moncton" + ], + "title": "america\/moncton" + }, + { + "type": "string", + "enum": [ + "america\/monterrey" + ], + "title": "america\/monterrey" + }, + { + "type": "string", + "enum": [ + "america\/montevideo" + ], + "title": "america\/montevideo" + }, + { + "type": "string", + "enum": [ + "america\/montserrat" + ], + "title": "america\/montserrat" + }, + { + "type": "string", + "enum": [ + "america\/nassau" + ], + "title": "america\/nassau" + }, + { + "type": "string", + "enum": [ + "america\/new_york" + ], + "title": "america\/new_york" + }, + { + "type": "string", + "enum": [ + "america\/nome" + ], + "title": "america\/nome" + }, + { + "type": "string", + "enum": [ + "america\/noronha" + ], + "title": "america\/noronha" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/beulah" + ], + "title": "america\/north_dakota\/beulah" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/center" + ], + "title": "america\/north_dakota\/center" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/new_salem" + ], + "title": "america\/north_dakota\/new_salem" + }, + { + "type": "string", + "enum": [ + "america\/nuuk" + ], + "title": "america\/nuuk" + }, + { + "type": "string", + "enum": [ + "america\/ojinaga" + ], + "title": "america\/ojinaga" + }, + { + "type": "string", + "enum": [ + "america\/panama" + ], + "title": "america\/panama" + }, + { + "type": "string", + "enum": [ + "america\/paramaribo" + ], + "title": "america\/paramaribo" + }, + { + "type": "string", + "enum": [ + "america\/phoenix" + ], + "title": "america\/phoenix" + }, + { + "type": "string", + "enum": [ + "america\/port-au-prince" + ], + "title": "america\/port-au-prince" + }, + { + "type": "string", + "enum": [ + "america\/port_of_spain" + ], + "title": "america\/port_of_spain" + }, + { + "type": "string", + "enum": [ + "america\/porto_velho" + ], + "title": "america\/porto_velho" + }, + { + "type": "string", + "enum": [ + "america\/puerto_rico" + ], + "title": "america\/puerto_rico" + }, + { + "type": "string", + "enum": [ + "america\/punta_arenas" + ], + "title": "america\/punta_arenas" + }, + { + "type": "string", + "enum": [ + "america\/rankin_inlet" + ], + "title": "america\/rankin_inlet" + }, + { + "type": "string", + "enum": [ + "america\/recife" + ], + "title": "america\/recife" + }, + { + "type": "string", + "enum": [ + "america\/regina" + ], + "title": "america\/regina" + }, + { + "type": "string", + "enum": [ + "america\/resolute" + ], + "title": "america\/resolute" + }, + { + "type": "string", + "enum": [ + "america\/rio_branco" + ], + "title": "america\/rio_branco" + }, + { + "type": "string", + "enum": [ + "america\/santarem" + ], + "title": "america\/santarem" + }, + { + "type": "string", + "enum": [ + "america\/santiago" + ], + "title": "america\/santiago" + }, + { + "type": "string", + "enum": [ + "america\/santo_domingo" + ], + "title": "america\/santo_domingo" + }, + { + "type": "string", + "enum": [ + "america\/sao_paulo" + ], + "title": "america\/sao_paulo" + }, + { + "type": "string", + "enum": [ + "america\/scoresbysund" + ], + "title": "america\/scoresbysund" + }, + { + "type": "string", + "enum": [ + "america\/sitka" + ], + "title": "america\/sitka" + }, + { + "type": "string", + "enum": [ + "america\/st_barthelemy" + ], + "title": "america\/st_barthelemy" + }, + { + "type": "string", + "enum": [ + "america\/st_johns" + ], + "title": "america\/st_johns" + }, + { + "type": "string", + "enum": [ + "america\/st_kitts" + ], + "title": "america\/st_kitts" + }, + { + "type": "string", + "enum": [ + "america\/st_lucia" + ], + "title": "america\/st_lucia" + }, + { + "type": "string", + "enum": [ + "america\/st_thomas" + ], + "title": "america\/st_thomas" + }, + { + "type": "string", + "enum": [ + "america\/st_vincent" + ], + "title": "america\/st_vincent" + }, + { + "type": "string", + "enum": [ + "america\/swift_current" + ], + "title": "america\/swift_current" + }, + { + "type": "string", + "enum": [ + "america\/tegucigalpa" + ], + "title": "america\/tegucigalpa" + }, + { + "type": "string", + "enum": [ + "america\/thule" + ], + "title": "america\/thule" + }, + { + "type": "string", + "enum": [ + "america\/tijuana" + ], + "title": "america\/tijuana" + }, + { + "type": "string", + "enum": [ + "america\/toronto" + ], + "title": "america\/toronto" + }, + { + "type": "string", + "enum": [ + "america\/tortola" + ], + "title": "america\/tortola" + }, + { + "type": "string", + "enum": [ + "america\/vancouver" + ], + "title": "america\/vancouver" + }, + { + "type": "string", + "enum": [ + "america\/whitehorse" + ], + "title": "america\/whitehorse" + }, + { + "type": "string", + "enum": [ + "america\/winnipeg" + ], + "title": "america\/winnipeg" + }, + { + "type": "string", + "enum": [ + "america\/yakutat" + ], + "title": "america\/yakutat" + }, + { + "type": "string", + "enum": [ + "antarctica\/casey" + ], + "title": "antarctica\/casey" + }, + { + "type": "string", + "enum": [ + "antarctica\/davis" + ], + "title": "antarctica\/davis" + }, + { + "type": "string", + "enum": [ + "antarctica\/dumontdurville" + ], + "title": "antarctica\/dumontdurville" + }, + { + "type": "string", + "enum": [ + "antarctica\/macquarie" + ], + "title": "antarctica\/macquarie" + }, + { + "type": "string", + "enum": [ + "antarctica\/mawson" + ], + "title": "antarctica\/mawson" + }, + { + "type": "string", + "enum": [ + "antarctica\/mcmurdo" + ], + "title": "antarctica\/mcmurdo" + }, + { + "type": "string", + "enum": [ + "antarctica\/palmer" + ], + "title": "antarctica\/palmer" + }, + { + "type": "string", + "enum": [ + "antarctica\/rothera" + ], + "title": "antarctica\/rothera" + }, + { + "type": "string", + "enum": [ + "antarctica\/syowa" + ], + "title": "antarctica\/syowa" + }, + { + "type": "string", + "enum": [ + "antarctica\/troll" + ], + "title": "antarctica\/troll" + }, + { + "type": "string", + "enum": [ + "antarctica\/vostok" + ], + "title": "antarctica\/vostok" + }, + { + "type": "string", + "enum": [ + "arctic\/longyearbyen" + ], + "title": "arctic\/longyearbyen" + }, + { + "type": "string", + "enum": [ + "asia\/aden" + ], + "title": "asia\/aden" + }, + { + "type": "string", + "enum": [ + "asia\/almaty" + ], + "title": "asia\/almaty" + }, + { + "type": "string", + "enum": [ + "asia\/amman" + ], + "title": "asia\/amman" + }, + { + "type": "string", + "enum": [ + "asia\/anadyr" + ], + "title": "asia\/anadyr" + }, + { + "type": "string", + "enum": [ + "asia\/aqtau" + ], + "title": "asia\/aqtau" + }, + { + "type": "string", + "enum": [ + "asia\/aqtobe" + ], + "title": "asia\/aqtobe" + }, + { + "type": "string", + "enum": [ + "asia\/ashgabat" + ], + "title": "asia\/ashgabat" + }, + { + "type": "string", + "enum": [ + "asia\/atyrau" + ], + "title": "asia\/atyrau" + }, + { + "type": "string", + "enum": [ + "asia\/baghdad" + ], + "title": "asia\/baghdad" + }, + { + "type": "string", + "enum": [ + "asia\/bahrain" + ], + "title": "asia\/bahrain" + }, + { + "type": "string", + "enum": [ + "asia\/baku" + ], + "title": "asia\/baku" + }, + { + "type": "string", + "enum": [ + "asia\/bangkok" + ], + "title": "asia\/bangkok" + }, + { + "type": "string", + "enum": [ + "asia\/barnaul" + ], + "title": "asia\/barnaul" + }, + { + "type": "string", + "enum": [ + "asia\/beirut" + ], + "title": "asia\/beirut" + }, + { + "type": "string", + "enum": [ + "asia\/bishkek" + ], + "title": "asia\/bishkek" + }, + { + "type": "string", + "enum": [ + "asia\/brunei" + ], + "title": "asia\/brunei" + }, + { + "type": "string", + "enum": [ + "asia\/chita" + ], + "title": "asia\/chita" + }, + { + "type": "string", + "enum": [ + "asia\/colombo" + ], + "title": "asia\/colombo" + }, + { + "type": "string", + "enum": [ + "asia\/damascus" + ], + "title": "asia\/damascus" + }, + { + "type": "string", + "enum": [ + "asia\/dhaka" + ], + "title": "asia\/dhaka" + }, + { + "type": "string", + "enum": [ + "asia\/dili" + ], + "title": "asia\/dili" + }, + { + "type": "string", + "enum": [ + "asia\/dubai" + ], + "title": "asia\/dubai" + }, + { + "type": "string", + "enum": [ + "asia\/dushanbe" + ], + "title": "asia\/dushanbe" + }, + { + "type": "string", + "enum": [ + "asia\/famagusta" + ], + "title": "asia\/famagusta" + }, + { + "type": "string", + "enum": [ + "asia\/gaza" + ], + "title": "asia\/gaza" + }, + { + "type": "string", + "enum": [ + "asia\/hebron" + ], + "title": "asia\/hebron" + }, + { + "type": "string", + "enum": [ + "asia\/ho_chi_minh" + ], + "title": "asia\/ho_chi_minh" + }, + { + "type": "string", + "enum": [ + "asia\/hong_kong" + ], + "title": "asia\/hong_kong" + }, + { + "type": "string", + "enum": [ + "asia\/hovd" + ], + "title": "asia\/hovd" + }, + { + "type": "string", + "enum": [ + "asia\/irkutsk" + ], + "title": "asia\/irkutsk" + }, + { + "type": "string", + "enum": [ + "asia\/jakarta" + ], + "title": "asia\/jakarta" + }, + { + "type": "string", + "enum": [ + "asia\/jayapura" + ], + "title": "asia\/jayapura" + }, + { + "type": "string", + "enum": [ + "asia\/jerusalem" + ], + "title": "asia\/jerusalem" + }, + { + "type": "string", + "enum": [ + "asia\/kabul" + ], + "title": "asia\/kabul" + }, + { + "type": "string", + "enum": [ + "asia\/kamchatka" + ], + "title": "asia\/kamchatka" + }, + { + "type": "string", + "enum": [ + "asia\/karachi" + ], + "title": "asia\/karachi" + }, + { + "type": "string", + "enum": [ + "asia\/kathmandu" + ], + "title": "asia\/kathmandu" + }, + { + "type": "string", + "enum": [ + "asia\/khandyga" + ], + "title": "asia\/khandyga" + }, + { + "type": "string", + "enum": [ + "asia\/kolkata" + ], + "title": "asia\/kolkata" + }, + { + "type": "string", + "enum": [ + "asia\/krasnoyarsk" + ], + "title": "asia\/krasnoyarsk" + }, + { + "type": "string", + "enum": [ + "asia\/kuala_lumpur" + ], + "title": "asia\/kuala_lumpur" + }, + { + "type": "string", + "enum": [ + "asia\/kuching" + ], + "title": "asia\/kuching" + }, + { + "type": "string", + "enum": [ + "asia\/kuwait" + ], + "title": "asia\/kuwait" + }, + { + "type": "string", + "enum": [ + "asia\/macau" + ], + "title": "asia\/macau" + }, + { + "type": "string", + "enum": [ + "asia\/magadan" + ], + "title": "asia\/magadan" + }, + { + "type": "string", + "enum": [ + "asia\/makassar" + ], + "title": "asia\/makassar" + }, + { + "type": "string", + "enum": [ + "asia\/manila" + ], + "title": "asia\/manila" + }, + { + "type": "string", + "enum": [ + "asia\/muscat" + ], + "title": "asia\/muscat" + }, + { + "type": "string", + "enum": [ + "asia\/nicosia" + ], + "title": "asia\/nicosia" + }, + { + "type": "string", + "enum": [ + "asia\/novokuznetsk" + ], + "title": "asia\/novokuznetsk" + }, + { + "type": "string", + "enum": [ + "asia\/novosibirsk" + ], + "title": "asia\/novosibirsk" + }, + { + "type": "string", + "enum": [ + "asia\/omsk" + ], + "title": "asia\/omsk" + }, + { + "type": "string", + "enum": [ + "asia\/oral" + ], + "title": "asia\/oral" + }, + { + "type": "string", + "enum": [ + "asia\/phnom_penh" + ], + "title": "asia\/phnom_penh" + }, + { + "type": "string", + "enum": [ + "asia\/pontianak" + ], + "title": "asia\/pontianak" + }, + { + "type": "string", + "enum": [ + "asia\/pyongyang" + ], + "title": "asia\/pyongyang" + }, + { + "type": "string", + "enum": [ + "asia\/qatar" + ], + "title": "asia\/qatar" + }, + { + "type": "string", + "enum": [ + "asia\/qostanay" + ], + "title": "asia\/qostanay" + }, + { + "type": "string", + "enum": [ + "asia\/qyzylorda" + ], + "title": "asia\/qyzylorda" + }, + { + "type": "string", + "enum": [ + "asia\/riyadh" + ], + "title": "asia\/riyadh" + }, + { + "type": "string", + "enum": [ + "asia\/sakhalin" + ], + "title": "asia\/sakhalin" + }, + { + "type": "string", + "enum": [ + "asia\/samarkand" + ], + "title": "asia\/samarkand" + }, + { + "type": "string", + "enum": [ + "asia\/seoul" + ], + "title": "asia\/seoul" + }, + { + "type": "string", + "enum": [ + "asia\/shanghai" + ], + "title": "asia\/shanghai" + }, + { + "type": "string", + "enum": [ + "asia\/singapore" + ], + "title": "asia\/singapore" + }, + { + "type": "string", + "enum": [ + "asia\/srednekolymsk" + ], + "title": "asia\/srednekolymsk" + }, + { + "type": "string", + "enum": [ + "asia\/taipei" + ], + "title": "asia\/taipei" + }, + { + "type": "string", + "enum": [ + "asia\/tashkent" + ], + "title": "asia\/tashkent" + }, + { + "type": "string", + "enum": [ + "asia\/tbilisi" + ], + "title": "asia\/tbilisi" + }, + { + "type": "string", + "enum": [ + "asia\/tehran" + ], + "title": "asia\/tehran" + }, + { + "type": "string", + "enum": [ + "asia\/thimphu" + ], + "title": "asia\/thimphu" + }, + { + "type": "string", + "enum": [ + "asia\/tokyo" + ], + "title": "asia\/tokyo" + }, + { + "type": "string", + "enum": [ + "asia\/tomsk" + ], + "title": "asia\/tomsk" + }, + { + "type": "string", + "enum": [ + "asia\/ulaanbaatar" + ], + "title": "asia\/ulaanbaatar" + }, + { + "type": "string", + "enum": [ + "asia\/urumqi" + ], + "title": "asia\/urumqi" + }, + { + "type": "string", + "enum": [ + "asia\/ust-nera" + ], + "title": "asia\/ust-nera" + }, + { + "type": "string", + "enum": [ + "asia\/vientiane" + ], + "title": "asia\/vientiane" + }, + { + "type": "string", + "enum": [ + "asia\/vladivostok" + ], + "title": "asia\/vladivostok" + }, + { + "type": "string", + "enum": [ + "asia\/yakutsk" + ], + "title": "asia\/yakutsk" + }, + { + "type": "string", + "enum": [ + "asia\/yangon" + ], + "title": "asia\/yangon" + }, + { + "type": "string", + "enum": [ + "asia\/yekaterinburg" + ], + "title": "asia\/yekaterinburg" + }, + { + "type": "string", + "enum": [ + "asia\/yerevan" + ], + "title": "asia\/yerevan" + }, + { + "type": "string", + "enum": [ + "atlantic\/azores" + ], + "title": "atlantic\/azores" + }, + { + "type": "string", + "enum": [ + "atlantic\/bermuda" + ], + "title": "atlantic\/bermuda" + }, + { + "type": "string", + "enum": [ + "atlantic\/canary" + ], + "title": "atlantic\/canary" + }, + { + "type": "string", + "enum": [ + "atlantic\/cape_verde" + ], + "title": "atlantic\/cape_verde" + }, + { + "type": "string", + "enum": [ + "atlantic\/faroe" + ], + "title": "atlantic\/faroe" + }, + { + "type": "string", + "enum": [ + "atlantic\/madeira" + ], + "title": "atlantic\/madeira" + }, + { + "type": "string", + "enum": [ + "atlantic\/reykjavik" + ], + "title": "atlantic\/reykjavik" + }, + { + "type": "string", + "enum": [ + "atlantic\/south_georgia" + ], + "title": "atlantic\/south_georgia" + }, + { + "type": "string", + "enum": [ + "atlantic\/st_helena" + ], + "title": "atlantic\/st_helena" + }, + { + "type": "string", + "enum": [ + "atlantic\/stanley" + ], + "title": "atlantic\/stanley" + }, + { + "type": "string", + "enum": [ + "australia\/adelaide" + ], + "title": "australia\/adelaide" + }, + { + "type": "string", + "enum": [ + "australia\/brisbane" + ], + "title": "australia\/brisbane" + }, + { + "type": "string", + "enum": [ + "australia\/broken_hill" + ], + "title": "australia\/broken_hill" + }, + { + "type": "string", + "enum": [ + "australia\/darwin" + ], + "title": "australia\/darwin" + }, + { + "type": "string", + "enum": [ + "australia\/eucla" + ], + "title": "australia\/eucla" + }, + { + "type": "string", + "enum": [ + "australia\/hobart" + ], + "title": "australia\/hobart" + }, + { + "type": "string", + "enum": [ + "australia\/lindeman" + ], + "title": "australia\/lindeman" + }, + { + "type": "string", + "enum": [ + "australia\/lord_howe" + ], + "title": "australia\/lord_howe" + }, + { + "type": "string", + "enum": [ + "australia\/melbourne" + ], + "title": "australia\/melbourne" + }, + { + "type": "string", + "enum": [ + "australia\/perth" + ], + "title": "australia\/perth" + }, + { + "type": "string", + "enum": [ + "australia\/sydney" + ], + "title": "australia\/sydney" + }, + { + "type": "string", + "enum": [ + "europe\/amsterdam" + ], + "title": "europe\/amsterdam" + }, + { + "type": "string", + "enum": [ + "europe\/andorra" + ], + "title": "europe\/andorra" + }, + { + "type": "string", + "enum": [ + "europe\/astrakhan" + ], + "title": "europe\/astrakhan" + }, + { + "type": "string", + "enum": [ + "europe\/athens" + ], + "title": "europe\/athens" + }, + { + "type": "string", + "enum": [ + "europe\/belgrade" + ], + "title": "europe\/belgrade" + }, + { + "type": "string", + "enum": [ + "europe\/berlin" + ], + "title": "europe\/berlin" + }, + { + "type": "string", + "enum": [ + "europe\/bratislava" + ], + "title": "europe\/bratislava" + }, + { + "type": "string", + "enum": [ + "europe\/brussels" + ], + "title": "europe\/brussels" + }, + { + "type": "string", + "enum": [ + "europe\/bucharest" + ], + "title": "europe\/bucharest" + }, + { + "type": "string", + "enum": [ + "europe\/budapest" + ], + "title": "europe\/budapest" + }, + { + "type": "string", + "enum": [ + "europe\/busingen" + ], + "title": "europe\/busingen" + }, + { + "type": "string", + "enum": [ + "europe\/chisinau" + ], + "title": "europe\/chisinau" + }, + { + "type": "string", + "enum": [ + "europe\/copenhagen" + ], + "title": "europe\/copenhagen" + }, + { + "type": "string", + "enum": [ + "europe\/dublin" + ], + "title": "europe\/dublin" + }, + { + "type": "string", + "enum": [ + "europe\/gibraltar" + ], + "title": "europe\/gibraltar" + }, + { + "type": "string", + "enum": [ + "europe\/guernsey" + ], + "title": "europe\/guernsey" + }, + { + "type": "string", + "enum": [ + "europe\/helsinki" + ], + "title": "europe\/helsinki" + }, + { + "type": "string", + "enum": [ + "europe\/isle_of_man" + ], + "title": "europe\/isle_of_man" + }, + { + "type": "string", + "enum": [ + "europe\/istanbul" + ], + "title": "europe\/istanbul" + }, + { + "type": "string", + "enum": [ + "europe\/jersey" + ], + "title": "europe\/jersey" + }, + { + "type": "string", + "enum": [ + "europe\/kaliningrad" + ], + "title": "europe\/kaliningrad" + }, + { + "type": "string", + "enum": [ + "europe\/kirov" + ], + "title": "europe\/kirov" + }, + { + "type": "string", + "enum": [ + "europe\/kyiv" + ], + "title": "europe\/kyiv" + }, + { + "type": "string", + "enum": [ + "europe\/lisbon" + ], + "title": "europe\/lisbon" + }, + { + "type": "string", + "enum": [ + "europe\/ljubljana" + ], + "title": "europe\/ljubljana" + }, + { + "type": "string", + "enum": [ + "europe\/london" + ], + "title": "europe\/london" + }, + { + "type": "string", + "enum": [ + "europe\/luxembourg" + ], + "title": "europe\/luxembourg" + }, + { + "type": "string", + "enum": [ + "europe\/madrid" + ], + "title": "europe\/madrid" + }, + { + "type": "string", + "enum": [ + "europe\/malta" + ], + "title": "europe\/malta" + }, + { + "type": "string", + "enum": [ + "europe\/mariehamn" + ], + "title": "europe\/mariehamn" + }, + { + "type": "string", + "enum": [ + "europe\/minsk" + ], + "title": "europe\/minsk" + }, + { + "type": "string", + "enum": [ + "europe\/monaco" + ], + "title": "europe\/monaco" + }, + { + "type": "string", + "enum": [ + "europe\/moscow" + ], + "title": "europe\/moscow" + }, + { + "type": "string", + "enum": [ + "europe\/oslo" + ], + "title": "europe\/oslo" + }, + { + "type": "string", + "enum": [ + "europe\/paris" + ], + "title": "europe\/paris" + }, + { + "type": "string", + "enum": [ + "europe\/podgorica" + ], + "title": "europe\/podgorica" + }, + { + "type": "string", + "enum": [ + "europe\/prague" + ], + "title": "europe\/prague" + }, + { + "type": "string", + "enum": [ + "europe\/riga" + ], + "title": "europe\/riga" + }, + { + "type": "string", + "enum": [ + "europe\/rome" + ], + "title": "europe\/rome" + }, + { + "type": "string", + "enum": [ + "europe\/samara" + ], + "title": "europe\/samara" + }, + { + "type": "string", + "enum": [ + "europe\/san_marino" + ], + "title": "europe\/san_marino" + }, + { + "type": "string", + "enum": [ + "europe\/sarajevo" + ], + "title": "europe\/sarajevo" + }, + { + "type": "string", + "enum": [ + "europe\/saratov" + ], + "title": "europe\/saratov" + }, + { + "type": "string", + "enum": [ + "europe\/simferopol" + ], + "title": "europe\/simferopol" + }, + { + "type": "string", + "enum": [ + "europe\/skopje" + ], + "title": "europe\/skopje" + }, + { + "type": "string", + "enum": [ + "europe\/sofia" + ], + "title": "europe\/sofia" + }, + { + "type": "string", + "enum": [ + "europe\/stockholm" + ], + "title": "europe\/stockholm" + }, + { + "type": "string", + "enum": [ + "europe\/tallinn" + ], + "title": "europe\/tallinn" + }, + { + "type": "string", + "enum": [ + "europe\/tirane" + ], + "title": "europe\/tirane" + }, + { + "type": "string", + "enum": [ + "europe\/ulyanovsk" + ], + "title": "europe\/ulyanovsk" + }, + { + "type": "string", + "enum": [ + "europe\/vaduz" + ], + "title": "europe\/vaduz" + }, + { + "type": "string", + "enum": [ + "europe\/vatican" + ], + "title": "europe\/vatican" + }, + { + "type": "string", + "enum": [ + "europe\/vienna" + ], + "title": "europe\/vienna" + }, + { + "type": "string", + "enum": [ + "europe\/vilnius" + ], + "title": "europe\/vilnius" + }, + { + "type": "string", + "enum": [ + "europe\/volgograd" + ], + "title": "europe\/volgograd" + }, + { + "type": "string", + "enum": [ + "europe\/warsaw" + ], + "title": "europe\/warsaw" + }, + { + "type": "string", + "enum": [ + "europe\/zagreb" + ], + "title": "europe\/zagreb" + }, + { + "type": "string", + "enum": [ + "europe\/zurich" + ], + "title": "europe\/zurich" + }, + { + "type": "string", + "enum": [ + "indian\/antananarivo" + ], + "title": "indian\/antananarivo" + }, + { + "type": "string", + "enum": [ + "indian\/chagos" + ], + "title": "indian\/chagos" + }, + { + "type": "string", + "enum": [ + "indian\/christmas" + ], + "title": "indian\/christmas" + }, + { + "type": "string", + "enum": [ + "indian\/cocos" + ], + "title": "indian\/cocos" + }, + { + "type": "string", + "enum": [ + "indian\/comoro" + ], + "title": "indian\/comoro" + }, + { + "type": "string", + "enum": [ + "indian\/kerguelen" + ], + "title": "indian\/kerguelen" + }, + { + "type": "string", + "enum": [ + "indian\/mahe" + ], + "title": "indian\/mahe" + }, + { + "type": "string", + "enum": [ + "indian\/maldives" + ], + "title": "indian\/maldives" + }, + { + "type": "string", + "enum": [ + "indian\/mauritius" + ], + "title": "indian\/mauritius" + }, + { + "type": "string", + "enum": [ + "indian\/mayotte" + ], + "title": "indian\/mayotte" + }, + { + "type": "string", + "enum": [ + "indian\/reunion" + ], + "title": "indian\/reunion" + }, + { + "type": "string", + "enum": [ + "pacific\/apia" + ], + "title": "pacific\/apia" + }, + { + "type": "string", + "enum": [ + "pacific\/auckland" + ], + "title": "pacific\/auckland" + }, + { + "type": "string", + "enum": [ + "pacific\/bougainville" + ], + "title": "pacific\/bougainville" + }, + { + "type": "string", + "enum": [ + "pacific\/chatham" + ], + "title": "pacific\/chatham" + }, + { + "type": "string", + "enum": [ + "pacific\/chuuk" + ], + "title": "pacific\/chuuk" + }, + { + "type": "string", + "enum": [ + "pacific\/easter" + ], + "title": "pacific\/easter" + }, + { + "type": "string", + "enum": [ + "pacific\/efate" + ], + "title": "pacific\/efate" + }, + { + "type": "string", + "enum": [ + "pacific\/fakaofo" + ], + "title": "pacific\/fakaofo" + }, + { + "type": "string", + "enum": [ + "pacific\/fiji" + ], + "title": "pacific\/fiji" + }, + { + "type": "string", + "enum": [ + "pacific\/funafuti" + ], + "title": "pacific\/funafuti" + }, + { + "type": "string", + "enum": [ + "pacific\/galapagos" + ], + "title": "pacific\/galapagos" + }, + { + "type": "string", + "enum": [ + "pacific\/gambier" + ], + "title": "pacific\/gambier" + }, + { + "type": "string", + "enum": [ + "pacific\/guadalcanal" + ], + "title": "pacific\/guadalcanal" + }, + { + "type": "string", + "enum": [ + "pacific\/guam" + ], + "title": "pacific\/guam" + }, + { + "type": "string", + "enum": [ + "pacific\/honolulu" + ], + "title": "pacific\/honolulu" + }, + { + "type": "string", + "enum": [ + "pacific\/kanton" + ], + "title": "pacific\/kanton" + }, + { + "type": "string", + "enum": [ + "pacific\/kiritimati" + ], + "title": "pacific\/kiritimati" + }, + { + "type": "string", + "enum": [ + "pacific\/kosrae" + ], + "title": "pacific\/kosrae" + }, + { + "type": "string", + "enum": [ + "pacific\/kwajalein" + ], + "title": "pacific\/kwajalein" + }, + { + "type": "string", + "enum": [ + "pacific\/majuro" + ], + "title": "pacific\/majuro" + }, + { + "type": "string", + "enum": [ + "pacific\/marquesas" + ], + "title": "pacific\/marquesas" + }, + { + "type": "string", + "enum": [ + "pacific\/midway" + ], + "title": "pacific\/midway" + }, + { + "type": "string", + "enum": [ + "pacific\/nauru" + ], + "title": "pacific\/nauru" + }, + { + "type": "string", + "enum": [ + "pacific\/niue" + ], + "title": "pacific\/niue" + }, + { + "type": "string", + "enum": [ + "pacific\/norfolk" + ], + "title": "pacific\/norfolk" + }, + { + "type": "string", + "enum": [ + "pacific\/noumea" + ], + "title": "pacific\/noumea" + }, + { + "type": "string", + "enum": [ + "pacific\/pago_pago" + ], + "title": "pacific\/pago_pago" + }, + { + "type": "string", + "enum": [ + "pacific\/palau" + ], + "title": "pacific\/palau" + }, + { + "type": "string", + "enum": [ + "pacific\/pitcairn" + ], + "title": "pacific\/pitcairn" + }, + { + "type": "string", + "enum": [ + "pacific\/pohnpei" + ], + "title": "pacific\/pohnpei" + }, + { + "type": "string", + "enum": [ + "pacific\/port_moresby" + ], + "title": "pacific\/port_moresby" + }, + { + "type": "string", + "enum": [ + "pacific\/rarotonga" + ], + "title": "pacific\/rarotonga" + }, + { + "type": "string", + "enum": [ + "pacific\/saipan" + ], + "title": "pacific\/saipan" + }, + { + "type": "string", + "enum": [ + "pacific\/tahiti" + ], + "title": "pacific\/tahiti" + }, + { + "type": "string", + "enum": [ + "pacific\/tarawa" + ], + "title": "pacific\/tarawa" + }, + { + "type": "string", + "enum": [ + "pacific\/tongatapu" + ], + "title": "pacific\/tongatapu" + }, + { + "type": "string", + "enum": [ + "pacific\/wake" + ], + "title": "pacific\/wake" + }, + { + "type": "string", + "enum": [ + "pacific\/wallis" + ], + "title": "pacific\/wallis" + }, + { + "type": "string", + "enum": [ + "utc" + ], + "title": "utc" + } + ], + "default": "" + }, + "in": "query" + }, + { + "name": "latitude", + "description": "Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 37.7749, + "default": 0 + }, + "in": "query" + }, + { + "name": "longitude", + "description": "Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": -122.4194, + "default": 0 + }, + "in": "query" + }, + { + "name": "accuracy", + "description": "Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 100, + "default": 0 + }, + "in": "query" + }, + { + "name": "touch", + "description": "Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": true, + "default": false + }, + "in": "query" + }, + { + "name": "permissions", + "description": "Browser permissions to grant. Pass an array of permission names like [\"geolocation\", \"camera\", \"microphone\"]. Defaults to empty.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "BrowserPermission", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "geolocation" + ], + "title": "geolocation" + }, + { + "type": "string", + "enum": [ + "camera" + ], + "title": "camera" + }, + { + "type": "string", + "enum": [ + "microphone" + ], + "title": "microphone" + }, + { + "type": "string", + "enum": [ + "notifications" + ], + "title": "notifications" + }, + { + "type": "string", + "enum": [ + "midi" + ], + "title": "midi" + }, + { + "type": "string", + "enum": [ + "push" + ], + "title": "push" + }, + { + "type": "string", + "enum": [ + "clipboard-read" + ], + "title": "clipboard-read" + }, + { + "type": "string", + "enum": [ + "clipboard-write" + ], + "title": "clipboard-write" + }, + { + "type": "string", + "enum": [ + "payment-handler" + ], + "title": "payment-handler" + }, + { + "type": "string", + "enum": [ + "usb" + ], + "title": "usb" + }, + { + "type": "string", + "enum": [ + "bluetooth" + ], + "title": "bluetooth" + }, + { + "type": "string", + "enum": [ + "accelerometer" + ], + "title": "accelerometer" + }, + { + "type": "string", + "enum": [ + "gyroscope" + ], + "title": "gyroscope" + }, + { + "type": "string", + "enum": [ + "magnetometer" + ], + "title": "magnetometer" + }, + { + "type": "string", + "enum": [ + "ambient-light-sensor" + ], + "title": "ambient-light-sensor" + }, + { + "type": "string", + "enum": [ + "background-sync" + ], + "title": "background-sync" + }, + { + "type": "string", + "enum": [ + "persistent-storage" + ], + "title": "persistent-storage" + }, + { + "type": "string", + "enum": [ + "screen-wake-lock" + ], + "title": "screen-wake-lock" + }, + { + "type": "string", + "enum": [ + "web-share" + ], + "title": "web-share" + }, + { + "type": "string", + "enum": [ + "xr-spatial-tracking" + ], + "title": "xr-spatial-tracking" + } + ] + }, + "example": [ + "geolocation", + "notifications" + ], + "default": [] + }, + "in": "query" + }, + { + "name": "sleep", + "description": "Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 3, + "default": 0 + }, + "in": "query" + }, + { + "name": "width", + "description": "Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 800, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 600, + "default": 0 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 85, + "default": -1 + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "example": "jpeg", + "title": "ImageFormat", + "oneOf": [ + { + "type": "string", + "enum": [ + "jpg" + ], + "title": "jpg" + }, + { + "type": "string", + "enum": [ + "jpeg" + ], + "title": "jpeg" + }, + { + "type": "string", + "enum": [ + "png" + ], + "title": "png" + }, + { + "type": "string", + "enum": [ + "webp" + ], + "title": "webp" + }, + { + "type": "string", + "enum": [ + "heic" + ], + "title": "heic" + }, + { + "type": "string", + "enum": [ + "avif" + ], + "title": "avif" + }, + { + "type": "string", + "enum": [ + "gif" + ], + "title": "gif" + } + ], + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/databases\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "databasesListTransactions", + "tags": [ + "databases" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTransactions" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "databasesCreateTransaction", + "tags": [ + "databases" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTransaction" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/databases\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "databasesGetTransaction", + "tags": [ + "databases" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTransaction" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "databasesUpdateTransaction", + "tags": [ + "databases" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTransaction" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "databasesDeleteTransaction", + "tags": [ + "databases" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTransaction" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "databasesCreateOperations", + "tags": [ + "databases" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createOperations" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-appwrite": { + "idGenerator": "ID.unique" + }, + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/documentsdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "documentsDBListTransactions", + "tags": [ + "documentsDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "documentsDBCreateTransaction", + "tags": [ + "documentsDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/documentsdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "documentsDBGetTransaction", + "tags": [ + "documentsDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "documentsDBUpdateTransaction", + "tags": [ + "documentsDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "documentsDBDeleteTransaction", + "tags": [ + "documentsDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "documentsDBCreateOperations", + "tags": [ + "documentsDB" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "documentsDBListDocuments", + "tags": [ + "documentsDB" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "documentsDBCreateDocument", + "tags": [ + "documentsDB" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createDocument", + "namespace": "documentsDB", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/create-document.md", + "public": true + }, + { + "name": "createDocuments", + "namespace": "documentsDB", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/create-documents.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "documentsDBGetDocument", + "tags": [ + "documentsDB" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "documentsDBUpsertDocument", + "tags": [ + "documentsDB" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocument", + "namespace": "documentsDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/upsert-document.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required fields of the document to be created or updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "documentsDBUpdateDocument", + "tags": [ + "documentsDB" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only fields and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "documentsDBDeleteDocument", + "tags": [ + "documentsDB" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "documentsDBDecrementDocumentAttribute", + "tags": [ + "documentsDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to decrement the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float" + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "documentsDBIncrementDocumentAttribute", + "tags": [ + "documentsDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float" + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/list-executions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.read", + "execution.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/create-execution.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.write", + "execution.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "description": "HTTP body of execution. Default value is empty string.", + "type": "string", + "default": "", + "example": "<BODY>" + }, + "async": { + "description": "Execute code in the background. Default value is false.", + "type": "boolean", + "default": false, + "example": false + }, + "path": { + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "type": "string", + "default": "\/", + "example": "<PATH>" + }, + "method": { + "description": "HTTP method of execution. Default value is POST.", + "type": "string", + "default": "POST", + "example": "GET", + "title": "ExecutionMethod", + "oneOf": [ + { + "type": "string", + "enum": [ + "GET" + ], + "title": "GET" + }, + { + "type": "string", + "enum": [ + "POST" + ], + "title": "POST" + }, + { + "type": "string", + "enum": [ + "PUT" + ], + "title": "PUT" + }, + { + "type": "string", + "enum": [ + "PATCH" + ], + "title": "PATCH" + }, + { + "type": "string", + "enum": [ + "DELETE" + ], + "title": "DELETE" + }, + { + "type": "string", + "enum": [ + "OPTIONS" + ], + "title": "OPTIONS" + }, + { + "type": "string", + "enum": [ + "HEAD" + ], + "title": "HEAD" + } + ] + }, + "headers": { + "description": "HTTP headers of execution. Defaults to empty.", + "type": "object", + "default": [], + "example": {} + }, + "scheduledAt": { + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "type": "string", + "example": "<SCHEDULED_AT>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/get-execution.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.read", + "execution.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "graphql", + "demo": "graphql\/query.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "description": "The query or queries to execute.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "query" + ] + } + } + } + } + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "graphql", + "demo": "graphql\/mutation.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "description": "The query or queries to execute.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "query" + ] + } + } + } + } + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "type": "string", + "example": "<SUBSCRIBER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "targetId": { + "description": "Target ID. The target ID to link to the specified Topic ID.", + "type": "string", + "example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/ping": { + "get": { + "summary": "Test the connection between the Appwrite and the SDK.", + "operationId": "pingGet", + "tags": [ + "ping" + ], + "description": "Send a ping to project as part of onboarding.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "ping\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "global", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ] + } + }, + "\/presences": { + "get": { + "summary": "List presences", + "operationId": "presencesList", + "tags": [ + "presences" + ], + "description": "List presence logs. Expired entries are filtered out automatically.\n", + "responses": { + "200": { + "description": "Presences List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presenceList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/presences\/{presenceId}": { + "get": { + "summary": "Get presence", + "operationId": "presencesGet", + "tags": [ + "presences" + ], + "description": "Get a presence log by its unique ID. Entries whose `expiresAt` is in the past are treated as not found.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Upsert presence", + "operationId": "presencesUpsert", + "tags": [ + "presences" + ], + "description": "Create or update a presence log by its user ID.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/upsert.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "client", + "console" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsert", + "namespace": "presences", + "desc": "Upsert presence", + "auth": { + "Project": [] + }, + "parameters": [ + "presenceId", + "status", + "permissions", + "expiresAt", + "metadata" + ], + "required": [ + "presenceId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/presence" + } + ], + "description": "Create or update a presence log by its user ID.\n", + "demo": "presences\/upsert.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "status": { + "description": "Presence status.", + "type": "string", + "example": "<STATUS>" + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "expiresAt": { + "description": "Presence expiry datetime.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime" + }, + "metadata": { + "description": "Presence metadata object.", + "type": "object", + "default": [], + "example": {} + } + }, + "required": [ + "status" + ] + } + } + } + } + }, + "patch": { + "summary": "Update presence", + "operationId": "presencesUpdate", + "tags": [ + "presences" + ], + "description": "Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "client", + "console" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "update", + "namespace": "presences", + "desc": "Update presence", + "auth": { + "Project": [] + }, + "parameters": [ + "presenceId", + "status", + "expiresAt", + "metadata", + "permissions", + "purge" + ], + "required": [ + "presenceId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/presence" + } + ], + "description": "Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated.\n", + "demo": "presences\/update.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "status": { + "description": "Presence status.", + "type": "string", + "example": "<STATUS>" + }, + "expiresAt": { + "description": "Presence expiry datetime.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime" + }, + "metadata": { + "description": "Presence metadata object.", + "type": "object", + "default": {}, + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "purge": { + "description": "When true, purge cached responses used by list presences endpoint.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete presence", + "operationId": "presencesDelete", + "tags": [ + "presences" + ], + "description": "Delete a presence log by its unique ID.\n", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<FILE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "file": { + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "type": "string", + "format": "binary" + }, + "permissions": { + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "folder": { + "description": "Virtual folder to place the file in, for example \"photos\/2026\". Nest folders with `\/`. Defaults to the bucket root.", + "type": "string", + "default": "", + "example": "photos\/2026" + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/update-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "File name.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "example": "center", + "title": "ImageGravity", + "oneOf": [ + { + "type": "string", + "enum": [ + "center" + ], + "title": "center" + }, + { + "type": "string", + "enum": [ + "top-left" + ], + "title": "top-left" + }, + { + "type": "string", + "enum": [ + "top" + ], + "title": "top" + }, + { + "type": "string", + "enum": [ + "top-right" + ], + "title": "top-right" + }, + { + "type": "string", + "enum": [ + "left" + ], + "title": "left" + }, + { + "type": "string", + "enum": [ + "right" + ], + "title": "right" + }, + { + "type": "string", + "enum": [ + "bottom-left" + ], + "title": "bottom-left" + }, + { + "type": "string", + "enum": [ + "bottom" + ], + "title": "bottom" + }, + { + "type": "string", + "enum": [ + "bottom-right" + ], + "title": "bottom-right" + } + ], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -360, + "default": 0 + }, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "example": "jpg", + "title": "ImageFormat", + "oneOf": [ + { + "type": "string", + "enum": [ + "jpg" + ], + "title": "jpg" + }, + { + "type": "string", + "enum": [ + "jpeg" + ], + "title": "jpeg" + }, + { + "type": "string", + "enum": [ + "png" + ], + "title": "png" + }, + { + "type": "string", + "enum": [ + "webp" + ], + "title": "webp" + }, + { + "type": "string", + "enum": [ + "heic" + ], + "title": "heic" + }, + { + "type": "string", + "enum": [ + "avif" + ], + "title": "avif" + }, + { + "type": "string", + "enum": [ + "gif" + ], + "title": "gif" + } + ], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "tablesDBListTransactions", + "tags": [ + "tablesDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.read", + "rows.read" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "tablesDBCreateTransaction", + "tags": [ + "tablesDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/tablesdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "tablesDBGetTransaction", + "tags": [ + "tablesDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.read", + "rows.read" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "tablesDBUpdateTransaction", + "tags": [ + "tablesDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "tablesDBDeleteTransaction", + "tags": [ + "tablesDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "tablesDBCreateOperations", + "tags": [ + "tablesDB" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/products\/databases\/tables#create-table).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<ROW_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Row data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "rows": { + "description": "Array of rows data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "rowId", + "data" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string", + "example": "<COLUMN>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the column by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string", + "example": "<COLUMN>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the column by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TEAM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Team name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "roles": { + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "type": "array", + "default": [ + "owner" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "New team name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/list-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/create-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "Email of the new team member.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "userId": { + "description": "ID of the user to be added to a team.", + "type": "string", + "default": "", + "example": "<USER_ID>" + }, + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "roles": { + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 81 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project 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.", + "type": "string", + "default": "", + "example": "https:\/\/example.com", + "format": "url" + }, + "name": { + "description": "Name of the new team member. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/get-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update team membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/update-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 81 characters long.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/delete-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/update-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Secret key.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update team preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "description": "Prefs key-value JSON object.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/vectorsdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "vectorsDBListTransactions", + "tags": [ + "vectorsDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "vectorsDBCreateTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/vectorsdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "vectorsDBGetTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "vectorsDBUpdateTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "vectorsDBDeleteTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vectorsdb\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "vectorsDBCreateOperations", + "tags": [ + "vectorsDB" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "vectorsDBListDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 524288 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "vectorsDBCreateDocument", + "tags": [ + "vectorsDB" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createDocument", + "namespace": "vectorsDB", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "vectorsdb\/create-document.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents\/query": { + "post": { + "summary": "Create query", + "operationId": "vectorsDBCreateQuery", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/create-query.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 524288 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID to read uncommitted changes within the transaction.", + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "total": { + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "type": "boolean", + "default": true, + "example": false + }, + "ttl": { + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "vectorsDBGetDocument", + "tags": [ + "vectorsDB" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "vectorsDBUpsertDocument", + "tags": [ + "vectorsDB" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocument", + "namespace": "vectorsDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "vectorsdb\/upsert-document.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-appwrite": { + "idGenerator": "ID.unique" + }, + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required fields of the document to be created or updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "vectorsDBUpdateDocument", + "tags": [ + "vectorsDB" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only fields and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "vectorsDBDeleteDocument", + "tags": [ + "vectorsDB" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + } + }, + "tags": [ + { + "name": "ping", + "description": "" + }, + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesDB", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "documentsDB", + "description": "" + }, + { + "name": "vectorsDB", + "description": "" + }, + { + "name": "presences", + "description": "The Presences service allows you to track and manage real-time user presence in your project." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant information." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": {} + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "format": "int32", + "example": 5 + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "example": [] + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "format": "int32", + "example": 5 + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "example": [] + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "presenceList": { + "description": "Presences List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of presences that matched your query.", + "format": "int32", + "example": 5 + }, + "presences": { + "type": "array", + "description": "List of presences.", + "items": { + "$ref": "#\/components\/schemas\/presence" + }, + "example": [] + } + }, + "required": [ + "total", + "presences" + ], + "example": { + "total": 5, + "presences": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "format": "int32", + "example": 5 + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "example": [] + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "format": "int32", + "example": 5 + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "example": [] + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "format": "int32", + "example": 5 + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "example": [] + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "format": "int32", + "example": 5 + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "example": [] + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "format": "int32", + "example": 5 + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "example": [] + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "format": "int32", + "example": 5 + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "example": [] + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "format": "int32", + "example": 5 + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "example": [] + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "format": "int32", + "example": 5 + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "example": [] + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "format": "int32", + "example": 5 + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "example": [] + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "format": "int32", + "example": 5 + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "example": [] + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "format": "int32", + "example": 5 + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "example": [] + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "format": "int32", + "example": 5 + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "example": [] + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "transactionList": { + "description": "Transaction List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of transactions that matched your query.", + "format": "int32", + "example": 5 + }, + "transactions": { + "type": "array", + "description": "List of transactions.", + "items": { + "$ref": "#\/components\/schemas\/transaction" + }, + "example": [] + } + }, + "required": [ + "total", + "transactions" + ], + "example": { + "total": 5, + "transactions": "" + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "string", + "description": "Row sequence ID.", + "readOnly": true, + "example": "1" + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": "1", + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "string", + "description": "Document sequence ID.", + "readOnly": true, + "example": "1" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": "1", + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "presence": { + "description": "Presence", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Presence ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Presence creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Presence update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Presence permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "674af8f3e12a5f9ac0be" + }, + "status": { + "type": "string", + "description": "Presence status.", + "example": "online", + "nullable": true + }, + "source": { + "type": "string", + "description": "Presence source.", + "example": "HTTP" + }, + "expiresAt": { + "type": "string", + "description": "Presence expiry date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": true, + "description": "Presence metadata.", + "example": { + "key": "value" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "userId", + "source" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "userId": "674af8f3e12a5f9ac0be", + "status": "online", + "source": "HTTP", + "expiresAt": "2020-10-15T06:38:00.000+00:00", + "metadata": { + "key": "value" + } + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "example": {}, + "allOf": [ + { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "argon2": "#\/components\/schemas\/algoArgon2", + "scrypt": "#\/components\/schemas\/algoScrypt", + "scryptMod": "#\/components\/schemas\/algoScryptModified", + "bcrypt": "#\/components\/schemas\/algoBcrypt", + "phpass": "#\/components\/schemas\/algoPhpass", + "sha": "#\/components\/schemas\/algoSha", + "md5": "#\/components\/schemas\/algoMd5" + } + } + } + ], + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "example": true + }, + "emailCanonical": { + "type": "string", + "description": "Canonical form of the user email address.", + "example": "john@appwrite.io", + "nullable": true + }, + "emailIsFree": { + "type": "boolean", + "description": "Whether the user email is from a free email provider.", + "example": true, + "nullable": true + }, + "emailIsDisposable": { + "type": "boolean", + "description": "Whether the user email is from a disposable email provider.", + "example": false, + "nullable": true + }, + "emailIsCorporate": { + "type": "boolean", + "description": "Whether the user email is from a corporate domain.", + "example": true, + "nullable": true + }, + "emailIsCanonical": { + "type": "boolean", + "description": "Whether the user email is in its canonical form.", + "example": true, + "nullable": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "example": { + "theme": "pink", + "timezone": "UTC" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/preferences" + } + ] + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "impersonator": { + "type": "boolean", + "description": "Whether the user can impersonate other users.", + "example": false, + "nullable": true + }, + "impersonatorUserId": { + "type": "string", + "description": "ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data.", + "example": "5e5ea5c16897e", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "emailCanonical": "john@appwrite.io", + "emailIsFree": true, + "emailIsDisposable": false, + "emailIsCorporate": true, + "emailIsCanonical": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "impersonator": false, + "impersonatorUserId": "5e5ea5c16897e" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "format": "int32", + "example": 8 + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "format": "int32", + "example": 14 + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "format": "int32", + "example": 1 + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "format": "int32", + "example": 64 + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "format": "int32", + "example": 65536 + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "format": "int32", + "example": 4 + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "format": "int32", + "example": 3 + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "example": "Pink.png" + }, + "folder": { + "type": "string", + "description": "Virtual folder containing the file, with a trailing slash. Empty for the bucket root.", + "example": "photos\/2026\/" + }, + "key": { + "type": "string", + "description": "Full virtual path of the file: the folder followed by the file name.", + "example": "photos\/2026\/Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "format": "int32", + "example": 17890 + }, + "sizeActual": { + "type": "integer", + "description": "File actual stored size in bytes after compression and\/or encryption.", + "format": "int32", + "example": 12345 + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "format": "int32", + "example": 17890 + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "format": "int32", + "example": 17890 + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "example": "gzip" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "folder", + "key", + "signature", + "mimeType", + "sizeOriginal", + "sizeActual", + "chunksTotal", + "chunksUploaded", + "encryption", + "compression" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "folder": "photos\/2026\/", + "key": "photos\/2026\/Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "sizeActual": 12345, + "chunksTotal": 17890, + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "format": "int32", + "example": 7 + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "example": { + "theme": "pink", + "timezone": "UTC" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/preferences" + } + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "example": "john@appwrite.io" + }, + "userPhone": { + "type": "string", + "description": "User phone number. Hide this attribute by toggling membership privacy in the Console.", + "example": "+1 555 555 5555" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "example": false + }, + "userAccessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "userPhone", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "userAccessedAt", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "userPhone": "+1 555 555 5555", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "userAccessedAt": "2020-10-15T06:38:00.000+00:00", + "roles": [ + "owner" + ] + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "example": [ + "any" + ] + }, + "resourceId": { + "type": "string", + "description": "Function or site ID.", + "example": "5e5ea6g16897e" + }, + "resourceType": { + "description": "Execution resource type.", + "example": "functions", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "functions" + ], + "title": "functions" + }, + { + "type": "string", + "enum": [ + "sites" + ], + "title": "sites" + } + ] + }, + "deploymentId": { + "type": "string", + "description": "Deployment ID used to create the execution.", + "example": "5e5ea5c16897e" + }, + "trigger": { + "description": "The trigger that caused the resource to execute. Possible values can be: `http`, `schedule`, or `event`.", + "example": "http", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "http" + ], + "title": "http" + }, + { + "type": "string", + "enum": [ + "schedule" + ], + "title": "schedule" + }, + { + "type": "string", + "enum": [ + "event" + ], + "title": "event" + } + ] + }, + "status": { + "description": "The status of the resource execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`.", + "example": "processing", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "waiting" + ], + "title": "waiting" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "completed" + ], + "title": "completed" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + }, + { + "type": "string", + "enum": [ + "scheduled" + ], + "title": "scheduled" + } + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "format": "int32", + "example": 200 + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Resource logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "errors": { + "type": "string", + "description": "Resource errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "format": "double", + "example": 0.4 + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "resourceId", + "resourceType", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "format": "int32", + "example": 2 + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "format": "double", + "example": 0 + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "example": "[SHARED_SECRET]" + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "example": "otpauth:\/\/totp\/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite" + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": "[SHARED_SECRET]", + "uri": "otpauth:\/\/totp\/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite" + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "example": true + }, + "custom": { + "type": "boolean", + "description": "Can custom factor be used for MFA challenge for this account.", + "example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode", + "custom" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true, + "custom": true + } + }, + "transaction": { + "description": "Transaction", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Transaction ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Transaction creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Transaction update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Current status of the transaction. One of: pending, committing, committed, rolled_back, failed.", + "example": "pending" + }, + "operations": { + "type": "integer", + "description": "Number of operations in the transaction.", + "format": "int32", + "example": 5 + }, + "expiresAt": { + "type": "string", + "description": "Expiration time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "operations", + "expiresAt" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "operations": 5, + "expiresAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/target" + } + ] + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "ProjectPath": { + "type": "apiKey", + "name": "project", + "description": "Your project ID", + "in": "query", + "x-appwrite": { + "location": "path", + "param": "project_id", + "demo": "<YOUR_PROJECT_ID>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "The OAuth access token to authenticate with" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "DevKey": { + "type": "apiKey", + "name": "X-Appwrite-Dev-Key", + "description": "Your secret dev API key", + "in": "header" + }, + "Cookie": { + "type": "apiKey", + "name": "Cookie", + "description": "The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes.", + "in": "header" + }, + "ImpersonateUserId": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Id", + "description": "Impersonate a user by ID", + "in": "header", + "x-appwrite": { + "optional": true + } + }, + "ImpersonateUserEmail": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Email", + "description": "Impersonate a user by email", + "in": "header", + "x-appwrite": { + "optional": true + } + }, + "ImpersonateUserPhone": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Phone", + "description": "Impersonate a user by phone", + "in": "header", + "x-appwrite": { + "optional": true + } + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/specs/2.0.x/open-api3-2.0.x-console.json b/specs/2.0.x/open-api3-2.0.x-console.json new file mode 100644 index 000000000..416271a2a --- /dev/null +++ b/specs/2.0.x/open-api3-2.0.x-console.json @@ -0,0 +1,95661 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "2.0.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1", + "description": "Appwrite Cloud endpoint." + }, + { + "url": "https:\/\/{region}.cloud.appwrite.io\/v1", + "description": "Appwrite Cloud regional endpoint. Replace `{region}` with your project region.", + "variables": { + "region": { + "default": "fra", + "description": "Appwrite Cloud region." + } + } + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "New user password. Must be between 8 and 256 chars.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete account", + "operationId": "accountDelete", + "tags": [ + "account" + ], + "description": "Delete the currently logged in user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "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.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-jwt.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "duration": { + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "type": "integer", + "default": 900, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "description": "Enable or disable MFA.", + "type": "boolean", + "example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "description": "Valid verification token.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenges": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.", + "type": "string", + "example": "email", + "title": "AuthenticationFactor", + "oneOf": [ + { + "type": "string", + "enum": [ + "email" + ], + "title": "email" + }, + { + "type": "string", + "enum": [ + "phone" + ], + "title": "phone" + }, + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + }, + { + "type": "string", + "enum": [ + "recoverycode" + ], + "title": "recoverycode" + }, + { + "type": "string", + "enum": [ + "custom" + ], + "title": "custom" + } + ] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "description": "ID of the challenge.", + "type": "string", + "example": "<CHALLENGE_ID>" + }, + "otp": { + "description": "Valid verification token.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "description": "New user password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + }, + "oldPassword": { + "description": "Current user password. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "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.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "example": "+12065550100", + "format": "phone" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "description": "Prefs key-value JSON object.", + "type": "object", + "default": {}, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "url": { + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project 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.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid reset token.", + "type": "string", + "example": "<SECRET>" + }, + "password": { + "description": "New user password. Must be between 8 and 256 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-anonymous-session.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-email-password-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-magic-url-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "No content", + "content": { + "text\/html": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-o-auth-2-session.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "example": "amazon", + "title": "OAuthProvider", + "oneOf": [ + { + "type": "string", + "enum": [ + "amazon" + ], + "title": "amazon" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "appwrite" + ], + "title": "appwrite" + }, + { + "type": "string", + "enum": [ + "auth0" + ], + "title": "auth0" + }, + { + "type": "string", + "enum": [ + "authentik" + ], + "title": "authentik" + }, + { + "type": "string", + "enum": [ + "autodesk" + ], + "title": "autodesk" + }, + { + "type": "string", + "enum": [ + "bitbucket" + ], + "title": "bitbucket" + }, + { + "type": "string", + "enum": [ + "bitly" + ], + "title": "bitly" + }, + { + "type": "string", + "enum": [ + "box" + ], + "title": "box" + }, + { + "type": "string", + "enum": [ + "cloudflare" + ], + "title": "cloudflare" + }, + { + "type": "string", + "enum": [ + "dailymotion" + ], + "title": "dailymotion" + }, + { + "type": "string", + "enum": [ + "discord" + ], + "title": "discord" + }, + { + "type": "string", + "enum": [ + "disqus" + ], + "title": "disqus" + }, + { + "type": "string", + "enum": [ + "dropbox" + ], + "title": "dropbox" + }, + { + "type": "string", + "enum": [ + "etsy" + ], + "title": "etsy" + }, + { + "type": "string", + "enum": [ + "facebook" + ], + "title": "facebook" + }, + { + "type": "string", + "enum": [ + "figma" + ], + "title": "figma" + }, + { + "type": "string", + "enum": [ + "fusionauth" + ], + "title": "fusionauth" + }, + { + "type": "string", + "enum": [ + "github" + ], + "title": "github" + }, + { + "type": "string", + "enum": [ + "gitlab" + ], + "title": "gitlab" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + }, + { + "type": "string", + "enum": [ + "huggingface" + ], + "title": "huggingface" + }, + { + "type": "string", + "enum": [ + "keycloak" + ], + "title": "keycloak" + }, + { + "type": "string", + "enum": [ + "kick" + ], + "title": "kick" + }, + { + "type": "string", + "enum": [ + "linkedin" + ], + "title": "linkedin" + }, + { + "type": "string", + "enum": [ + "microsoft" + ], + "title": "microsoft" + }, + { + "type": "string", + "enum": [ + "notion" + ], + "title": "notion" + }, + { + "type": "string", + "enum": [ + "oidc" + ], + "title": "oidc" + }, + { + "type": "string", + "enum": [ + "okta" + ], + "title": "okta" + }, + { + "type": "string", + "enum": [ + "paypal" + ], + "title": "paypal" + }, + { + "type": "string", + "enum": [ + "paypalSandbox" + ], + "title": "paypalSandbox" + }, + { + "type": "string", + "enum": [ + "podio" + ], + "title": "podio" + }, + { + "type": "string", + "enum": [ + "resend" + ], + "title": "resend" + }, + { + "type": "string", + "enum": [ + "salesforce" + ], + "title": "salesforce" + }, + { + "type": "string", + "enum": [ + "slack" + ], + "title": "slack" + }, + { + "type": "string", + "enum": [ + "spotify" + ], + "title": "spotify" + }, + { + "type": "string", + "enum": [ + "stripe" + ], + "title": "stripe" + }, + { + "type": "string", + "enum": [ + "tradeshift" + ], + "title": "tradeshift" + }, + { + "type": "string", + "enum": [ + "tradeshiftBox" + ], + "title": "tradeshiftBox" + }, + { + "type": "string", + "enum": [ + "twitch" + ], + "title": "twitch" + }, + { + "type": "string", + "enum": [ + "wordpress" + ], + "title": "wordpress" + }, + { + "type": "string", + "enum": [ + "x" + ], + "title": "x" + }, + { + "type": "string", + "enum": [ + "yahoo" + ], + "title": "yahoo" + }, + { + "type": "string", + "enum": [ + "yammer" + ], + "title": "yammer" + }, + { + "type": "string", + "enum": [ + "yandex" + ], + "title": "yandex" + }, + { + "type": "string", + "enum": [ + "zoho" + ], + "title": "zoho" + }, + { + "type": "string", + "enum": [ + "zoom" + ], + "title": "zoom" + } + ] + }, + "in": "path" + }, + { + "name": "success", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "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.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-phone-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "pushTargets", + "demo": "account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TARGET_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "identifier": { + "description": "The target identifier (token, email, phone etc.)", + "type": "string", + "example": "<IDENTIFIER>" + }, + "providerId": { + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "type": "string", + "default": "", + "example": "<PROVIDER_ID>" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + } + } + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "pushTargets", + "demo": "account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "description": "The target identifier (token, email, phone etc.)", + "type": "string", + "example": "<IDENTIFIER>" + } + }, + "required": [ + "identifier" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "pushTargets", + "demo": "account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-email-token.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-magic-url-token.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "url": { + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project 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.", + "type": "string", + "default": "", + "example": "https:\/\/example.com", + "format": "url" + }, + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content", + "content": { + "text\/html": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-o-auth-2-token.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "example": "amazon", + "title": "OAuthProvider", + "oneOf": [ + { + "type": "string", + "enum": [ + "amazon" + ], + "title": "amazon" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "appwrite" + ], + "title": "appwrite" + }, + { + "type": "string", + "enum": [ + "auth0" + ], + "title": "auth0" + }, + { + "type": "string", + "enum": [ + "authentik" + ], + "title": "authentik" + }, + { + "type": "string", + "enum": [ + "autodesk" + ], + "title": "autodesk" + }, + { + "type": "string", + "enum": [ + "bitbucket" + ], + "title": "bitbucket" + }, + { + "type": "string", + "enum": [ + "bitly" + ], + "title": "bitly" + }, + { + "type": "string", + "enum": [ + "box" + ], + "title": "box" + }, + { + "type": "string", + "enum": [ + "cloudflare" + ], + "title": "cloudflare" + }, + { + "type": "string", + "enum": [ + "dailymotion" + ], + "title": "dailymotion" + }, + { + "type": "string", + "enum": [ + "discord" + ], + "title": "discord" + }, + { + "type": "string", + "enum": [ + "disqus" + ], + "title": "disqus" + }, + { + "type": "string", + "enum": [ + "dropbox" + ], + "title": "dropbox" + }, + { + "type": "string", + "enum": [ + "etsy" + ], + "title": "etsy" + }, + { + "type": "string", + "enum": [ + "facebook" + ], + "title": "facebook" + }, + { + "type": "string", + "enum": [ + "figma" + ], + "title": "figma" + }, + { + "type": "string", + "enum": [ + "fusionauth" + ], + "title": "fusionauth" + }, + { + "type": "string", + "enum": [ + "github" + ], + "title": "github" + }, + { + "type": "string", + "enum": [ + "gitlab" + ], + "title": "gitlab" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + }, + { + "type": "string", + "enum": [ + "huggingface" + ], + "title": "huggingface" + }, + { + "type": "string", + "enum": [ + "keycloak" + ], + "title": "keycloak" + }, + { + "type": "string", + "enum": [ + "kick" + ], + "title": "kick" + }, + { + "type": "string", + "enum": [ + "linkedin" + ], + "title": "linkedin" + }, + { + "type": "string", + "enum": [ + "microsoft" + ], + "title": "microsoft" + }, + { + "type": "string", + "enum": [ + "notion" + ], + "title": "notion" + }, + { + "type": "string", + "enum": [ + "oidc" + ], + "title": "oidc" + }, + { + "type": "string", + "enum": [ + "okta" + ], + "title": "okta" + }, + { + "type": "string", + "enum": [ + "paypal" + ], + "title": "paypal" + }, + { + "type": "string", + "enum": [ + "paypalSandbox" + ], + "title": "paypalSandbox" + }, + { + "type": "string", + "enum": [ + "podio" + ], + "title": "podio" + }, + { + "type": "string", + "enum": [ + "resend" + ], + "title": "resend" + }, + { + "type": "string", + "enum": [ + "salesforce" + ], + "title": "salesforce" + }, + { + "type": "string", + "enum": [ + "slack" + ], + "title": "slack" + }, + { + "type": "string", + "enum": [ + "spotify" + ], + "title": "spotify" + }, + { + "type": "string", + "enum": [ + "stripe" + ], + "title": "stripe" + }, + { + "type": "string", + "enum": [ + "tradeshift" + ], + "title": "tradeshift" + }, + { + "type": "string", + "enum": [ + "tradeshiftBox" + ], + "title": "tradeshiftBox" + }, + { + "type": "string", + "enum": [ + "twitch" + ], + "title": "twitch" + }, + { + "type": "string", + "enum": [ + "wordpress" + ], + "title": "wordpress" + }, + { + "type": "string", + "enum": [ + "x" + ], + "title": "x" + }, + { + "type": "string", + "enum": [ + "yahoo" + ], + "title": "yahoo" + }, + { + "type": "string", + "enum": [ + "yammer" + ], + "title": "yammer" + }, + { + "type": "string", + "enum": [ + "yandex" + ], + "title": "yandex" + }, + { + "type": "string", + "enum": [ + "zoho" + ], + "title": "zoho" + }, + { + "type": "string", + "enum": [ + "zoom" + ], + "title": "zoom" + } + ] + }, + "in": "path" + }, + { + "name": "success", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "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.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-phone-token.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "example": "+12065550100", + "format": "phone" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verifications\/email": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateEmailVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createEmailVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "url" + ], + "required": [ + "url" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "demo": "account\/create-email-verification.md", + "public": true + }, + { + "name": "createVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "url" + ], + "required": [ + "url" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "demo": "account\/create-verification.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createEmailVerification" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateEmailVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "updateEmailVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "secret" + ], + "required": [ + "userId", + "secret" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "demo": "account\/update-email-verification.md", + "public": true + }, + { + "name": "updateVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "secret" + ], + "required": [ + "userId", + "secret" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "demo": "account\/update-verification.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateEmailVerification" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verifications\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "example": "aa", + "title": "Browser", + "oneOf": [ + { + "type": "string", + "enum": [ + "aa" + ], + "title": "Avant Browser" + }, + { + "type": "string", + "enum": [ + "an" + ], + "title": "Android WebView Beta" + }, + { + "type": "string", + "enum": [ + "ch" + ], + "title": "Google Chrome" + }, + { + "type": "string", + "enum": [ + "ci" + ], + "title": "Google Chrome (iOS)" + }, + { + "type": "string", + "enum": [ + "cm" + ], + "title": "Google Chrome (Mobile)" + }, + { + "type": "string", + "enum": [ + "cr" + ], + "title": "Chromium" + }, + { + "type": "string", + "enum": [ + "ff" + ], + "title": "Mozilla Firefox" + }, + { + "type": "string", + "enum": [ + "sf" + ], + "title": "Safari" + }, + { + "type": "string", + "enum": [ + "mf" + ], + "title": "Mobile Safari" + }, + { + "type": "string", + "enum": [ + "ps" + ], + "title": "Microsoft Edge" + }, + { + "type": "string", + "enum": [ + "oi" + ], + "title": "Microsoft Edge (iOS)" + }, + { + "type": "string", + "enum": [ + "om" + ], + "title": "Opera Mini" + }, + { + "type": "string", + "enum": [ + "op" + ], + "title": "Opera" + }, + { + "type": "string", + "enum": [ + "on" + ], + "title": "Opera (Next)" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "example": "amex", + "title": "CreditCard", + "oneOf": [ + { + "type": "string", + "enum": [ + "amex" + ], + "title": "American Express" + }, + { + "type": "string", + "enum": [ + "argencard" + ], + "title": "Argencard" + }, + { + "type": "string", + "enum": [ + "cabal" + ], + "title": "Cabal" + }, + { + "type": "string", + "enum": [ + "cencosud" + ], + "title": "Cencosud" + }, + { + "type": "string", + "enum": [ + "diners" + ], + "title": "Diners Club" + }, + { + "type": "string", + "enum": [ + "discover" + ], + "title": "Discover" + }, + { + "type": "string", + "enum": [ + "elo" + ], + "title": "Elo" + }, + { + "type": "string", + "enum": [ + "hipercard" + ], + "title": "Hipercard" + }, + { + "type": "string", + "enum": [ + "jcb" + ], + "title": "JCB" + }, + { + "type": "string", + "enum": [ + "mastercard" + ], + "title": "Mastercard" + }, + { + "type": "string", + "enum": [ + "naranja" + ], + "title": "Naranja" + }, + { + "type": "string", + "enum": [ + "targeta-shopping" + ], + "title": "Tarjeta Shopping" + }, + { + "type": "string", + "enum": [ + "unionpay" + ], + "title": "Union Pay" + }, + { + "type": "string", + "enum": [ + "visa" + ], + "title": "Visa" + }, + { + "type": "string", + "enum": [ + "mir" + ], + "title": "MIR" + }, + { + "type": "string", + "enum": [ + "maestro" + ], + "title": "Maestro" + }, + { + "type": "string", + "enum": [ + "rupay" + ], + "title": "Rupay" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "example": "af", + "title": "Flag", + "oneOf": [ + { + "type": "string", + "enum": [ + "af" + ], + "title": "Afghanistan" + }, + { + "type": "string", + "enum": [ + "ao" + ], + "title": "Angola" + }, + { + "type": "string", + "enum": [ + "al" + ], + "title": "Albania" + }, + { + "type": "string", + "enum": [ + "ad" + ], + "title": "Andorra" + }, + { + "type": "string", + "enum": [ + "ae" + ], + "title": "United Arab Emirates" + }, + { + "type": "string", + "enum": [ + "ar" + ], + "title": "Argentina" + }, + { + "type": "string", + "enum": [ + "am" + ], + "title": "Armenia" + }, + { + "type": "string", + "enum": [ + "ag" + ], + "title": "Antigua and Barbuda" + }, + { + "type": "string", + "enum": [ + "au" + ], + "title": "Australia" + }, + { + "type": "string", + "enum": [ + "at" + ], + "title": "Austria" + }, + { + "type": "string", + "enum": [ + "az" + ], + "title": "Azerbaijan" + }, + { + "type": "string", + "enum": [ + "bi" + ], + "title": "Burundi" + }, + { + "type": "string", + "enum": [ + "be" + ], + "title": "Belgium" + }, + { + "type": "string", + "enum": [ + "bj" + ], + "title": "Benin" + }, + { + "type": "string", + "enum": [ + "bf" + ], + "title": "Burkina Faso" + }, + { + "type": "string", + "enum": [ + "bd" + ], + "title": "Bangladesh" + }, + { + "type": "string", + "enum": [ + "bg" + ], + "title": "Bulgaria" + }, + { + "type": "string", + "enum": [ + "bh" + ], + "title": "Bahrain" + }, + { + "type": "string", + "enum": [ + "bs" + ], + "title": "Bahamas" + }, + { + "type": "string", + "enum": [ + "ba" + ], + "title": "Bosnia and Herzegovina" + }, + { + "type": "string", + "enum": [ + "by" + ], + "title": "Belarus" + }, + { + "type": "string", + "enum": [ + "bz" + ], + "title": "Belize" + }, + { + "type": "string", + "enum": [ + "bo" + ], + "title": "Bolivia" + }, + { + "type": "string", + "enum": [ + "br" + ], + "title": "Brazil" + }, + { + "type": "string", + "enum": [ + "bb" + ], + "title": "Barbados" + }, + { + "type": "string", + "enum": [ + "bn" + ], + "title": "Brunei Darussalam" + }, + { + "type": "string", + "enum": [ + "bt" + ], + "title": "Bhutan" + }, + { + "type": "string", + "enum": [ + "bw" + ], + "title": "Botswana" + }, + { + "type": "string", + "enum": [ + "cf" + ], + "title": "Central African Republic" + }, + { + "type": "string", + "enum": [ + "ca" + ], + "title": "Canada" + }, + { + "type": "string", + "enum": [ + "ch" + ], + "title": "Switzerland" + }, + { + "type": "string", + "enum": [ + "cl" + ], + "title": "Chile" + }, + { + "type": "string", + "enum": [ + "cn" + ], + "title": "China" + }, + { + "type": "string", + "enum": [ + "ci" + ], + "title": "C\u00f4te d'Ivoire" + }, + { + "type": "string", + "enum": [ + "cm" + ], + "title": "Cameroon" + }, + { + "type": "string", + "enum": [ + "cd" + ], + "title": "Democratic Republic of the Congo" + }, + { + "type": "string", + "enum": [ + "cg" + ], + "title": "Republic of the Congo" + }, + { + "type": "string", + "enum": [ + "co" + ], + "title": "Colombia" + }, + { + "type": "string", + "enum": [ + "km" + ], + "title": "Comoros" + }, + { + "type": "string", + "enum": [ + "cv" + ], + "title": "Cape Verde" + }, + { + "type": "string", + "enum": [ + "cr" + ], + "title": "Costa Rica" + }, + { + "type": "string", + "enum": [ + "cu" + ], + "title": "Cuba" + }, + { + "type": "string", + "enum": [ + "cy" + ], + "title": "Cyprus" + }, + { + "type": "string", + "enum": [ + "cz" + ], + "title": "Czech Republic" + }, + { + "type": "string", + "enum": [ + "de" + ], + "title": "Germany" + }, + { + "type": "string", + "enum": [ + "dj" + ], + "title": "Djibouti" + }, + { + "type": "string", + "enum": [ + "dm" + ], + "title": "Dominica" + }, + { + "type": "string", + "enum": [ + "dk" + ], + "title": "Denmark" + }, + { + "type": "string", + "enum": [ + "do" + ], + "title": "Dominican Republic" + }, + { + "type": "string", + "enum": [ + "dz" + ], + "title": "Algeria" + }, + { + "type": "string", + "enum": [ + "ec" + ], + "title": "Ecuador" + }, + { + "type": "string", + "enum": [ + "eg" + ], + "title": "Egypt" + }, + { + "type": "string", + "enum": [ + "er" + ], + "title": "Eritrea" + }, + { + "type": "string", + "enum": [ + "es" + ], + "title": "Spain" + }, + { + "type": "string", + "enum": [ + "ee" + ], + "title": "Estonia" + }, + { + "type": "string", + "enum": [ + "et" + ], + "title": "Ethiopia" + }, + { + "type": "string", + "enum": [ + "fi" + ], + "title": "Finland" + }, + { + "type": "string", + "enum": [ + "fj" + ], + "title": "Fiji" + }, + { + "type": "string", + "enum": [ + "fr" + ], + "title": "France" + }, + { + "type": "string", + "enum": [ + "fm" + ], + "title": "Micronesia (Federated States of)" + }, + { + "type": "string", + "enum": [ + "ga" + ], + "title": "Gabon" + }, + { + "type": "string", + "enum": [ + "gb" + ], + "title": "United Kingdom" + }, + { + "type": "string", + "enum": [ + "ge" + ], + "title": "Georgia" + }, + { + "type": "string", + "enum": [ + "gh" + ], + "title": "Ghana" + }, + { + "type": "string", + "enum": [ + "gn" + ], + "title": "Guinea" + }, + { + "type": "string", + "enum": [ + "gm" + ], + "title": "Gambia" + }, + { + "type": "string", + "enum": [ + "gw" + ], + "title": "Guinea-Bissau" + }, + { + "type": "string", + "enum": [ + "gq" + ], + "title": "Equatorial Guinea" + }, + { + "type": "string", + "enum": [ + "gr" + ], + "title": "Greece" + }, + { + "type": "string", + "enum": [ + "gd" + ], + "title": "Grenada" + }, + { + "type": "string", + "enum": [ + "gt" + ], + "title": "Guatemala" + }, + { + "type": "string", + "enum": [ + "gy" + ], + "title": "Guyana" + }, + { + "type": "string", + "enum": [ + "hn" + ], + "title": "Honduras" + }, + { + "type": "string", + "enum": [ + "hr" + ], + "title": "Croatia" + }, + { + "type": "string", + "enum": [ + "ht" + ], + "title": "Haiti" + }, + { + "type": "string", + "enum": [ + "hu" + ], + "title": "Hungary" + }, + { + "type": "string", + "enum": [ + "id" + ], + "title": "Indonesia" + }, + { + "type": "string", + "enum": [ + "in" + ], + "title": "India" + }, + { + "type": "string", + "enum": [ + "ie" + ], + "title": "Ireland" + }, + { + "type": "string", + "enum": [ + "ir" + ], + "title": "Iran (Islamic Republic of)" + }, + { + "type": "string", + "enum": [ + "iq" + ], + "title": "Iraq" + }, + { + "type": "string", + "enum": [ + "is" + ], + "title": "Iceland" + }, + { + "type": "string", + "enum": [ + "il" + ], + "title": "Israel" + }, + { + "type": "string", + "enum": [ + "it" + ], + "title": "Italy" + }, + { + "type": "string", + "enum": [ + "jm" + ], + "title": "Jamaica" + }, + { + "type": "string", + "enum": [ + "jo" + ], + "title": "Jordan" + }, + { + "type": "string", + "enum": [ + "jp" + ], + "title": "Japan" + }, + { + "type": "string", + "enum": [ + "kz" + ], + "title": "Kazakhstan" + }, + { + "type": "string", + "enum": [ + "ke" + ], + "title": "Kenya" + }, + { + "type": "string", + "enum": [ + "kg" + ], + "title": "Kyrgyzstan" + }, + { + "type": "string", + "enum": [ + "kh" + ], + "title": "Cambodia" + }, + { + "type": "string", + "enum": [ + "ki" + ], + "title": "Kiribati" + }, + { + "type": "string", + "enum": [ + "kn" + ], + "title": "Saint Kitts and Nevis" + }, + { + "type": "string", + "enum": [ + "kr" + ], + "title": "South Korea" + }, + { + "type": "string", + "enum": [ + "kw" + ], + "title": "Kuwait" + }, + { + "type": "string", + "enum": [ + "la" + ], + "title": "Lao People's Democratic Republic" + }, + { + "type": "string", + "enum": [ + "lb" + ], + "title": "Lebanon" + }, + { + "type": "string", + "enum": [ + "lr" + ], + "title": "Liberia" + }, + { + "type": "string", + "enum": [ + "ly" + ], + "title": "Libya" + }, + { + "type": "string", + "enum": [ + "lc" + ], + "title": "Saint Lucia" + }, + { + "type": "string", + "enum": [ + "li" + ], + "title": "Liechtenstein" + }, + { + "type": "string", + "enum": [ + "lk" + ], + "title": "Sri Lanka" + }, + { + "type": "string", + "enum": [ + "ls" + ], + "title": "Lesotho" + }, + { + "type": "string", + "enum": [ + "lt" + ], + "title": "Lithuania" + }, + { + "type": "string", + "enum": [ + "lu" + ], + "title": "Luxembourg" + }, + { + "type": "string", + "enum": [ + "lv" + ], + "title": "Latvia" + }, + { + "type": "string", + "enum": [ + "ma" + ], + "title": "Morocco" + }, + { + "type": "string", + "enum": [ + "mc" + ], + "title": "Monaco" + }, + { + "type": "string", + "enum": [ + "md" + ], + "title": "Moldova" + }, + { + "type": "string", + "enum": [ + "mg" + ], + "title": "Madagascar" + }, + { + "type": "string", + "enum": [ + "mv" + ], + "title": "Maldives" + }, + { + "type": "string", + "enum": [ + "mx" + ], + "title": "Mexico" + }, + { + "type": "string", + "enum": [ + "mh" + ], + "title": "Marshall Islands" + }, + { + "type": "string", + "enum": [ + "mk" + ], + "title": "North Macedonia" + }, + { + "type": "string", + "enum": [ + "ml" + ], + "title": "Mali" + }, + { + "type": "string", + "enum": [ + "mt" + ], + "title": "Malta" + }, + { + "type": "string", + "enum": [ + "mm" + ], + "title": "Myanmar" + }, + { + "type": "string", + "enum": [ + "me" + ], + "title": "Montenegro" + }, + { + "type": "string", + "enum": [ + "mn" + ], + "title": "Mongolia" + }, + { + "type": "string", + "enum": [ + "mz" + ], + "title": "Mozambique" + }, + { + "type": "string", + "enum": [ + "mr" + ], + "title": "Mauritania" + }, + { + "type": "string", + "enum": [ + "mu" + ], + "title": "Mauritius" + }, + { + "type": "string", + "enum": [ + "mw" + ], + "title": "Malawi" + }, + { + "type": "string", + "enum": [ + "my" + ], + "title": "Malaysia" + }, + { + "type": "string", + "enum": [ + "na" + ], + "title": "Namibia" + }, + { + "type": "string", + "enum": [ + "ne" + ], + "title": "Niger" + }, + { + "type": "string", + "enum": [ + "ng" + ], + "title": "Nigeria" + }, + { + "type": "string", + "enum": [ + "ni" + ], + "title": "Nicaragua" + }, + { + "type": "string", + "enum": [ + "nl" + ], + "title": "Netherlands" + }, + { + "type": "string", + "enum": [ + "no" + ], + "title": "Norway" + }, + { + "type": "string", + "enum": [ + "np" + ], + "title": "Nepal" + }, + { + "type": "string", + "enum": [ + "nr" + ], + "title": "Nauru" + }, + { + "type": "string", + "enum": [ + "nz" + ], + "title": "New Zealand" + }, + { + "type": "string", + "enum": [ + "om" + ], + "title": "Oman" + }, + { + "type": "string", + "enum": [ + "pk" + ], + "title": "Pakistan" + }, + { + "type": "string", + "enum": [ + "pa" + ], + "title": "Panama" + }, + { + "type": "string", + "enum": [ + "pe" + ], + "title": "Peru" + }, + { + "type": "string", + "enum": [ + "ph" + ], + "title": "Philippines" + }, + { + "type": "string", + "enum": [ + "pw" + ], + "title": "Palau" + }, + { + "type": "string", + "enum": [ + "pg" + ], + "title": "Papua New Guinea" + }, + { + "type": "string", + "enum": [ + "pl" + ], + "title": "Poland" + }, + { + "type": "string", + "enum": [ + "pf" + ], + "title": "French Polynesia" + }, + { + "type": "string", + "enum": [ + "kp" + ], + "title": "North Korea" + }, + { + "type": "string", + "enum": [ + "pt" + ], + "title": "Portugal" + }, + { + "type": "string", + "enum": [ + "py" + ], + "title": "Paraguay" + }, + { + "type": "string", + "enum": [ + "qa" + ], + "title": "Qatar" + }, + { + "type": "string", + "enum": [ + "ro" + ], + "title": "Romania" + }, + { + "type": "string", + "enum": [ + "ru" + ], + "title": "Russia" + }, + { + "type": "string", + "enum": [ + "rw" + ], + "title": "Rwanda" + }, + { + "type": "string", + "enum": [ + "sa" + ], + "title": "Saudi Arabia" + }, + { + "type": "string", + "enum": [ + "sd" + ], + "title": "Sudan" + }, + { + "type": "string", + "enum": [ + "sn" + ], + "title": "Senegal" + }, + { + "type": "string", + "enum": [ + "sg" + ], + "title": "Singapore" + }, + { + "type": "string", + "enum": [ + "sb" + ], + "title": "Solomon Islands" + }, + { + "type": "string", + "enum": [ + "sl" + ], + "title": "Sierra Leone" + }, + { + "type": "string", + "enum": [ + "sv" + ], + "title": "El Salvador" + }, + { + "type": "string", + "enum": [ + "sm" + ], + "title": "San Marino" + }, + { + "type": "string", + "enum": [ + "so" + ], + "title": "Somalia" + }, + { + "type": "string", + "enum": [ + "rs" + ], + "title": "Serbia" + }, + { + "type": "string", + "enum": [ + "ss" + ], + "title": "South Sudan" + }, + { + "type": "string", + "enum": [ + "st" + ], + "title": "Sao Tome and Principe" + }, + { + "type": "string", + "enum": [ + "sr" + ], + "title": "Suriname" + }, + { + "type": "string", + "enum": [ + "sk" + ], + "title": "Slovakia" + }, + { + "type": "string", + "enum": [ + "si" + ], + "title": "Slovenia" + }, + { + "type": "string", + "enum": [ + "se" + ], + "title": "Sweden" + }, + { + "type": "string", + "enum": [ + "sz" + ], + "title": "Eswatini" + }, + { + "type": "string", + "enum": [ + "sc" + ], + "title": "Seychelles" + }, + { + "type": "string", + "enum": [ + "sy" + ], + "title": "Syria" + }, + { + "type": "string", + "enum": [ + "td" + ], + "title": "Chad" + }, + { + "type": "string", + "enum": [ + "tg" + ], + "title": "Togo" + }, + { + "type": "string", + "enum": [ + "th" + ], + "title": "Thailand" + }, + { + "type": "string", + "enum": [ + "tj" + ], + "title": "Tajikistan" + }, + { + "type": "string", + "enum": [ + "tm" + ], + "title": "Turkmenistan" + }, + { + "type": "string", + "enum": [ + "tl" + ], + "title": "Timor-Leste" + }, + { + "type": "string", + "enum": [ + "to" + ], + "title": "Tonga" + }, + { + "type": "string", + "enum": [ + "tt" + ], + "title": "Trinidad and Tobago" + }, + { + "type": "string", + "enum": [ + "tn" + ], + "title": "Tunisia" + }, + { + "type": "string", + "enum": [ + "tr" + ], + "title": "Turkey" + }, + { + "type": "string", + "enum": [ + "tv" + ], + "title": "Tuvalu" + }, + { + "type": "string", + "enum": [ + "tz" + ], + "title": "Tanzania" + }, + { + "type": "string", + "enum": [ + "ug" + ], + "title": "Uganda" + }, + { + "type": "string", + "enum": [ + "ua" + ], + "title": "Ukraine" + }, + { + "type": "string", + "enum": [ + "uy" + ], + "title": "Uruguay" + }, + { + "type": "string", + "enum": [ + "us" + ], + "title": "United States" + }, + { + "type": "string", + "enum": [ + "uz" + ], + "title": "Uzbekistan" + }, + { + "type": "string", + "enum": [ + "va" + ], + "title": "Vatican City" + }, + { + "type": "string", + "enum": [ + "vc" + ], + "title": "Saint Vincent and the Grenadines" + }, + { + "type": "string", + "enum": [ + "ve" + ], + "title": "Venezuela" + }, + { + "type": "string", + "enum": [ + "vn" + ], + "title": "Vietnam" + }, + { + "type": "string", + "enum": [ + "vu" + ], + "title": "Vanuatu" + }, + { + "type": "string", + "enum": [ + "ws" + ], + "title": "Samoa" + }, + { + "type": "string", + "enum": [ + "ye" + ], + "title": "Yemen" + }, + { + "type": "string", + "enum": [ + "za" + ], + "title": "South Africa" + }, + { + "type": "string", + "enum": [ + "zm" + ], + "title": "Zambia" + }, + { + "type": "string", + "enum": [ + "zw" + ], + "title": "Zimbabwe" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 400 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<NAME>", + "default": "" + }, + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/photo": { + "get": { + "summary": "Get user photo", + "operationId": "avatarsGetPhoto", + "tags": [ + "avatars" + ], + "description": "Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.\n\nPassing `userId` \u2014 `current()` for the authenticated user \u2014 resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and\/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-photo.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "width", + "description": "Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "height", + "description": "Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Output image quality between 0 and 100. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "output", + "description": "Output image format. Defaults to 'png'.", + "required": false, + "schema": { + "type": "string", + "example": "png", + "default": "png" + }, + "in": "query" + }, + { + "name": "rating", + "description": "Maximum image rating to fetch from Gravatar\/Libravatar. Defaults to 'g'.", + "required": false, + "schema": { + "type": "string", + "example": "g", + "default": "g" + }, + "in": "query" + }, + { + "name": "userId", + "description": "User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed.", + "required": false, + "schema": { + "type": "string", + "example": "current()", + "default": "" + }, + "in": "query" + }, + { + "name": "emailHash", + "description": "SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself.", + "required": false, + "schema": { + "type": "string", + "example": "<EMAIL_HASH>", + "default": "" + }, + "in": "query" + }, + { + "name": "name", + "description": "Name to render initials from instead of the user's own name. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<NAME>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "example": "<TEXT>" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/avatars\/screenshots": { + "get": { + "summary": "Get webpage screenshot", + "operationId": "avatarsGetScreenshot", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.\n\nYou can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.\n\nWhen width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-screenshot.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to capture.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "headers", + "description": "HTTP headers to send with the browser request. Defaults to empty.", + "required": false, + "schema": { + "type": "object", + "default": [], + "example": { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + } + }, + "in": "query" + }, + { + "name": "viewportWidth", + "description": "Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1920, + "default": 1280 + }, + "in": "query" + }, + { + "name": "viewportHeight", + "description": "Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1080, + "default": 720 + }, + "in": "query" + }, + { + "name": "scale", + "description": "Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 2, + "default": 1 + }, + "in": "query" + }, + { + "name": "theme", + "description": "Browser theme. Pass \"light\" or \"dark\". Defaults to \"light\".", + "required": false, + "schema": { + "type": "string", + "example": "dark", + "title": "BrowserTheme", + "oneOf": [ + { + "type": "string", + "enum": [ + "light" + ], + "title": "light" + }, + { + "type": "string", + "enum": [ + "dark" + ], + "title": "dark" + } + ], + "default": "light" + }, + "in": "query" + }, + { + "name": "userAgent", + "description": "Custom user agent string. Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "Mozilla\/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit\/605.1.15", + "default": "" + }, + "in": "query" + }, + { + "name": "fullpage", + "description": "Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": true, + "default": false + }, + "in": "query" + }, + { + "name": "locale", + "description": "Browser locale (e.g., \"en-US\", \"fr-FR\"). Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "en-US", + "default": "" + }, + "in": "query" + }, + { + "name": "timezone", + "description": "IANA timezone identifier (e.g., \"America\/New_York\", \"Europe\/London\"). Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "America\/New_York", + "title": "Timezone", + "oneOf": [ + { + "type": "string", + "enum": [ + "africa\/abidjan" + ], + "title": "africa\/abidjan" + }, + { + "type": "string", + "enum": [ + "africa\/accra" + ], + "title": "africa\/accra" + }, + { + "type": "string", + "enum": [ + "africa\/addis_ababa" + ], + "title": "africa\/addis_ababa" + }, + { + "type": "string", + "enum": [ + "africa\/algiers" + ], + "title": "africa\/algiers" + }, + { + "type": "string", + "enum": [ + "africa\/asmara" + ], + "title": "africa\/asmara" + }, + { + "type": "string", + "enum": [ + "africa\/bamako" + ], + "title": "africa\/bamako" + }, + { + "type": "string", + "enum": [ + "africa\/bangui" + ], + "title": "africa\/bangui" + }, + { + "type": "string", + "enum": [ + "africa\/banjul" + ], + "title": "africa\/banjul" + }, + { + "type": "string", + "enum": [ + "africa\/bissau" + ], + "title": "africa\/bissau" + }, + { + "type": "string", + "enum": [ + "africa\/blantyre" + ], + "title": "africa\/blantyre" + }, + { + "type": "string", + "enum": [ + "africa\/brazzaville" + ], + "title": "africa\/brazzaville" + }, + { + "type": "string", + "enum": [ + "africa\/bujumbura" + ], + "title": "africa\/bujumbura" + }, + { + "type": "string", + "enum": [ + "africa\/cairo" + ], + "title": "africa\/cairo" + }, + { + "type": "string", + "enum": [ + "africa\/casablanca" + ], + "title": "africa\/casablanca" + }, + { + "type": "string", + "enum": [ + "africa\/ceuta" + ], + "title": "africa\/ceuta" + }, + { + "type": "string", + "enum": [ + "africa\/conakry" + ], + "title": "africa\/conakry" + }, + { + "type": "string", + "enum": [ + "africa\/dakar" + ], + "title": "africa\/dakar" + }, + { + "type": "string", + "enum": [ + "africa\/dar_es_salaam" + ], + "title": "africa\/dar_es_salaam" + }, + { + "type": "string", + "enum": [ + "africa\/djibouti" + ], + "title": "africa\/djibouti" + }, + { + "type": "string", + "enum": [ + "africa\/douala" + ], + "title": "africa\/douala" + }, + { + "type": "string", + "enum": [ + "africa\/el_aaiun" + ], + "title": "africa\/el_aaiun" + }, + { + "type": "string", + "enum": [ + "africa\/freetown" + ], + "title": "africa\/freetown" + }, + { + "type": "string", + "enum": [ + "africa\/gaborone" + ], + "title": "africa\/gaborone" + }, + { + "type": "string", + "enum": [ + "africa\/harare" + ], + "title": "africa\/harare" + }, + { + "type": "string", + "enum": [ + "africa\/johannesburg" + ], + "title": "africa\/johannesburg" + }, + { + "type": "string", + "enum": [ + "africa\/juba" + ], + "title": "africa\/juba" + }, + { + "type": "string", + "enum": [ + "africa\/kampala" + ], + "title": "africa\/kampala" + }, + { + "type": "string", + "enum": [ + "africa\/khartoum" + ], + "title": "africa\/khartoum" + }, + { + "type": "string", + "enum": [ + "africa\/kigali" + ], + "title": "africa\/kigali" + }, + { + "type": "string", + "enum": [ + "africa\/kinshasa" + ], + "title": "africa\/kinshasa" + }, + { + "type": "string", + "enum": [ + "africa\/lagos" + ], + "title": "africa\/lagos" + }, + { + "type": "string", + "enum": [ + "africa\/libreville" + ], + "title": "africa\/libreville" + }, + { + "type": "string", + "enum": [ + "africa\/lome" + ], + "title": "africa\/lome" + }, + { + "type": "string", + "enum": [ + "africa\/luanda" + ], + "title": "africa\/luanda" + }, + { + "type": "string", + "enum": [ + "africa\/lubumbashi" + ], + "title": "africa\/lubumbashi" + }, + { + "type": "string", + "enum": [ + "africa\/lusaka" + ], + "title": "africa\/lusaka" + }, + { + "type": "string", + "enum": [ + "africa\/malabo" + ], + "title": "africa\/malabo" + }, + { + "type": "string", + "enum": [ + "africa\/maputo" + ], + "title": "africa\/maputo" + }, + { + "type": "string", + "enum": [ + "africa\/maseru" + ], + "title": "africa\/maseru" + }, + { + "type": "string", + "enum": [ + "africa\/mbabane" + ], + "title": "africa\/mbabane" + }, + { + "type": "string", + "enum": [ + "africa\/mogadishu" + ], + "title": "africa\/mogadishu" + }, + { + "type": "string", + "enum": [ + "africa\/monrovia" + ], + "title": "africa\/monrovia" + }, + { + "type": "string", + "enum": [ + "africa\/nairobi" + ], + "title": "africa\/nairobi" + }, + { + "type": "string", + "enum": [ + "africa\/ndjamena" + ], + "title": "africa\/ndjamena" + }, + { + "type": "string", + "enum": [ + "africa\/niamey" + ], + "title": "africa\/niamey" + }, + { + "type": "string", + "enum": [ + "africa\/nouakchott" + ], + "title": "africa\/nouakchott" + }, + { + "type": "string", + "enum": [ + "africa\/ouagadougou" + ], + "title": "africa\/ouagadougou" + }, + { + "type": "string", + "enum": [ + "africa\/porto-novo" + ], + "title": "africa\/porto-novo" + }, + { + "type": "string", + "enum": [ + "africa\/sao_tome" + ], + "title": "africa\/sao_tome" + }, + { + "type": "string", + "enum": [ + "africa\/tripoli" + ], + "title": "africa\/tripoli" + }, + { + "type": "string", + "enum": [ + "africa\/tunis" + ], + "title": "africa\/tunis" + }, + { + "type": "string", + "enum": [ + "africa\/windhoek" + ], + "title": "africa\/windhoek" + }, + { + "type": "string", + "enum": [ + "america\/adak" + ], + "title": "america\/adak" + }, + { + "type": "string", + "enum": [ + "america\/anchorage" + ], + "title": "america\/anchorage" + }, + { + "type": "string", + "enum": [ + "america\/anguilla" + ], + "title": "america\/anguilla" + }, + { + "type": "string", + "enum": [ + "america\/antigua" + ], + "title": "america\/antigua" + }, + { + "type": "string", + "enum": [ + "america\/araguaina" + ], + "title": "america\/araguaina" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/buenos_aires" + ], + "title": "america\/argentina\/buenos_aires" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/catamarca" + ], + "title": "america\/argentina\/catamarca" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/cordoba" + ], + "title": "america\/argentina\/cordoba" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/jujuy" + ], + "title": "america\/argentina\/jujuy" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/la_rioja" + ], + "title": "america\/argentina\/la_rioja" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/mendoza" + ], + "title": "america\/argentina\/mendoza" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/rio_gallegos" + ], + "title": "america\/argentina\/rio_gallegos" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/salta" + ], + "title": "america\/argentina\/salta" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/san_juan" + ], + "title": "america\/argentina\/san_juan" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/san_luis" + ], + "title": "america\/argentina\/san_luis" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/tucuman" + ], + "title": "america\/argentina\/tucuman" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/ushuaia" + ], + "title": "america\/argentina\/ushuaia" + }, + { + "type": "string", + "enum": [ + "america\/aruba" + ], + "title": "america\/aruba" + }, + { + "type": "string", + "enum": [ + "america\/asuncion" + ], + "title": "america\/asuncion" + }, + { + "type": "string", + "enum": [ + "america\/atikokan" + ], + "title": "america\/atikokan" + }, + { + "type": "string", + "enum": [ + "america\/bahia" + ], + "title": "america\/bahia" + }, + { + "type": "string", + "enum": [ + "america\/bahia_banderas" + ], + "title": "america\/bahia_banderas" + }, + { + "type": "string", + "enum": [ + "america\/barbados" + ], + "title": "america\/barbados" + }, + { + "type": "string", + "enum": [ + "america\/belem" + ], + "title": "america\/belem" + }, + { + "type": "string", + "enum": [ + "america\/belize" + ], + "title": "america\/belize" + }, + { + "type": "string", + "enum": [ + "america\/blanc-sablon" + ], + "title": "america\/blanc-sablon" + }, + { + "type": "string", + "enum": [ + "america\/boa_vista" + ], + "title": "america\/boa_vista" + }, + { + "type": "string", + "enum": [ + "america\/bogota" + ], + "title": "america\/bogota" + }, + { + "type": "string", + "enum": [ + "america\/boise" + ], + "title": "america\/boise" + }, + { + "type": "string", + "enum": [ + "america\/cambridge_bay" + ], + "title": "america\/cambridge_bay" + }, + { + "type": "string", + "enum": [ + "america\/campo_grande" + ], + "title": "america\/campo_grande" + }, + { + "type": "string", + "enum": [ + "america\/cancun" + ], + "title": "america\/cancun" + }, + { + "type": "string", + "enum": [ + "america\/caracas" + ], + "title": "america\/caracas" + }, + { + "type": "string", + "enum": [ + "america\/cayenne" + ], + "title": "america\/cayenne" + }, + { + "type": "string", + "enum": [ + "america\/cayman" + ], + "title": "america\/cayman" + }, + { + "type": "string", + "enum": [ + "america\/chicago" + ], + "title": "america\/chicago" + }, + { + "type": "string", + "enum": [ + "america\/chihuahua" + ], + "title": "america\/chihuahua" + }, + { + "type": "string", + "enum": [ + "america\/ciudad_juarez" + ], + "title": "america\/ciudad_juarez" + }, + { + "type": "string", + "enum": [ + "america\/costa_rica" + ], + "title": "america\/costa_rica" + }, + { + "type": "string", + "enum": [ + "america\/coyhaique" + ], + "title": "america\/coyhaique" + }, + { + "type": "string", + "enum": [ + "america\/creston" + ], + "title": "america\/creston" + }, + { + "type": "string", + "enum": [ + "america\/cuiaba" + ], + "title": "america\/cuiaba" + }, + { + "type": "string", + "enum": [ + "america\/curacao" + ], + "title": "america\/curacao" + }, + { + "type": "string", + "enum": [ + "america\/danmarkshavn" + ], + "title": "america\/danmarkshavn" + }, + { + "type": "string", + "enum": [ + "america\/dawson" + ], + "title": "america\/dawson" + }, + { + "type": "string", + "enum": [ + "america\/dawson_creek" + ], + "title": "america\/dawson_creek" + }, + { + "type": "string", + "enum": [ + "america\/denver" + ], + "title": "america\/denver" + }, + { + "type": "string", + "enum": [ + "america\/detroit" + ], + "title": "america\/detroit" + }, + { + "type": "string", + "enum": [ + "america\/dominica" + ], + "title": "america\/dominica" + }, + { + "type": "string", + "enum": [ + "america\/edmonton" + ], + "title": "america\/edmonton" + }, + { + "type": "string", + "enum": [ + "america\/eirunepe" + ], + "title": "america\/eirunepe" + }, + { + "type": "string", + "enum": [ + "america\/el_salvador" + ], + "title": "america\/el_salvador" + }, + { + "type": "string", + "enum": [ + "america\/fort_nelson" + ], + "title": "america\/fort_nelson" + }, + { + "type": "string", + "enum": [ + "america\/fortaleza" + ], + "title": "america\/fortaleza" + }, + { + "type": "string", + "enum": [ + "america\/glace_bay" + ], + "title": "america\/glace_bay" + }, + { + "type": "string", + "enum": [ + "america\/goose_bay" + ], + "title": "america\/goose_bay" + }, + { + "type": "string", + "enum": [ + "america\/grand_turk" + ], + "title": "america\/grand_turk" + }, + { + "type": "string", + "enum": [ + "america\/grenada" + ], + "title": "america\/grenada" + }, + { + "type": "string", + "enum": [ + "america\/guadeloupe" + ], + "title": "america\/guadeloupe" + }, + { + "type": "string", + "enum": [ + "america\/guatemala" + ], + "title": "america\/guatemala" + }, + { + "type": "string", + "enum": [ + "america\/guayaquil" + ], + "title": "america\/guayaquil" + }, + { + "type": "string", + "enum": [ + "america\/guyana" + ], + "title": "america\/guyana" + }, + { + "type": "string", + "enum": [ + "america\/halifax" + ], + "title": "america\/halifax" + }, + { + "type": "string", + "enum": [ + "america\/havana" + ], + "title": "america\/havana" + }, + { + "type": "string", + "enum": [ + "america\/hermosillo" + ], + "title": "america\/hermosillo" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/indianapolis" + ], + "title": "america\/indiana\/indianapolis" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/knox" + ], + "title": "america\/indiana\/knox" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/marengo" + ], + "title": "america\/indiana\/marengo" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/petersburg" + ], + "title": "america\/indiana\/petersburg" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/tell_city" + ], + "title": "america\/indiana\/tell_city" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/vevay" + ], + "title": "america\/indiana\/vevay" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/vincennes" + ], + "title": "america\/indiana\/vincennes" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/winamac" + ], + "title": "america\/indiana\/winamac" + }, + { + "type": "string", + "enum": [ + "america\/inuvik" + ], + "title": "america\/inuvik" + }, + { + "type": "string", + "enum": [ + "america\/iqaluit" + ], + "title": "america\/iqaluit" + }, + { + "type": "string", + "enum": [ + "america\/jamaica" + ], + "title": "america\/jamaica" + }, + { + "type": "string", + "enum": [ + "america\/juneau" + ], + "title": "america\/juneau" + }, + { + "type": "string", + "enum": [ + "america\/kentucky\/louisville" + ], + "title": "america\/kentucky\/louisville" + }, + { + "type": "string", + "enum": [ + "america\/kentucky\/monticello" + ], + "title": "america\/kentucky\/monticello" + }, + { + "type": "string", + "enum": [ + "america\/kralendijk" + ], + "title": "america\/kralendijk" + }, + { + "type": "string", + "enum": [ + "america\/la_paz" + ], + "title": "america\/la_paz" + }, + { + "type": "string", + "enum": [ + "america\/lima" + ], + "title": "america\/lima" + }, + { + "type": "string", + "enum": [ + "america\/los_angeles" + ], + "title": "america\/los_angeles" + }, + { + "type": "string", + "enum": [ + "america\/lower_princes" + ], + "title": "america\/lower_princes" + }, + { + "type": "string", + "enum": [ + "america\/maceio" + ], + "title": "america\/maceio" + }, + { + "type": "string", + "enum": [ + "america\/managua" + ], + "title": "america\/managua" + }, + { + "type": "string", + "enum": [ + "america\/manaus" + ], + "title": "america\/manaus" + }, + { + "type": "string", + "enum": [ + "america\/marigot" + ], + "title": "america\/marigot" + }, + { + "type": "string", + "enum": [ + "america\/martinique" + ], + "title": "america\/martinique" + }, + { + "type": "string", + "enum": [ + "america\/matamoros" + ], + "title": "america\/matamoros" + }, + { + "type": "string", + "enum": [ + "america\/mazatlan" + ], + "title": "america\/mazatlan" + }, + { + "type": "string", + "enum": [ + "america\/menominee" + ], + "title": "america\/menominee" + }, + { + "type": "string", + "enum": [ + "america\/merida" + ], + "title": "america\/merida" + }, + { + "type": "string", + "enum": [ + "america\/metlakatla" + ], + "title": "america\/metlakatla" + }, + { + "type": "string", + "enum": [ + "america\/mexico_city" + ], + "title": "america\/mexico_city" + }, + { + "type": "string", + "enum": [ + "america\/miquelon" + ], + "title": "america\/miquelon" + }, + { + "type": "string", + "enum": [ + "america\/moncton" + ], + "title": "america\/moncton" + }, + { + "type": "string", + "enum": [ + "america\/monterrey" + ], + "title": "america\/monterrey" + }, + { + "type": "string", + "enum": [ + "america\/montevideo" + ], + "title": "america\/montevideo" + }, + { + "type": "string", + "enum": [ + "america\/montserrat" + ], + "title": "america\/montserrat" + }, + { + "type": "string", + "enum": [ + "america\/nassau" + ], + "title": "america\/nassau" + }, + { + "type": "string", + "enum": [ + "america\/new_york" + ], + "title": "america\/new_york" + }, + { + "type": "string", + "enum": [ + "america\/nome" + ], + "title": "america\/nome" + }, + { + "type": "string", + "enum": [ + "america\/noronha" + ], + "title": "america\/noronha" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/beulah" + ], + "title": "america\/north_dakota\/beulah" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/center" + ], + "title": "america\/north_dakota\/center" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/new_salem" + ], + "title": "america\/north_dakota\/new_salem" + }, + { + "type": "string", + "enum": [ + "america\/nuuk" + ], + "title": "america\/nuuk" + }, + { + "type": "string", + "enum": [ + "america\/ojinaga" + ], + "title": "america\/ojinaga" + }, + { + "type": "string", + "enum": [ + "america\/panama" + ], + "title": "america\/panama" + }, + { + "type": "string", + "enum": [ + "america\/paramaribo" + ], + "title": "america\/paramaribo" + }, + { + "type": "string", + "enum": [ + "america\/phoenix" + ], + "title": "america\/phoenix" + }, + { + "type": "string", + "enum": [ + "america\/port-au-prince" + ], + "title": "america\/port-au-prince" + }, + { + "type": "string", + "enum": [ + "america\/port_of_spain" + ], + "title": "america\/port_of_spain" + }, + { + "type": "string", + "enum": [ + "america\/porto_velho" + ], + "title": "america\/porto_velho" + }, + { + "type": "string", + "enum": [ + "america\/puerto_rico" + ], + "title": "america\/puerto_rico" + }, + { + "type": "string", + "enum": [ + "america\/punta_arenas" + ], + "title": "america\/punta_arenas" + }, + { + "type": "string", + "enum": [ + "america\/rankin_inlet" + ], + "title": "america\/rankin_inlet" + }, + { + "type": "string", + "enum": [ + "america\/recife" + ], + "title": "america\/recife" + }, + { + "type": "string", + "enum": [ + "america\/regina" + ], + "title": "america\/regina" + }, + { + "type": "string", + "enum": [ + "america\/resolute" + ], + "title": "america\/resolute" + }, + { + "type": "string", + "enum": [ + "america\/rio_branco" + ], + "title": "america\/rio_branco" + }, + { + "type": "string", + "enum": [ + "america\/santarem" + ], + "title": "america\/santarem" + }, + { + "type": "string", + "enum": [ + "america\/santiago" + ], + "title": "america\/santiago" + }, + { + "type": "string", + "enum": [ + "america\/santo_domingo" + ], + "title": "america\/santo_domingo" + }, + { + "type": "string", + "enum": [ + "america\/sao_paulo" + ], + "title": "america\/sao_paulo" + }, + { + "type": "string", + "enum": [ + "america\/scoresbysund" + ], + "title": "america\/scoresbysund" + }, + { + "type": "string", + "enum": [ + "america\/sitka" + ], + "title": "america\/sitka" + }, + { + "type": "string", + "enum": [ + "america\/st_barthelemy" + ], + "title": "america\/st_barthelemy" + }, + { + "type": "string", + "enum": [ + "america\/st_johns" + ], + "title": "america\/st_johns" + }, + { + "type": "string", + "enum": [ + "america\/st_kitts" + ], + "title": "america\/st_kitts" + }, + { + "type": "string", + "enum": [ + "america\/st_lucia" + ], + "title": "america\/st_lucia" + }, + { + "type": "string", + "enum": [ + "america\/st_thomas" + ], + "title": "america\/st_thomas" + }, + { + "type": "string", + "enum": [ + "america\/st_vincent" + ], + "title": "america\/st_vincent" + }, + { + "type": "string", + "enum": [ + "america\/swift_current" + ], + "title": "america\/swift_current" + }, + { + "type": "string", + "enum": [ + "america\/tegucigalpa" + ], + "title": "america\/tegucigalpa" + }, + { + "type": "string", + "enum": [ + "america\/thule" + ], + "title": "america\/thule" + }, + { + "type": "string", + "enum": [ + "america\/tijuana" + ], + "title": "america\/tijuana" + }, + { + "type": "string", + "enum": [ + "america\/toronto" + ], + "title": "america\/toronto" + }, + { + "type": "string", + "enum": [ + "america\/tortola" + ], + "title": "america\/tortola" + }, + { + "type": "string", + "enum": [ + "america\/vancouver" + ], + "title": "america\/vancouver" + }, + { + "type": "string", + "enum": [ + "america\/whitehorse" + ], + "title": "america\/whitehorse" + }, + { + "type": "string", + "enum": [ + "america\/winnipeg" + ], + "title": "america\/winnipeg" + }, + { + "type": "string", + "enum": [ + "america\/yakutat" + ], + "title": "america\/yakutat" + }, + { + "type": "string", + "enum": [ + "antarctica\/casey" + ], + "title": "antarctica\/casey" + }, + { + "type": "string", + "enum": [ + "antarctica\/davis" + ], + "title": "antarctica\/davis" + }, + { + "type": "string", + "enum": [ + "antarctica\/dumontdurville" + ], + "title": "antarctica\/dumontdurville" + }, + { + "type": "string", + "enum": [ + "antarctica\/macquarie" + ], + "title": "antarctica\/macquarie" + }, + { + "type": "string", + "enum": [ + "antarctica\/mawson" + ], + "title": "antarctica\/mawson" + }, + { + "type": "string", + "enum": [ + "antarctica\/mcmurdo" + ], + "title": "antarctica\/mcmurdo" + }, + { + "type": "string", + "enum": [ + "antarctica\/palmer" + ], + "title": "antarctica\/palmer" + }, + { + "type": "string", + "enum": [ + "antarctica\/rothera" + ], + "title": "antarctica\/rothera" + }, + { + "type": "string", + "enum": [ + "antarctica\/syowa" + ], + "title": "antarctica\/syowa" + }, + { + "type": "string", + "enum": [ + "antarctica\/troll" + ], + "title": "antarctica\/troll" + }, + { + "type": "string", + "enum": [ + "antarctica\/vostok" + ], + "title": "antarctica\/vostok" + }, + { + "type": "string", + "enum": [ + "arctic\/longyearbyen" + ], + "title": "arctic\/longyearbyen" + }, + { + "type": "string", + "enum": [ + "asia\/aden" + ], + "title": "asia\/aden" + }, + { + "type": "string", + "enum": [ + "asia\/almaty" + ], + "title": "asia\/almaty" + }, + { + "type": "string", + "enum": [ + "asia\/amman" + ], + "title": "asia\/amman" + }, + { + "type": "string", + "enum": [ + "asia\/anadyr" + ], + "title": "asia\/anadyr" + }, + { + "type": "string", + "enum": [ + "asia\/aqtau" + ], + "title": "asia\/aqtau" + }, + { + "type": "string", + "enum": [ + "asia\/aqtobe" + ], + "title": "asia\/aqtobe" + }, + { + "type": "string", + "enum": [ + "asia\/ashgabat" + ], + "title": "asia\/ashgabat" + }, + { + "type": "string", + "enum": [ + "asia\/atyrau" + ], + "title": "asia\/atyrau" + }, + { + "type": "string", + "enum": [ + "asia\/baghdad" + ], + "title": "asia\/baghdad" + }, + { + "type": "string", + "enum": [ + "asia\/bahrain" + ], + "title": "asia\/bahrain" + }, + { + "type": "string", + "enum": [ + "asia\/baku" + ], + "title": "asia\/baku" + }, + { + "type": "string", + "enum": [ + "asia\/bangkok" + ], + "title": "asia\/bangkok" + }, + { + "type": "string", + "enum": [ + "asia\/barnaul" + ], + "title": "asia\/barnaul" + }, + { + "type": "string", + "enum": [ + "asia\/beirut" + ], + "title": "asia\/beirut" + }, + { + "type": "string", + "enum": [ + "asia\/bishkek" + ], + "title": "asia\/bishkek" + }, + { + "type": "string", + "enum": [ + "asia\/brunei" + ], + "title": "asia\/brunei" + }, + { + "type": "string", + "enum": [ + "asia\/chita" + ], + "title": "asia\/chita" + }, + { + "type": "string", + "enum": [ + "asia\/colombo" + ], + "title": "asia\/colombo" + }, + { + "type": "string", + "enum": [ + "asia\/damascus" + ], + "title": "asia\/damascus" + }, + { + "type": "string", + "enum": [ + "asia\/dhaka" + ], + "title": "asia\/dhaka" + }, + { + "type": "string", + "enum": [ + "asia\/dili" + ], + "title": "asia\/dili" + }, + { + "type": "string", + "enum": [ + "asia\/dubai" + ], + "title": "asia\/dubai" + }, + { + "type": "string", + "enum": [ + "asia\/dushanbe" + ], + "title": "asia\/dushanbe" + }, + { + "type": "string", + "enum": [ + "asia\/famagusta" + ], + "title": "asia\/famagusta" + }, + { + "type": "string", + "enum": [ + "asia\/gaza" + ], + "title": "asia\/gaza" + }, + { + "type": "string", + "enum": [ + "asia\/hebron" + ], + "title": "asia\/hebron" + }, + { + "type": "string", + "enum": [ + "asia\/ho_chi_minh" + ], + "title": "asia\/ho_chi_minh" + }, + { + "type": "string", + "enum": [ + "asia\/hong_kong" + ], + "title": "asia\/hong_kong" + }, + { + "type": "string", + "enum": [ + "asia\/hovd" + ], + "title": "asia\/hovd" + }, + { + "type": "string", + "enum": [ + "asia\/irkutsk" + ], + "title": "asia\/irkutsk" + }, + { + "type": "string", + "enum": [ + "asia\/jakarta" + ], + "title": "asia\/jakarta" + }, + { + "type": "string", + "enum": [ + "asia\/jayapura" + ], + "title": "asia\/jayapura" + }, + { + "type": "string", + "enum": [ + "asia\/jerusalem" + ], + "title": "asia\/jerusalem" + }, + { + "type": "string", + "enum": [ + "asia\/kabul" + ], + "title": "asia\/kabul" + }, + { + "type": "string", + "enum": [ + "asia\/kamchatka" + ], + "title": "asia\/kamchatka" + }, + { + "type": "string", + "enum": [ + "asia\/karachi" + ], + "title": "asia\/karachi" + }, + { + "type": "string", + "enum": [ + "asia\/kathmandu" + ], + "title": "asia\/kathmandu" + }, + { + "type": "string", + "enum": [ + "asia\/khandyga" + ], + "title": "asia\/khandyga" + }, + { + "type": "string", + "enum": [ + "asia\/kolkata" + ], + "title": "asia\/kolkata" + }, + { + "type": "string", + "enum": [ + "asia\/krasnoyarsk" + ], + "title": "asia\/krasnoyarsk" + }, + { + "type": "string", + "enum": [ + "asia\/kuala_lumpur" + ], + "title": "asia\/kuala_lumpur" + }, + { + "type": "string", + "enum": [ + "asia\/kuching" + ], + "title": "asia\/kuching" + }, + { + "type": "string", + "enum": [ + "asia\/kuwait" + ], + "title": "asia\/kuwait" + }, + { + "type": "string", + "enum": [ + "asia\/macau" + ], + "title": "asia\/macau" + }, + { + "type": "string", + "enum": [ + "asia\/magadan" + ], + "title": "asia\/magadan" + }, + { + "type": "string", + "enum": [ + "asia\/makassar" + ], + "title": "asia\/makassar" + }, + { + "type": "string", + "enum": [ + "asia\/manila" + ], + "title": "asia\/manila" + }, + { + "type": "string", + "enum": [ + "asia\/muscat" + ], + "title": "asia\/muscat" + }, + { + "type": "string", + "enum": [ + "asia\/nicosia" + ], + "title": "asia\/nicosia" + }, + { + "type": "string", + "enum": [ + "asia\/novokuznetsk" + ], + "title": "asia\/novokuznetsk" + }, + { + "type": "string", + "enum": [ + "asia\/novosibirsk" + ], + "title": "asia\/novosibirsk" + }, + { + "type": "string", + "enum": [ + "asia\/omsk" + ], + "title": "asia\/omsk" + }, + { + "type": "string", + "enum": [ + "asia\/oral" + ], + "title": "asia\/oral" + }, + { + "type": "string", + "enum": [ + "asia\/phnom_penh" + ], + "title": "asia\/phnom_penh" + }, + { + "type": "string", + "enum": [ + "asia\/pontianak" + ], + "title": "asia\/pontianak" + }, + { + "type": "string", + "enum": [ + "asia\/pyongyang" + ], + "title": "asia\/pyongyang" + }, + { + "type": "string", + "enum": [ + "asia\/qatar" + ], + "title": "asia\/qatar" + }, + { + "type": "string", + "enum": [ + "asia\/qostanay" + ], + "title": "asia\/qostanay" + }, + { + "type": "string", + "enum": [ + "asia\/qyzylorda" + ], + "title": "asia\/qyzylorda" + }, + { + "type": "string", + "enum": [ + "asia\/riyadh" + ], + "title": "asia\/riyadh" + }, + { + "type": "string", + "enum": [ + "asia\/sakhalin" + ], + "title": "asia\/sakhalin" + }, + { + "type": "string", + "enum": [ + "asia\/samarkand" + ], + "title": "asia\/samarkand" + }, + { + "type": "string", + "enum": [ + "asia\/seoul" + ], + "title": "asia\/seoul" + }, + { + "type": "string", + "enum": [ + "asia\/shanghai" + ], + "title": "asia\/shanghai" + }, + { + "type": "string", + "enum": [ + "asia\/singapore" + ], + "title": "asia\/singapore" + }, + { + "type": "string", + "enum": [ + "asia\/srednekolymsk" + ], + "title": "asia\/srednekolymsk" + }, + { + "type": "string", + "enum": [ + "asia\/taipei" + ], + "title": "asia\/taipei" + }, + { + "type": "string", + "enum": [ + "asia\/tashkent" + ], + "title": "asia\/tashkent" + }, + { + "type": "string", + "enum": [ + "asia\/tbilisi" + ], + "title": "asia\/tbilisi" + }, + { + "type": "string", + "enum": [ + "asia\/tehran" + ], + "title": "asia\/tehran" + }, + { + "type": "string", + "enum": [ + "asia\/thimphu" + ], + "title": "asia\/thimphu" + }, + { + "type": "string", + "enum": [ + "asia\/tokyo" + ], + "title": "asia\/tokyo" + }, + { + "type": "string", + "enum": [ + "asia\/tomsk" + ], + "title": "asia\/tomsk" + }, + { + "type": "string", + "enum": [ + "asia\/ulaanbaatar" + ], + "title": "asia\/ulaanbaatar" + }, + { + "type": "string", + "enum": [ + "asia\/urumqi" + ], + "title": "asia\/urumqi" + }, + { + "type": "string", + "enum": [ + "asia\/ust-nera" + ], + "title": "asia\/ust-nera" + }, + { + "type": "string", + "enum": [ + "asia\/vientiane" + ], + "title": "asia\/vientiane" + }, + { + "type": "string", + "enum": [ + "asia\/vladivostok" + ], + "title": "asia\/vladivostok" + }, + { + "type": "string", + "enum": [ + "asia\/yakutsk" + ], + "title": "asia\/yakutsk" + }, + { + "type": "string", + "enum": [ + "asia\/yangon" + ], + "title": "asia\/yangon" + }, + { + "type": "string", + "enum": [ + "asia\/yekaterinburg" + ], + "title": "asia\/yekaterinburg" + }, + { + "type": "string", + "enum": [ + "asia\/yerevan" + ], + "title": "asia\/yerevan" + }, + { + "type": "string", + "enum": [ + "atlantic\/azores" + ], + "title": "atlantic\/azores" + }, + { + "type": "string", + "enum": [ + "atlantic\/bermuda" + ], + "title": "atlantic\/bermuda" + }, + { + "type": "string", + "enum": [ + "atlantic\/canary" + ], + "title": "atlantic\/canary" + }, + { + "type": "string", + "enum": [ + "atlantic\/cape_verde" + ], + "title": "atlantic\/cape_verde" + }, + { + "type": "string", + "enum": [ + "atlantic\/faroe" + ], + "title": "atlantic\/faroe" + }, + { + "type": "string", + "enum": [ + "atlantic\/madeira" + ], + "title": "atlantic\/madeira" + }, + { + "type": "string", + "enum": [ + "atlantic\/reykjavik" + ], + "title": "atlantic\/reykjavik" + }, + { + "type": "string", + "enum": [ + "atlantic\/south_georgia" + ], + "title": "atlantic\/south_georgia" + }, + { + "type": "string", + "enum": [ + "atlantic\/st_helena" + ], + "title": "atlantic\/st_helena" + }, + { + "type": "string", + "enum": [ + "atlantic\/stanley" + ], + "title": "atlantic\/stanley" + }, + { + "type": "string", + "enum": [ + "australia\/adelaide" + ], + "title": "australia\/adelaide" + }, + { + "type": "string", + "enum": [ + "australia\/brisbane" + ], + "title": "australia\/brisbane" + }, + { + "type": "string", + "enum": [ + "australia\/broken_hill" + ], + "title": "australia\/broken_hill" + }, + { + "type": "string", + "enum": [ + "australia\/darwin" + ], + "title": "australia\/darwin" + }, + { + "type": "string", + "enum": [ + "australia\/eucla" + ], + "title": "australia\/eucla" + }, + { + "type": "string", + "enum": [ + "australia\/hobart" + ], + "title": "australia\/hobart" + }, + { + "type": "string", + "enum": [ + "australia\/lindeman" + ], + "title": "australia\/lindeman" + }, + { + "type": "string", + "enum": [ + "australia\/lord_howe" + ], + "title": "australia\/lord_howe" + }, + { + "type": "string", + "enum": [ + "australia\/melbourne" + ], + "title": "australia\/melbourne" + }, + { + "type": "string", + "enum": [ + "australia\/perth" + ], + "title": "australia\/perth" + }, + { + "type": "string", + "enum": [ + "australia\/sydney" + ], + "title": "australia\/sydney" + }, + { + "type": "string", + "enum": [ + "europe\/amsterdam" + ], + "title": "europe\/amsterdam" + }, + { + "type": "string", + "enum": [ + "europe\/andorra" + ], + "title": "europe\/andorra" + }, + { + "type": "string", + "enum": [ + "europe\/astrakhan" + ], + "title": "europe\/astrakhan" + }, + { + "type": "string", + "enum": [ + "europe\/athens" + ], + "title": "europe\/athens" + }, + { + "type": "string", + "enum": [ + "europe\/belgrade" + ], + "title": "europe\/belgrade" + }, + { + "type": "string", + "enum": [ + "europe\/berlin" + ], + "title": "europe\/berlin" + }, + { + "type": "string", + "enum": [ + "europe\/bratislava" + ], + "title": "europe\/bratislava" + }, + { + "type": "string", + "enum": [ + "europe\/brussels" + ], + "title": "europe\/brussels" + }, + { + "type": "string", + "enum": [ + "europe\/bucharest" + ], + "title": "europe\/bucharest" + }, + { + "type": "string", + "enum": [ + "europe\/budapest" + ], + "title": "europe\/budapest" + }, + { + "type": "string", + "enum": [ + "europe\/busingen" + ], + "title": "europe\/busingen" + }, + { + "type": "string", + "enum": [ + "europe\/chisinau" + ], + "title": "europe\/chisinau" + }, + { + "type": "string", + "enum": [ + "europe\/copenhagen" + ], + "title": "europe\/copenhagen" + }, + { + "type": "string", + "enum": [ + "europe\/dublin" + ], + "title": "europe\/dublin" + }, + { + "type": "string", + "enum": [ + "europe\/gibraltar" + ], + "title": "europe\/gibraltar" + }, + { + "type": "string", + "enum": [ + "europe\/guernsey" + ], + "title": "europe\/guernsey" + }, + { + "type": "string", + "enum": [ + "europe\/helsinki" + ], + "title": "europe\/helsinki" + }, + { + "type": "string", + "enum": [ + "europe\/isle_of_man" + ], + "title": "europe\/isle_of_man" + }, + { + "type": "string", + "enum": [ + "europe\/istanbul" + ], + "title": "europe\/istanbul" + }, + { + "type": "string", + "enum": [ + "europe\/jersey" + ], + "title": "europe\/jersey" + }, + { + "type": "string", + "enum": [ + "europe\/kaliningrad" + ], + "title": "europe\/kaliningrad" + }, + { + "type": "string", + "enum": [ + "europe\/kirov" + ], + "title": "europe\/kirov" + }, + { + "type": "string", + "enum": [ + "europe\/kyiv" + ], + "title": "europe\/kyiv" + }, + { + "type": "string", + "enum": [ + "europe\/lisbon" + ], + "title": "europe\/lisbon" + }, + { + "type": "string", + "enum": [ + "europe\/ljubljana" + ], + "title": "europe\/ljubljana" + }, + { + "type": "string", + "enum": [ + "europe\/london" + ], + "title": "europe\/london" + }, + { + "type": "string", + "enum": [ + "europe\/luxembourg" + ], + "title": "europe\/luxembourg" + }, + { + "type": "string", + "enum": [ + "europe\/madrid" + ], + "title": "europe\/madrid" + }, + { + "type": "string", + "enum": [ + "europe\/malta" + ], + "title": "europe\/malta" + }, + { + "type": "string", + "enum": [ + "europe\/mariehamn" + ], + "title": "europe\/mariehamn" + }, + { + "type": "string", + "enum": [ + "europe\/minsk" + ], + "title": "europe\/minsk" + }, + { + "type": "string", + "enum": [ + "europe\/monaco" + ], + "title": "europe\/monaco" + }, + { + "type": "string", + "enum": [ + "europe\/moscow" + ], + "title": "europe\/moscow" + }, + { + "type": "string", + "enum": [ + "europe\/oslo" + ], + "title": "europe\/oslo" + }, + { + "type": "string", + "enum": [ + "europe\/paris" + ], + "title": "europe\/paris" + }, + { + "type": "string", + "enum": [ + "europe\/podgorica" + ], + "title": "europe\/podgorica" + }, + { + "type": "string", + "enum": [ + "europe\/prague" + ], + "title": "europe\/prague" + }, + { + "type": "string", + "enum": [ + "europe\/riga" + ], + "title": "europe\/riga" + }, + { + "type": "string", + "enum": [ + "europe\/rome" + ], + "title": "europe\/rome" + }, + { + "type": "string", + "enum": [ + "europe\/samara" + ], + "title": "europe\/samara" + }, + { + "type": "string", + "enum": [ + "europe\/san_marino" + ], + "title": "europe\/san_marino" + }, + { + "type": "string", + "enum": [ + "europe\/sarajevo" + ], + "title": "europe\/sarajevo" + }, + { + "type": "string", + "enum": [ + "europe\/saratov" + ], + "title": "europe\/saratov" + }, + { + "type": "string", + "enum": [ + "europe\/simferopol" + ], + "title": "europe\/simferopol" + }, + { + "type": "string", + "enum": [ + "europe\/skopje" + ], + "title": "europe\/skopje" + }, + { + "type": "string", + "enum": [ + "europe\/sofia" + ], + "title": "europe\/sofia" + }, + { + "type": "string", + "enum": [ + "europe\/stockholm" + ], + "title": "europe\/stockholm" + }, + { + "type": "string", + "enum": [ + "europe\/tallinn" + ], + "title": "europe\/tallinn" + }, + { + "type": "string", + "enum": [ + "europe\/tirane" + ], + "title": "europe\/tirane" + }, + { + "type": "string", + "enum": [ + "europe\/ulyanovsk" + ], + "title": "europe\/ulyanovsk" + }, + { + "type": "string", + "enum": [ + "europe\/vaduz" + ], + "title": "europe\/vaduz" + }, + { + "type": "string", + "enum": [ + "europe\/vatican" + ], + "title": "europe\/vatican" + }, + { + "type": "string", + "enum": [ + "europe\/vienna" + ], + "title": "europe\/vienna" + }, + { + "type": "string", + "enum": [ + "europe\/vilnius" + ], + "title": "europe\/vilnius" + }, + { + "type": "string", + "enum": [ + "europe\/volgograd" + ], + "title": "europe\/volgograd" + }, + { + "type": "string", + "enum": [ + "europe\/warsaw" + ], + "title": "europe\/warsaw" + }, + { + "type": "string", + "enum": [ + "europe\/zagreb" + ], + "title": "europe\/zagreb" + }, + { + "type": "string", + "enum": [ + "europe\/zurich" + ], + "title": "europe\/zurich" + }, + { + "type": "string", + "enum": [ + "indian\/antananarivo" + ], + "title": "indian\/antananarivo" + }, + { + "type": "string", + "enum": [ + "indian\/chagos" + ], + "title": "indian\/chagos" + }, + { + "type": "string", + "enum": [ + "indian\/christmas" + ], + "title": "indian\/christmas" + }, + { + "type": "string", + "enum": [ + "indian\/cocos" + ], + "title": "indian\/cocos" + }, + { + "type": "string", + "enum": [ + "indian\/comoro" + ], + "title": "indian\/comoro" + }, + { + "type": "string", + "enum": [ + "indian\/kerguelen" + ], + "title": "indian\/kerguelen" + }, + { + "type": "string", + "enum": [ + "indian\/mahe" + ], + "title": "indian\/mahe" + }, + { + "type": "string", + "enum": [ + "indian\/maldives" + ], + "title": "indian\/maldives" + }, + { + "type": "string", + "enum": [ + "indian\/mauritius" + ], + "title": "indian\/mauritius" + }, + { + "type": "string", + "enum": [ + "indian\/mayotte" + ], + "title": "indian\/mayotte" + }, + { + "type": "string", + "enum": [ + "indian\/reunion" + ], + "title": "indian\/reunion" + }, + { + "type": "string", + "enum": [ + "pacific\/apia" + ], + "title": "pacific\/apia" + }, + { + "type": "string", + "enum": [ + "pacific\/auckland" + ], + "title": "pacific\/auckland" + }, + { + "type": "string", + "enum": [ + "pacific\/bougainville" + ], + "title": "pacific\/bougainville" + }, + { + "type": "string", + "enum": [ + "pacific\/chatham" + ], + "title": "pacific\/chatham" + }, + { + "type": "string", + "enum": [ + "pacific\/chuuk" + ], + "title": "pacific\/chuuk" + }, + { + "type": "string", + "enum": [ + "pacific\/easter" + ], + "title": "pacific\/easter" + }, + { + "type": "string", + "enum": [ + "pacific\/efate" + ], + "title": "pacific\/efate" + }, + { + "type": "string", + "enum": [ + "pacific\/fakaofo" + ], + "title": "pacific\/fakaofo" + }, + { + "type": "string", + "enum": [ + "pacific\/fiji" + ], + "title": "pacific\/fiji" + }, + { + "type": "string", + "enum": [ + "pacific\/funafuti" + ], + "title": "pacific\/funafuti" + }, + { + "type": "string", + "enum": [ + "pacific\/galapagos" + ], + "title": "pacific\/galapagos" + }, + { + "type": "string", + "enum": [ + "pacific\/gambier" + ], + "title": "pacific\/gambier" + }, + { + "type": "string", + "enum": [ + "pacific\/guadalcanal" + ], + "title": "pacific\/guadalcanal" + }, + { + "type": "string", + "enum": [ + "pacific\/guam" + ], + "title": "pacific\/guam" + }, + { + "type": "string", + "enum": [ + "pacific\/honolulu" + ], + "title": "pacific\/honolulu" + }, + { + "type": "string", + "enum": [ + "pacific\/kanton" + ], + "title": "pacific\/kanton" + }, + { + "type": "string", + "enum": [ + "pacific\/kiritimati" + ], + "title": "pacific\/kiritimati" + }, + { + "type": "string", + "enum": [ + "pacific\/kosrae" + ], + "title": "pacific\/kosrae" + }, + { + "type": "string", + "enum": [ + "pacific\/kwajalein" + ], + "title": "pacific\/kwajalein" + }, + { + "type": "string", + "enum": [ + "pacific\/majuro" + ], + "title": "pacific\/majuro" + }, + { + "type": "string", + "enum": [ + "pacific\/marquesas" + ], + "title": "pacific\/marquesas" + }, + { + "type": "string", + "enum": [ + "pacific\/midway" + ], + "title": "pacific\/midway" + }, + { + "type": "string", + "enum": [ + "pacific\/nauru" + ], + "title": "pacific\/nauru" + }, + { + "type": "string", + "enum": [ + "pacific\/niue" + ], + "title": "pacific\/niue" + }, + { + "type": "string", + "enum": [ + "pacific\/norfolk" + ], + "title": "pacific\/norfolk" + }, + { + "type": "string", + "enum": [ + "pacific\/noumea" + ], + "title": "pacific\/noumea" + }, + { + "type": "string", + "enum": [ + "pacific\/pago_pago" + ], + "title": "pacific\/pago_pago" + }, + { + "type": "string", + "enum": [ + "pacific\/palau" + ], + "title": "pacific\/palau" + }, + { + "type": "string", + "enum": [ + "pacific\/pitcairn" + ], + "title": "pacific\/pitcairn" + }, + { + "type": "string", + "enum": [ + "pacific\/pohnpei" + ], + "title": "pacific\/pohnpei" + }, + { + "type": "string", + "enum": [ + "pacific\/port_moresby" + ], + "title": "pacific\/port_moresby" + }, + { + "type": "string", + "enum": [ + "pacific\/rarotonga" + ], + "title": "pacific\/rarotonga" + }, + { + "type": "string", + "enum": [ + "pacific\/saipan" + ], + "title": "pacific\/saipan" + }, + { + "type": "string", + "enum": [ + "pacific\/tahiti" + ], + "title": "pacific\/tahiti" + }, + { + "type": "string", + "enum": [ + "pacific\/tarawa" + ], + "title": "pacific\/tarawa" + }, + { + "type": "string", + "enum": [ + "pacific\/tongatapu" + ], + "title": "pacific\/tongatapu" + }, + { + "type": "string", + "enum": [ + "pacific\/wake" + ], + "title": "pacific\/wake" + }, + { + "type": "string", + "enum": [ + "pacific\/wallis" + ], + "title": "pacific\/wallis" + }, + { + "type": "string", + "enum": [ + "utc" + ], + "title": "utc" + } + ], + "default": "" + }, + "in": "query" + }, + { + "name": "latitude", + "description": "Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 37.7749, + "default": 0 + }, + "in": "query" + }, + { + "name": "longitude", + "description": "Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": -122.4194, + "default": 0 + }, + "in": "query" + }, + { + "name": "accuracy", + "description": "Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 100, + "default": 0 + }, + "in": "query" + }, + { + "name": "touch", + "description": "Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": true, + "default": false + }, + "in": "query" + }, + { + "name": "permissions", + "description": "Browser permissions to grant. Pass an array of permission names like [\"geolocation\", \"camera\", \"microphone\"]. Defaults to empty.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "BrowserPermission", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "geolocation" + ], + "title": "geolocation" + }, + { + "type": "string", + "enum": [ + "camera" + ], + "title": "camera" + }, + { + "type": "string", + "enum": [ + "microphone" + ], + "title": "microphone" + }, + { + "type": "string", + "enum": [ + "notifications" + ], + "title": "notifications" + }, + { + "type": "string", + "enum": [ + "midi" + ], + "title": "midi" + }, + { + "type": "string", + "enum": [ + "push" + ], + "title": "push" + }, + { + "type": "string", + "enum": [ + "clipboard-read" + ], + "title": "clipboard-read" + }, + { + "type": "string", + "enum": [ + "clipboard-write" + ], + "title": "clipboard-write" + }, + { + "type": "string", + "enum": [ + "payment-handler" + ], + "title": "payment-handler" + }, + { + "type": "string", + "enum": [ + "usb" + ], + "title": "usb" + }, + { + "type": "string", + "enum": [ + "bluetooth" + ], + "title": "bluetooth" + }, + { + "type": "string", + "enum": [ + "accelerometer" + ], + "title": "accelerometer" + }, + { + "type": "string", + "enum": [ + "gyroscope" + ], + "title": "gyroscope" + }, + { + "type": "string", + "enum": [ + "magnetometer" + ], + "title": "magnetometer" + }, + { + "type": "string", + "enum": [ + "ambient-light-sensor" + ], + "title": "ambient-light-sensor" + }, + { + "type": "string", + "enum": [ + "background-sync" + ], + "title": "background-sync" + }, + { + "type": "string", + "enum": [ + "persistent-storage" + ], + "title": "persistent-storage" + }, + { + "type": "string", + "enum": [ + "screen-wake-lock" + ], + "title": "screen-wake-lock" + }, + { + "type": "string", + "enum": [ + "web-share" + ], + "title": "web-share" + }, + { + "type": "string", + "enum": [ + "xr-spatial-tracking" + ], + "title": "xr-spatial-tracking" + } + ] + }, + "example": [ + "geolocation", + "notifications" + ], + "default": [] + }, + "in": "query" + }, + { + "name": "sleep", + "description": "Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 3, + "default": 0 + }, + "in": "query" + }, + { + "name": "width", + "description": "Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 800, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 600, + "default": 0 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 85, + "default": -1 + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "example": "jpeg", + "title": "ImageFormat", + "oneOf": [ + { + "type": "string", + "enum": [ + "jpg" + ], + "title": "jpg" + }, + { + "type": "string", + "enum": [ + "jpeg" + ], + "title": "jpeg" + }, + { + "type": "string", + "enum": [ + "png" + ], + "title": "png" + }, + { + "type": "string", + "enum": [ + "webp" + ], + "title": "webp" + }, + { + "type": "string", + "enum": [ + "heic" + ], + "title": "heic" + }, + { + "type": "string", + "enum": [ + "avif" + ], + "title": "avif" + }, + { + "type": "string", + "enum": [ + "gif" + ], + "title": "gif" + } + ], + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/console\/assistant": { + "post": { + "summary": "Create assistant query", + "operationId": "assistantChat", + "tags": [ + "assistant" + ], + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", + "responses": { + "200": { + "description": "Text", + "content": { + "text\/plain": { + "schema": { + "type": "string" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "console", + "demo": "assistant\/chat.md", + "rate-limit": 15, + "rate-time": 3600, + "rate-key": "userId:{userId}", + "scope": "assistant.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "description": "Prompt. A string containing questions asked to the AI assistant.", + "type": "string", + "example": "<PROMPT>" + } + }, + "required": [ + "prompt" + ] + } + } + } + } + } + }, + "\/console\/oauth2-providers": { + "get": { + "summary": "List OAuth2 providers", + "operationId": "consoleListOAuth2Providers", + "tags": [ + "console" + ], + "description": "List all OAuth2 providers supported by the Appwrite server, along with the parameters required to configure each provider. The response excludes mock providers but includes sandbox providers.", + "responses": { + "200": { + "description": "Console OAuth2 Providers List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/consoleOAuth2ProviderList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "console", + "demo": "console\/list-o-auth-2-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/console\/resources": { + "get": { + "summary": "Check resource ID availability", + "operationId": "consoleGetResource", + "tags": [ + "console" + ], + "description": "Check if a resource ID is available.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "console\/get-resource.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "value", + "description": "Resource value.", + "required": true, + "schema": { + "type": "string", + "example": "<VALUE>" + }, + "in": "query" + }, + { + "name": "type", + "description": "Resource type.", + "required": true, + "schema": { + "type": "string", + "example": "rules", + "title": "ConsoleResourceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "rules" + ], + "title": "rules" + } + ] + }, + "in": "query" + } + ] + } + }, + "\/console\/scopes\/organization": { + "get": { + "summary": "List organization scopes", + "operationId": "consoleListOrganizationScopes", + "tags": [ + "console" + ], + "description": "List all scopes available for organization API keys, along with a description for each scope.", + "responses": { + "200": { + "description": "Console Key Scopes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/consoleKeyScopeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "console", + "demo": "console\/list-organization-scopes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/console\/scopes\/project": { + "get": { + "summary": "List project scopes", + "operationId": "consoleListProjectScopes", + "tags": [ + "console" + ], + "description": "List all scopes available for project API keys, along with a description for each scope.", + "responses": { + "200": { + "description": "Console Key Scopes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/consoleKeyScopeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "console", + "demo": "console\/list-project-scopes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/console\/templates\/email\/{templateId}": { + "get": { + "summary": "Get email template", + "operationId": "consoleGetEmailTemplate", + "tags": [ + "console" + ], + "description": "Get the Appwrite built-in default email template for the specified type and locale. Always returns the unmodified default, ignoring any custom project overrides.", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "console\/get-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession", + "required": true, + "schema": { + "type": "string", + "example": "verification", + "title": "ProjectEmailTemplateId", + "oneOf": [ + { + "type": "string", + "enum": [ + "verification" + ], + "title": "verification" + }, + { + "type": "string", + "enum": [ + "magicSession" + ], + "title": "magicSession" + }, + { + "type": "string", + "enum": [ + "recovery" + ], + "title": "recovery" + }, + { + "type": "string", + "enum": [ + "invitation" + ], + "title": "invitation" + }, + { + "type": "string", + "enum": [ + "mfaChallenge" + ], + "title": "mfaChallenge" + }, + { + "type": "string", + "enum": [ + "sessionAlert" + ], + "title": "sessionAlert" + }, + { + "type": "string", + "enum": [ + "otpSession" + ], + "title": "otpSession" + } + ] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale. If left empty, the fallback locale (en) will be used.", + "required": false, + "schema": { + "type": "string", + "example": "af", + "title": "ProjectEmailTemplateLocale", + "oneOf": [ + { + "type": "string", + "enum": [ + "af" + ], + "title": "af" + }, + { + "type": "string", + "enum": [ + "ar-ae" + ], + "title": "ar-ae" + }, + { + "type": "string", + "enum": [ + "ar-bh" + ], + "title": "ar-bh" + }, + { + "type": "string", + "enum": [ + "ar-dz" + ], + "title": "ar-dz" + }, + { + "type": "string", + "enum": [ + "ar-eg" + ], + "title": "ar-eg" + }, + { + "type": "string", + "enum": [ + "ar-iq" + ], + "title": "ar-iq" + }, + { + "type": "string", + "enum": [ + "ar-jo" + ], + "title": "ar-jo" + }, + { + "type": "string", + "enum": [ + "ar-kw" + ], + "title": "ar-kw" + }, + { + "type": "string", + "enum": [ + "ar-lb" + ], + "title": "ar-lb" + }, + { + "type": "string", + "enum": [ + "ar-ly" + ], + "title": "ar-ly" + }, + { + "type": "string", + "enum": [ + "ar-ma" + ], + "title": "ar-ma" + }, + { + "type": "string", + "enum": [ + "ar-om" + ], + "title": "ar-om" + }, + { + "type": "string", + "enum": [ + "ar-qa" + ], + "title": "ar-qa" + }, + { + "type": "string", + "enum": [ + "ar-sa" + ], + "title": "ar-sa" + }, + { + "type": "string", + "enum": [ + "ar-sy" + ], + "title": "ar-sy" + }, + { + "type": "string", + "enum": [ + "ar-tn" + ], + "title": "ar-tn" + }, + { + "type": "string", + "enum": [ + "ar-ye" + ], + "title": "ar-ye" + }, + { + "type": "string", + "enum": [ + "as" + ], + "title": "as" + }, + { + "type": "string", + "enum": [ + "az" + ], + "title": "az" + }, + { + "type": "string", + "enum": [ + "be" + ], + "title": "be" + }, + { + "type": "string", + "enum": [ + "bg" + ], + "title": "bg" + }, + { + "type": "string", + "enum": [ + "bh" + ], + "title": "bh" + }, + { + "type": "string", + "enum": [ + "bn" + ], + "title": "bn" + }, + { + "type": "string", + "enum": [ + "bs" + ], + "title": "bs" + }, + { + "type": "string", + "enum": [ + "ca" + ], + "title": "ca" + }, + { + "type": "string", + "enum": [ + "cs" + ], + "title": "cs" + }, + { + "type": "string", + "enum": [ + "cy" + ], + "title": "cy" + }, + { + "type": "string", + "enum": [ + "da" + ], + "title": "da" + }, + { + "type": "string", + "enum": [ + "de" + ], + "title": "de" + }, + { + "type": "string", + "enum": [ + "de-at" + ], + "title": "de-at" + }, + { + "type": "string", + "enum": [ + "de-ch" + ], + "title": "de-ch" + }, + { + "type": "string", + "enum": [ + "de-li" + ], + "title": "de-li" + }, + { + "type": "string", + "enum": [ + "de-lu" + ], + "title": "de-lu" + }, + { + "type": "string", + "enum": [ + "el" + ], + "title": "el" + }, + { + "type": "string", + "enum": [ + "en" + ], + "title": "en" + }, + { + "type": "string", + "enum": [ + "en-au" + ], + "title": "en-au" + }, + { + "type": "string", + "enum": [ + "en-bz" + ], + "title": "en-bz" + }, + { + "type": "string", + "enum": [ + "en-ca" + ], + "title": "en-ca" + }, + { + "type": "string", + "enum": [ + "en-gb" + ], + "title": "en-gb" + }, + { + "type": "string", + "enum": [ + "en-ie" + ], + "title": "en-ie" + }, + { + "type": "string", + "enum": [ + "en-jm" + ], + "title": "en-jm" + }, + { + "type": "string", + "enum": [ + "en-nz" + ], + "title": "en-nz" + }, + { + "type": "string", + "enum": [ + "en-tt" + ], + "title": "en-tt" + }, + { + "type": "string", + "enum": [ + "en-us" + ], + "title": "en-us" + }, + { + "type": "string", + "enum": [ + "en-za" + ], + "title": "en-za" + }, + { + "type": "string", + "enum": [ + "eo" + ], + "title": "eo" + }, + { + "type": "string", + "enum": [ + "es" + ], + "title": "es" + }, + { + "type": "string", + "enum": [ + "es-ar" + ], + "title": "es-ar" + }, + { + "type": "string", + "enum": [ + "es-bo" + ], + "title": "es-bo" + }, + { + "type": "string", + "enum": [ + "es-cl" + ], + "title": "es-cl" + }, + { + "type": "string", + "enum": [ + "es-co" + ], + "title": "es-co" + }, + { + "type": "string", + "enum": [ + "es-cr" + ], + "title": "es-cr" + }, + { + "type": "string", + "enum": [ + "es-do" + ], + "title": "es-do" + }, + { + "type": "string", + "enum": [ + "es-ec" + ], + "title": "es-ec" + }, + { + "type": "string", + "enum": [ + "es-gt" + ], + "title": "es-gt" + }, + { + "type": "string", + "enum": [ + "es-hn" + ], + "title": "es-hn" + }, + { + "type": "string", + "enum": [ + "es-mx" + ], + "title": "es-mx" + }, + { + "type": "string", + "enum": [ + "es-ni" + ], + "title": "es-ni" + }, + { + "type": "string", + "enum": [ + "es-pa" + ], + "title": "es-pa" + }, + { + "type": "string", + "enum": [ + "es-pe" + ], + "title": "es-pe" + }, + { + "type": "string", + "enum": [ + "es-pr" + ], + "title": "es-pr" + }, + { + "type": "string", + "enum": [ + "es-py" + ], + "title": "es-py" + }, + { + "type": "string", + "enum": [ + "es-sv" + ], + "title": "es-sv" + }, + { + "type": "string", + "enum": [ + "es-uy" + ], + "title": "es-uy" + }, + { + "type": "string", + "enum": [ + "es-ve" + ], + "title": "es-ve" + }, + { + "type": "string", + "enum": [ + "et" + ], + "title": "et" + }, + { + "type": "string", + "enum": [ + "eu" + ], + "title": "eu" + }, + { + "type": "string", + "enum": [ + "fa" + ], + "title": "fa" + }, + { + "type": "string", + "enum": [ + "fi" + ], + "title": "fi" + }, + { + "type": "string", + "enum": [ + "fo" + ], + "title": "fo" + }, + { + "type": "string", + "enum": [ + "fr" + ], + "title": "fr" + }, + { + "type": "string", + "enum": [ + "fr-be" + ], + "title": "fr-be" + }, + { + "type": "string", + "enum": [ + "fr-ca" + ], + "title": "fr-ca" + }, + { + "type": "string", + "enum": [ + "fr-ch" + ], + "title": "fr-ch" + }, + { + "type": "string", + "enum": [ + "fr-lu" + ], + "title": "fr-lu" + }, + { + "type": "string", + "enum": [ + "ga" + ], + "title": "ga" + }, + { + "type": "string", + "enum": [ + "gd" + ], + "title": "gd" + }, + { + "type": "string", + "enum": [ + "he" + ], + "title": "he" + }, + { + "type": "string", + "enum": [ + "hi" + ], + "title": "hi" + }, + { + "type": "string", + "enum": [ + "hr" + ], + "title": "hr" + }, + { + "type": "string", + "enum": [ + "hu" + ], + "title": "hu" + }, + { + "type": "string", + "enum": [ + "id" + ], + "title": "id" + }, + { + "type": "string", + "enum": [ + "is" + ], + "title": "is" + }, + { + "type": "string", + "enum": [ + "it" + ], + "title": "it" + }, + { + "type": "string", + "enum": [ + "it-ch" + ], + "title": "it-ch" + }, + { + "type": "string", + "enum": [ + "ja" + ], + "title": "ja" + }, + { + "type": "string", + "enum": [ + "ji" + ], + "title": "ji" + }, + { + "type": "string", + "enum": [ + "ko" + ], + "title": "ko" + }, + { + "type": "string", + "enum": [ + "ku" + ], + "title": "ku" + }, + { + "type": "string", + "enum": [ + "lt" + ], + "title": "lt" + }, + { + "type": "string", + "enum": [ + "lv" + ], + "title": "lv" + }, + { + "type": "string", + "enum": [ + "mk" + ], + "title": "mk" + }, + { + "type": "string", + "enum": [ + "ml" + ], + "title": "ml" + }, + { + "type": "string", + "enum": [ + "ms" + ], + "title": "ms" + }, + { + "type": "string", + "enum": [ + "mt" + ], + "title": "mt" + }, + { + "type": "string", + "enum": [ + "nb" + ], + "title": "nb" + }, + { + "type": "string", + "enum": [ + "ne" + ], + "title": "ne" + }, + { + "type": "string", + "enum": [ + "nl" + ], + "title": "nl" + }, + { + "type": "string", + "enum": [ + "nl-be" + ], + "title": "nl-be" + }, + { + "type": "string", + "enum": [ + "nn" + ], + "title": "nn" + }, + { + "type": "string", + "enum": [ + "no" + ], + "title": "no" + }, + { + "type": "string", + "enum": [ + "pa" + ], + "title": "pa" + }, + { + "type": "string", + "enum": [ + "pl" + ], + "title": "pl" + }, + { + "type": "string", + "enum": [ + "pt" + ], + "title": "pt" + }, + { + "type": "string", + "enum": [ + "pt-br" + ], + "title": "pt-br" + }, + { + "type": "string", + "enum": [ + "rm" + ], + "title": "rm" + }, + { + "type": "string", + "enum": [ + "ro" + ], + "title": "ro" + }, + { + "type": "string", + "enum": [ + "ro-md" + ], + "title": "ro-md" + }, + { + "type": "string", + "enum": [ + "ru" + ], + "title": "ru" + }, + { + "type": "string", + "enum": [ + "ru-md" + ], + "title": "ru-md" + }, + { + "type": "string", + "enum": [ + "sb" + ], + "title": "sb" + }, + { + "type": "string", + "enum": [ + "sk" + ], + "title": "sk" + }, + { + "type": "string", + "enum": [ + "sl" + ], + "title": "sl" + }, + { + "type": "string", + "enum": [ + "sq" + ], + "title": "sq" + }, + { + "type": "string", + "enum": [ + "sr" + ], + "title": "sr" + }, + { + "type": "string", + "enum": [ + "sv" + ], + "title": "sv" + }, + { + "type": "string", + "enum": [ + "sv-fi" + ], + "title": "sv-fi" + }, + { + "type": "string", + "enum": [ + "th" + ], + "title": "th" + }, + { + "type": "string", + "enum": [ + "tn" + ], + "title": "tn" + }, + { + "type": "string", + "enum": [ + "tr" + ], + "title": "tr" + }, + { + "type": "string", + "enum": [ + "ts" + ], + "title": "ts" + }, + { + "type": "string", + "enum": [ + "ua" + ], + "title": "ua" + }, + { + "type": "string", + "enum": [ + "ur" + ], + "title": "ur" + }, + { + "type": "string", + "enum": [ + "ve" + ], + "title": "ve" + }, + { + "type": "string", + "enum": [ + "vi" + ], + "title": "vi" + }, + { + "type": "string", + "enum": [ + "xh" + ], + "title": "xh" + }, + { + "type": "string", + "enum": [ + "zh-cn" + ], + "title": "zh-cn" + }, + { + "type": "string", + "enum": [ + "zh-hk" + ], + "title": "zh-hk" + }, + { + "type": "string", + "enum": [ + "zh-sg" + ], + "title": "zh-sg" + }, + { + "type": "string", + "enum": [ + "zh-tw" + ], + "title": "zh-tw" + }, + { + "type": "string", + "enum": [ + "zu" + ], + "title": "zu" + } + ], + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/console\/variables": { + "get": { + "summary": "Get variables", + "operationId": "consoleVariables", + "tags": [ + "console" + ], + "description": "Get all Environment Variables that are relevant for the console.", + "responses": { + "200": { + "description": "Console Variables", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/consoleVariables" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "console", + "demo": "console\/variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "queries", + "search", + "total" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DATABASE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "databasesListTransactions", + "tags": [ + "databases" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTransactions" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "databasesCreateTransaction", + "tags": [ + "databases" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTransaction" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/databases\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "databasesGetTransaction", + "tags": [ + "databases" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTransaction" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "databasesUpdateTransaction", + "tags": [ + "databases" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTransaction" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "databasesDeleteTransaction", + "tags": [ + "databases" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTransaction" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "databasesCreateOperations", + "tags": [ + "databases" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createOperations" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collectionList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collections", + "operationId": "databasesCreateCollection", + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<COLLECTION_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "attributes": { + "description": "Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "indexes": { + "description": "Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC\/DESC, optional), and lengths (array of integers, optional).", + "type": "array", + "default": [], + "items": { + "type": "object" + } + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "purge": { + "description": "When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/bigint": { + "post": { + "summary": "Create bigint attribute", + "operationId": "databasesCreateBigIntAttribute", + "tags": [ + "databases" + ], + "description": "Create a bigint attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeBigInt", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBigint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-big-int-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBigIntColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 1000000, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/bigint\/{key}": { + "patch": { + "summary": "Update bigint attribute", + "operationId": "databasesUpdateBigIntAttribute", + "tags": [ + "databases" + ], + "description": "Update a bigint attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeBigInt", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBigint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-big-int-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBigIntColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 1000000, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "boolean", + "example": false, + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "boolean", + "example": false, + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update datetime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "elements": { + "description": "Array of enum values.", + "type": "array", + "example": [ + "active", + "inactive" + ], + "items": { + "type": "string" + } + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "active", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "description": "Updated list of enum values.", + "type": "array", + "example": [ + "active", + "inactive" + ], + "items": { + "type": "string" + } + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "active", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "max": { + "description": "Maximum value.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when required.", + "type": "number", + "example": 10.5, + "format": "float", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "max": { + "description": "Maximum value.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when required.", + "type": "number", + "example": 10.5, + "format": "float", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 100, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "integer", + "example": 10, + "format": "int64", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 100, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "integer", + "example": 10, + "format": "int64", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "string", + "example": "192.0.2.0", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "string", + "example": "192.0.2.0", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "type": "array", + "example": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "type": "array", + "example": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/longtext": { + "post": { + "summary": "Create longtext attribute", + "operationId": "databasesCreateLongtextAttribute", + "tags": [ + "databases" + ], + "description": "Create a longtext attribute.\n", + "responses": { + "202": { + "description": "AttributeLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLongtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-longtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLongtextColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/longtext\/{key}": { + "patch": { + "summary": "Update longtext attribute", + "operationId": "databasesUpdateLongtextAttribute", + "tags": [ + "databases" + ], + "description": "Update a longtext attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLongtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-longtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLongtextColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/mediumtext": { + "post": { + "summary": "Create mediumtext attribute", + "operationId": "databasesCreateMediumtextAttribute", + "tags": [ + "databases" + ], + "description": "Create a mediumtext attribute.\n", + "responses": { + "202": { + "description": "AttributeMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeMediumtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-mediumtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createMediumtextColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/mediumtext\/{key}": { + "patch": { + "summary": "Update mediumtext attribute", + "operationId": "databasesUpdateMediumtextAttribute", + "tags": [ + "databases" + ], + "description": "Update a mediumtext attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeMediumtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-mediumtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateMediumtextColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "type": "array", + "example": [ + 1, + 2 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "type": "array", + "example": [ + 1, + 2 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "type": "array", + "example": [ + [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ], + [ + 1, + 2 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "type": "array", + "example": [ + [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ], + [ + 1, + 2 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "description": "Related Collection ID.", + "type": "string", + "example": "<RELATED_COLLECTION_ID>" + }, + "type": { + "description": "Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany.", + "type": "string", + "example": "oneToOne", + "title": "RelationshipType", + "oneOf": [ + { + "type": "string", + "enum": [ + "oneToOne" + ], + "title": "oneToOne" + }, + { + "type": "string", + "enum": [ + "manyToOne" + ], + "title": "manyToOne" + }, + { + "type": "string", + "enum": [ + "manyToMany" + ], + "title": "manyToMany" + }, + { + "type": "string", + "enum": [ + "oneToMany" + ], + "title": "oneToMany" + } + ] + }, + "twoWay": { + "description": "Is Two Way?", + "type": "boolean", + "default": false, + "example": false + }, + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "twoWayKey": { + "description": "Two Way Attribute Key.", + "type": "string", + "example": "<TWO_WAY_KEY>", + "nullable": true + }, + "onDelete": { + "description": "Delete constraint. Possible values are: cascade, restrict, setNull.", + "type": "string", + "default": "restrict", + "example": "cascade", + "title": "RelationMutate", + "oneOf": [ + { + "type": "string", + "enum": [ + "cascade" + ], + "title": "cascade" + }, + { + "type": "string", + "enum": [ + "restrict" + ], + "title": "restrict" + }, + { + "type": "string", + "enum": [ + "setNull" + ], + "title": "setNull" + } + ] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship\/{key}": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "description": "Delete constraint. Possible values are: cascade, restrict, setNull.", + "type": "string", + "example": "cascade", + "title": "RelationMutate", + "oneOf": [ + { + "type": "string", + "enum": [ + "cascade" + ], + "title": "cascade" + }, + { + "type": "string", + "enum": [ + "restrict" + ], + "title": "restrict" + }, + { + "type": "string", + "enum": [ + "setNull" + ], + "title": "setNull" + } + ] + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "size": { + "description": "Attribute size for text attributes, in number of characters.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "size": { + "description": "Maximum size of the string attribute.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/text": { + "post": { + "summary": "Create text attribute", + "operationId": "databasesCreateTextAttribute", + "tags": [ + "databases" + ], + "description": "Create a text attribute.\n", + "responses": { + "202": { + "description": "AttributeText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeText" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-text-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTextColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/text\/{key}": { + "patch": { + "summary": "Update text attribute", + "operationId": "databasesUpdateTextAttribute", + "tags": [ + "databases" + ], + "description": "Update a text attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeText" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-text-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTextColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/varchar": { + "post": { + "summary": "Create varchar attribute", + "operationId": "databasesCreateVarcharAttribute", + "tags": [ + "databases" + ], + "description": "Create a varchar attribute.\n", + "responses": { + "202": { + "description": "AttributeVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeVarchar" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-varchar-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createVarcharColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "size": { + "description": "Attribute size for varchar attributes, in number of characters. Maximum size is 16381.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/varchar\/{key}": { + "patch": { + "summary": "Update varchar attribute", + "operationId": "databasesUpdateVarcharAttribute", + "tags": [ + "databases" + ], + "description": "Update a varchar attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeVarchar" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-varchar-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateVarcharColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "size": { + "description": "Maximum size of the varchar attribute.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/attributeBoolean", + "integer": "#\/components\/schemas\/attributeInteger", + "double": "#\/components\/schemas\/attributeFloat", + "string": "#\/components\/schemas\/attributeString", + "datetime": "#\/components\/schemas\/attributeDatetime", + "relationship": "#\/components\/schemas\/attributeRelationship" + }, + "x-mapping": { + "#\/components\/schemas\/attributeBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/attributeInteger": { + "type": "integer" + }, + "#\/components\/schemas\/attributeFloat": { + "type": "double" + }, + "#\/components\/schemas\/attributeEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/attributeEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/attributeUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/attributeIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/attributeDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/attributeRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/attributeString": { + "type": "string" + } + } + } + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + }, + "put": { + "summary": "Upsert documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "description": "Array of document data as JSON objects. May contain partial documents.", + "type": "array", + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-appwrite": { + "idGenerator": "ID.unique" + }, + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "indexes", + "demo": "databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "indexes", + "demo": "databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Index Key.", + "type": "string", + "example": "<KEY>" + }, + "type": { + "description": "Index type.", + "type": "string", + "example": "key", + "title": "DatabasesIndexType", + "oneOf": [ + { + "type": "string", + "enum": [ + "key" + ], + "title": "key" + }, + { + "type": "string", + "enum": [ + "fulltext" + ], + "title": "fulltext" + }, + { + "type": "string", + "enum": [ + "unique" + ], + "title": "unique" + }, + { + "type": "string", + "enum": [ + "spatial" + ], + "title": "spatial" + } + ] + }, + "attributes": { + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "orders": { + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "type": "array", + "default": [], + "items": { + "title": "OrderBy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ] + } + }, + "lengths": { + "description": "Length of index. Maximum of 100", + "type": "array", + "default": [], + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "tags": [ + "databases" + ], + "description": "Get an index by its unique ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "indexes", + "demo": "databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "indexes", + "demo": "databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb": { + "get": { + "summary": "List databases", + "operationId": "documentsDBList", + "tags": [ + "documentsDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "documentsDBCreate", + "tags": [ + "documentsDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DATABASE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/documentsdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "documentsDBListTransactions", + "tags": [ + "documentsDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "documentsDBCreateTransaction", + "tags": [ + "documentsDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/documentsdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "documentsDBGetTransaction", + "tags": [ + "documentsDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "documentsDBUpdateTransaction", + "tags": [ + "documentsDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "documentsDBDeleteTransaction", + "tags": [ + "documentsDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "documentsDBGet", + "tags": [ + "documentsDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "documentsDBUpdate", + "tags": [ + "documentsDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "documentsDBDelete", + "tags": [ + "documentsDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "documentsDBListCollections", + "tags": [ + "documentsDB" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collectionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collection", + "operationId": "documentsDBCreateCollection", + "tags": [ + "documentsDB" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<COLLECTION_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "attributes": { + "description": "Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "indexes": { + "description": "Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC\/DESC, optional), and lengths (array of integers, optional).", + "type": "array", + "default": [], + "items": { + "type": "object" + } + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "documentsDBGetCollection", + "tags": [ + "documentsDB" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "documentsDBUpdateCollection", + "tags": [ + "documentsDB" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "purge": { + "description": "When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "documentsDBDeleteCollection", + "tags": [ + "documentsDB" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "documentsDBListDocuments", + "tags": [ + "documentsDB" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "documentsDBCreateDocument", + "tags": [ + "documentsDB" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createDocument", + "namespace": "documentsDB", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/create-document.md", + "public": true + }, + { + "name": "createDocuments", + "namespace": "documentsDB", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/create-documents.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + }, + "put": { + "summary": "Upsert documents", + "operationId": "documentsDBUpsertDocuments", + "tags": [ + "documentsDB" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "documentsDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.\n", + "demo": "documentsdb\/upsert-documents.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "description": "Array of document data as JSON objects. May contain partial documents.", + "type": "array", + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "documentsDBUpdateDocuments", + "tags": [ + "documentsDB" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "documentsDBDeleteDocuments", + "tags": [ + "documentsDB" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "documentsDBGetDocument", + "tags": [ + "documentsDB" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "documentsDBUpsertDocument", + "tags": [ + "documentsDB" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocument", + "namespace": "documentsDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/upsert-document.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required fields of the document to be created or updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "documentsDBUpdateDocument", + "tags": [ + "documentsDB" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only fields and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "documentsDBDeleteDocument", + "tags": [ + "documentsDB" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "documentsDBDecrementDocumentAttribute", + "tags": [ + "documentsDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to decrement the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float" + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "documentsDBIncrementDocumentAttribute", + "tags": [ + "documentsDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float" + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "documentsDBListIndexes", + "tags": [ + "documentsDB" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "documentsdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.indexes.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "documentsDBCreateIndex", + "tags": [ + "documentsDB" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "documentsdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.indexes.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Index Key.", + "type": "string", + "example": "<KEY>" + }, + "type": { + "description": "Index type.", + "type": "string", + "example": "key", + "title": "DocumentsDBIndexType", + "oneOf": [ + { + "type": "string", + "enum": [ + "key" + ], + "title": "key" + }, + { + "type": "string", + "enum": [ + "fulltext" + ], + "title": "fulltext" + }, + { + "type": "string", + "enum": [ + "unique" + ], + "title": "unique" + } + ] + }, + "attributes": { + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "orders": { + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "type": "array", + "default": [], + "items": { + "title": "OrderBy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ] + } + }, + "lengths": { + "description": "Length of index. Maximum of 100", + "type": "array", + "default": [], + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "documentsDBGetIndex", + "tags": [ + "documentsDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "documentsdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.indexes.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "documentsDBDeleteIndex", + "tags": [ + "documentsDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "documentsdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.indexes.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/embeddings\/text": { + "post": { + "summary": "Create text embeddings", + "operationId": "embeddingsCreateTextEmbeddings", + "tags": [ + "embeddings" + ], + "description": "Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections.\n", + "responses": { + "200": { + "description": "Embedding list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/embeddingList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "embeddings", + "demo": "embeddings\/create-text-embeddings.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "embeddings.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createTextEmbeddings", + "namespace": "embeddings", + "desc": "Create Text Embedding", + "auth": { + "Project": [] + }, + "parameters": [ + "texts", + "model" + ], + "required": [ + "texts" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/embeddingList" + } + ], + "description": "Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections.\n", + "demo": "embeddings\/create-text-embeddings.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "texts": { + "description": "Array of text to generate embeddings.", + "type": "array", + "items": { + "type": "string" + } + }, + "model": { + "description": "The embedding model to use for generating vector embeddings.", + "type": "string", + "default": "nomic-embed-text", + "example": "nomic-embed-text", + "title": "EmbeddingModel", + "oneOf": [ + { + "type": "string", + "enum": [ + "nomic-embed-text" + ], + "title": "nomic-embed-text" + }, + { + "type": "string", + "enum": [ + "all-minilm" + ], + "title": "all-minilm" + } + ] + } + }, + "required": [ + "texts" + ] + } + } + } + } + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/functionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "functionId": { + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<FUNCTION_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Function name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "runtime": { + "description": "Execution runtime.", + "type": "string", + "example": "node-14.5", + "title": "Runtime", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "execute": { + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "type": "array", + "default": [], + "example": [ + "any" + ], + "items": { + "type": "string" + } + }, + "events": { + "description": "Events list. Maximum of 100 events are allowed.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "schedule": { + "description": "Schedule CRON syntax.", + "type": "string", + "default": "", + "example": "0 0 * * *" + }, + "timeout": { + "description": "Function maximum execution time in seconds.", + "type": "integer", + "default": 15, + "example": 1, + "format": "int32" + }, + "enabled": { + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "logging": { + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "type": "boolean", + "default": true, + "example": false + }, + "entrypoint": { + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "type": "string", + "default": "", + "example": "<ENTRYPOINT>" + }, + "commands": { + "description": "Build Commands.", + "type": "string", + "default": "", + "example": "<COMMANDS>" + }, + "scopes": { + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 200 scopes are allowed.", + "type": "array", + "default": [], + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "installationId": { + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "type": "string", + "default": "", + "example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "description": "Repository ID of the repo linked to the function.", + "type": "string", + "default": "", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "description": "Production branch for the repo linked to the function.", + "type": "string", + "default": "", + "example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "type": "boolean", + "default": false, + "example": false + }, + "providerRootDirectory": { + "description": "Path to function code in the linked repo.", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "providerBranches": { + "description": "List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "providerPaths": { + "description": "List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "buildSpecification": { + "description": "Build specification for the function deployments.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "runtimeSpecification": { + "description": "Runtime specification for the function executions.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "deploymentRetention": { + "description": "Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + } + } + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/runtimeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "runtimes", + "demo": "functions\/list-runtimes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "runtimes", + "demo": "functions\/list-specifications.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes.", + "required": false, + "schema": { + "type": "string", + "example": "runtimes", + "default": "runtimes" + }, + "in": "query" + } + ] + } + }, + "\/functions\/templates": { + "get": { + "summary": "List templates", + "operationId": "functionsListTemplates", + "tags": [ + "functions" + ], + "description": "List available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Function Templates List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateFunctionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "functions\/list-templates.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "runtimes", + "description": "List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "Runtime", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "default": [] + }, + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "FunctionTemplateUseCase", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "starter" + ], + "title": "starter" + }, + { + "type": "string", + "enum": [ + "databases" + ], + "title": "databases" + }, + { + "type": "string", + "enum": [ + "ai" + ], + "title": "ai" + }, + { + "type": "string", + "enum": [ + "messaging" + ], + "title": "messaging" + }, + { + "type": "string", + "enum": [ + "utilities" + ], + "title": "utilities" + }, + { + "type": "string", + "enum": [ + "dev-tools" + ], + "title": "dev-tools" + }, + { + "type": "string", + "enum": [ + "auth" + ], + "title": "auth" + } + ] + }, + "default": [] + }, + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1, + "default": 25 + }, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/functions\/templates\/{templateId}": { + "get": { + "summary": "Get function template", + "operationId": "functionsGetTemplate", + "tags": [ + "functions" + ], + "description": "Get a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Template Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateFunction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "functions\/get-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEMPLATE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Function name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "runtime": { + "description": "Execution runtime.", + "type": "string", + "default": "", + "example": "node-14.5", + "title": "Runtime", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "execute": { + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "type": "array", + "default": [], + "example": [ + "any" + ], + "items": { + "type": "string" + } + }, + "events": { + "description": "Events list. Maximum of 100 events are allowed.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "schedule": { + "description": "Schedule CRON syntax.", + "type": "string", + "default": "", + "example": "0 0 * * *" + }, + "timeout": { + "description": "Maximum execution time in seconds.", + "type": "integer", + "default": 15, + "example": 1, + "format": "int32" + }, + "enabled": { + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "logging": { + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "type": "boolean", + "default": true, + "example": false + }, + "entrypoint": { + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "type": "string", + "default": "", + "example": "<ENTRYPOINT>" + }, + "commands": { + "description": "Build Commands.", + "type": "string", + "default": "", + "example": "<COMMANDS>" + }, + "scopes": { + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed.", + "type": "array", + "default": [], + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "installationId": { + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "type": "string", + "default": "", + "example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "description": "Repository ID of the repo linked to the function", + "type": "string", + "example": "<PROVIDER_REPOSITORY_ID>", + "nullable": true + }, + "providerBranch": { + "description": "Production branch for the repo linked to the function", + "type": "string", + "default": "", + "example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "type": "boolean", + "default": false, + "example": false + }, + "providerRootDirectory": { + "description": "Path to function code in the linked repo.", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "providerBranches": { + "description": "List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "providerPaths": { + "description": "List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "buildSpecification": { + "description": "Build specification for the function deployments.", + "type": "string", + "example": "s-1vcpu-512mb", + "nullable": true + }, + "runtimeSpecification": { + "description": "Runtime specification for the function executions.", + "type": "string", + "example": "s-1vcpu-512mb", + "nullable": true + }, + "deploymentRetention": { + "description": "Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/update-function-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "description": "Deployment ID.", + "type": "string", + "example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/list-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/create-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": true, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "entrypoint": { + "description": "Entrypoint File.", + "type": "string", + "example": "<ENTRYPOINT>", + "nullable": true + }, + "commands": { + "description": "Build Commands.", + "type": "string", + "example": "<COMMANDS>", + "nullable": true + }, + "code": { + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "type": "string", + "format": "binary" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/create-duplicate-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "description": "Deployment ID.", + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "buildId": { + "description": "Build unique ID.", + "type": "string", + "default": "", + "example": "<BUILD_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/products\/functions\/templates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/create-template-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "description": "Repository name of the template.", + "type": "string", + "example": "<REPOSITORY>" + }, + "owner": { + "description": "The name of the owner of the template.", + "type": "string", + "example": "<OWNER>" + }, + "rootDirectory": { + "description": "Path to function code in the template repo.", + "type": "string", + "example": "<ROOT_DIRECTORY>" + }, + "type": { + "description": "Type for the reference provided. Can be commit, branch, or tag", + "type": "string", + "example": "commit", + "title": "TemplateReferenceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "commit" + ], + "title": "commit" + }, + { + "type": "string", + "enum": [ + "branch" + ], + "title": "branch" + }, + { + "type": "string", + "enum": [ + "tag" + ], + "title": "tag" + } + ] + }, + "reference": { + "description": "Reference value, can be a commit hash, branch name, or release tag", + "type": "string", + "example": "<REFERENCE>" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "type", + "reference" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/create-vcs-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "description": "Type of reference passed. Allowed values are: branch, commit", + "type": "string", + "example": "branch", + "title": "VCSReferenceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "branch" + ], + "title": "branch" + }, + { + "type": "string", + "enum": [ + "commit" + ], + "title": "commit" + } + ] + }, + "reference": { + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "type": "string", + "example": "<REFERENCE>" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/get-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/delete-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "tags": [ + "functions" + ], + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/get-deployment-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "public", + "functions.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "example": "source", + "title": "DeploymentDownloadType", + "oneOf": [ + { + "type": "string", + "enum": [ + "source" + ], + "title": "source" + }, + { + "type": "string", + "enum": [ + "output" + ], + "title": "output" + } + ], + "default": "source" + }, + "in": "query" + }, + { + "name": "token", + "description": "Presigned source-download token for accessing this deployment without a session (jobs-service).", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/update-deployment-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/list-executions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.read", + "execution.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/create-execution.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.write", + "execution.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "description": "HTTP body of execution. Default value is empty string.", + "type": "string", + "default": "", + "example": "<BODY>" + }, + "async": { + "description": "Execute code in the background. Default value is false.", + "type": "boolean", + "default": false, + "example": false + }, + "path": { + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "type": "string", + "default": "\/", + "example": "<PATH>" + }, + "method": { + "description": "HTTP method of execution. Default value is POST.", + "type": "string", + "default": "POST", + "example": "GET", + "title": "ExecutionMethod", + "oneOf": [ + { + "type": "string", + "enum": [ + "GET" + ], + "title": "GET" + }, + { + "type": "string", + "enum": [ + "POST" + ], + "title": "POST" + }, + { + "type": "string", + "enum": [ + "PUT" + ], + "title": "PUT" + }, + { + "type": "string", + "enum": [ + "PATCH" + ], + "title": "PATCH" + }, + { + "type": "string", + "enum": [ + "DELETE" + ], + "title": "DELETE" + }, + { + "type": "string", + "enum": [ + "OPTIONS" + ], + "title": "OPTIONS" + }, + { + "type": "string", + "enum": [ + "HEAD" + ], + "title": "HEAD" + } + ] + }, + "headers": { + "description": "HTTP headers of execution. Defaults to empty.", + "type": "object", + "default": [], + "example": {} + }, + "scheduledAt": { + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "type": "string", + "example": "<SCHEDULED_AT>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/get-execution.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.read", + "execution.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/delete-execution.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.write", + "execution.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "variableId": { + "description": "Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<VARIABLE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>" + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>" + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "variableId", + "key", + "value" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>", + "nullable": true + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "graphql", + "demo": "graphql\/query.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "description": "The query or queries to execute.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "query" + ] + } + } + } + } + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "graphql", + "demo": "graphql\/mutation.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "description": "The query or queries to execute.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "query" + ] + } + } + } + } + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/messageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<MESSAGE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "subject": { + "description": "Email Subject.", + "type": "string", + "example": "<SUBJECT>" + }, + "content": { + "description": "Email Content.", + "type": "string", + "example": "<CONTENT>" + }, + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "cc": { + "description": "Array of target IDs to be added as CC.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "bcc": { + "description": "Array of target IDs to be added as BCC.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "attachments": { + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "default": false, + "example": false + }, + "html": { + "description": "Is content of type HTML", + "type": "boolean", + "default": false, + "example": false + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "subject": { + "description": "Email Subject.", + "type": "string", + "example": "<SUBJECT>", + "nullable": true + }, + "content": { + "description": "Email Content.", + "type": "string", + "example": "<CONTENT>", + "nullable": true + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "example": false, + "nullable": true + }, + "html": { + "description": "Is content of type HTML", + "type": "boolean", + "example": false, + "nullable": true + }, + "cc": { + "description": "Array of target IDs to be added as CC.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "bcc": { + "description": "Array of target IDs to be added as BCC.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "attachments": { + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<MESSAGE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "title": { + "description": "Title for push notification.", + "type": "string", + "default": "", + "example": "<TITLE>" + }, + "body": { + "description": "Body for push notification.", + "type": "string", + "default": "", + "example": "<BODY>" + }, + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "data": { + "description": "Additional key-value pair data for push notification.", + "type": "object", + "default": {}, + "example": {}, + "nullable": true + }, + "action": { + "description": "Action for push notification.", + "type": "string", + "default": "", + "example": "<ACTION>" + }, + "image": { + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "type": "string", + "default": "", + "example": "<ID1:ID2>" + }, + "icon": { + "description": "Icon for push notification. Available only for Android and Web Platform.", + "type": "string", + "default": "", + "example": "<ICON>" + }, + "sound": { + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "type": "string", + "default": "", + "example": "<SOUND>" + }, + "color": { + "description": "Color for push notification. Available only for Android Platform.", + "type": "string", + "default": "", + "example": "<COLOR>" + }, + "tag": { + "description": "Tag for push notification. Available only for Android Platform.", + "type": "string", + "default": "", + "example": "<TAG>" + }, + "badge": { + "description": "Badge for push notification. Available only for iOS Platform.", + "type": "integer", + "default": -1, + "example": 1, + "format": "int32" + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "default": false, + "example": false + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "contentAvailable": { + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "type": "boolean", + "default": false, + "example": false + }, + "critical": { + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "type": "boolean", + "default": false, + "example": false + }, + "priority": { + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "type": "string", + "default": "high", + "example": "normal", + "title": "MessagePriority", + "oneOf": [ + { + "type": "string", + "enum": [ + "normal" + ], + "title": "normal" + }, + { + "type": "string", + "enum": [ + "high" + ], + "title": "high" + } + ] + } + }, + "required": [ + "messageId" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "title": { + "description": "Title for push notification.", + "type": "string", + "example": "<TITLE>", + "nullable": true + }, + "body": { + "description": "Body for push notification.", + "type": "string", + "example": "<BODY>", + "nullable": true + }, + "data": { + "description": "Additional Data for push notification.", + "type": "object", + "default": {}, + "example": {}, + "nullable": true + }, + "action": { + "description": "Action for push notification.", + "type": "string", + "example": "<ACTION>", + "nullable": true + }, + "image": { + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "type": "string", + "example": "<ID1:ID2>", + "nullable": true + }, + "icon": { + "description": "Icon for push notification. Available only for Android and Web platforms.", + "type": "string", + "example": "<ICON>", + "nullable": true + }, + "sound": { + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "type": "string", + "example": "<SOUND>", + "nullable": true + }, + "color": { + "description": "Color for push notification. Available only for Android platforms.", + "type": "string", + "example": "<COLOR>", + "nullable": true + }, + "tag": { + "description": "Tag for push notification. Available only for Android platforms.", + "type": "string", + "example": "<TAG>", + "nullable": true + }, + "badge": { + "description": "Badge for push notification. Available only for iOS platforms.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "example": false, + "nullable": true + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "contentAvailable": { + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "type": "boolean", + "example": false, + "nullable": true + }, + "critical": { + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "type": "boolean", + "example": false, + "nullable": true + }, + "priority": { + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "type": "string", + "example": "normal", + "title": "MessagePriority", + "oneOf": [ + { + "type": "string", + "enum": [ + "normal" + ], + "title": "normal" + }, + { + "type": "string", + "enum": [ + "high" + ], + "title": "high" + } + ], + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<MESSAGE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "content": { + "description": "SMS Content.", + "type": "string", + "example": "<CONTENT>" + }, + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "default": false, + "example": false + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + }, + "required": [ + "messageId", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "content": { + "description": "Email Content.", + "type": "string", + "example": "<CONTENT>", + "nullable": true + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "example": false, + "nullable": true + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/list-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "authKey": { + "description": "APNS authentication key.", + "type": "string", + "default": "", + "example": "<AUTH_KEY>" + }, + "authKeyId": { + "description": "APNS authentication key ID.", + "type": "string", + "default": "", + "example": "<AUTH_KEY_ID>" + }, + "teamId": { + "description": "APNS team ID.", + "type": "string", + "default": "", + "example": "<TEAM_ID>" + }, + "bundleId": { + "description": "APNS bundle ID.", + "type": "string", + "default": "", + "example": "<BUNDLE_ID>" + }, + "sandbox": { + "description": "Use APNS sandbox environment.", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "authKey": { + "description": "APNS authentication key.", + "type": "string", + "default": "", + "example": "<AUTH_KEY>" + }, + "authKeyId": { + "description": "APNS authentication key ID.", + "type": "string", + "default": "", + "example": "<AUTH_KEY_ID>" + }, + "teamId": { + "description": "APNS team ID.", + "type": "string", + "default": "", + "example": "<TEAM_ID>" + }, + "bundleId": { + "description": "APNS bundle ID.", + "type": "string", + "default": "", + "example": "<BUNDLE_ID>" + }, + "sandbox": { + "description": "Use APNS sandbox environment.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "serviceAccountJSON": { + "description": "FCM service account JSON.", + "type": "object", + "default": {}, + "example": {}, + "nullable": true + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "serviceAccountJSON": { + "description": "FCM service account JSON.", + "type": "object", + "default": {}, + "example": {}, + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "apiKey": { + "description": "Mailgun API Key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "domain": { + "description": "Mailgun Domain.", + "type": "string", + "default": "", + "example": "example.com" + }, + "isEuRegion": { + "description": "Set as EU region.", + "type": "boolean", + "example": false, + "nullable": true + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "apiKey": { + "description": "Mailgun API Key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "domain": { + "description": "Mailgun Domain.", + "type": "string", + "default": "", + "example": "example.com" + }, + "isEuRegion": { + "description": "Set as EU region.", + "type": "boolean", + "example": false, + "nullable": true + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-msg-91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "templateId": { + "description": "Msg91 template ID", + "type": "string", + "default": "", + "example": "<TEMPLATE_ID>" + }, + "senderId": { + "description": "Msg91 sender ID.", + "type": "string", + "default": "", + "example": "<SENDER_ID>" + }, + "authKey": { + "description": "Msg91 auth key.", + "type": "string", + "default": "", + "example": "<AUTH_KEY>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-msg-91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "templateId": { + "description": "Msg91 template ID.", + "type": "string", + "default": "", + "example": "<TEMPLATE_ID>" + }, + "senderId": { + "description": "Msg91 sender ID.", + "type": "string", + "default": "", + "example": "<SENDER_ID>" + }, + "authKey": { + "description": "Msg91 auth key.", + "type": "string", + "default": "", + "example": "<AUTH_KEY>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/resend": { + "post": { + "summary": "Create Resend provider", + "operationId": "messagingCreateResendProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Resend provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-resend-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "apiKey": { + "description": "Resend API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/resend\/{providerId}": { + "patch": { + "summary": "Update Resend provider", + "operationId": "messagingUpdateResendProvider", + "tags": [ + "messaging" + ], + "description": "Update a Resend provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-resend-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "apiKey": { + "description": "Resend API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "apiKey": { + "description": "Sendgrid API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "apiKey": { + "description": "Sendgrid API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/ses": { + "post": { + "summary": "Create Amazon SES provider", + "operationId": "messagingCreateSesProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Amazon SES provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-ses-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "accessKey": { + "description": "AWS access key ID.", + "type": "string", + "default": "", + "example": "<ACCESS_KEY>" + }, + "secretKey": { + "description": "AWS secret access key.", + "type": "string", + "default": "", + "example": "<SECRET_KEY>" + }, + "region": { + "description": "AWS region, for example us-east-1.", + "type": "string", + "default": "", + "example": "<REGION>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/ses\/{providerId}": { + "patch": { + "summary": "Update Amazon SES provider", + "operationId": "messagingUpdateSesProvider", + "tags": [ + "messaging" + ], + "description": "Update an Amazon SES provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-ses-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "accessKey": { + "description": "AWS access key ID.", + "type": "string", + "default": "", + "example": "<ACCESS_KEY>" + }, + "secretKey": { + "description": "AWS secret access key.", + "type": "string", + "default": "", + "example": "<SECRET_KEY>" + }, + "region": { + "description": "AWS region, for example us-east-1.", + "type": "string", + "default": "", + "example": "<REGION>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "host": { + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "type": "string", + "example": "<HOST>" + }, + "port": { + "description": "The default SMTP server port.", + "type": "integer", + "default": 587, + "example": 587, + "format": "int32" + }, + "username": { + "description": "Authentication username.", + "type": "string", + "default": "", + "example": "<USERNAME>" + }, + "password": { + "description": "Authentication password.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + }, + "encryption": { + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "type": "string", + "default": "", + "example": "none", + "title": "SmtpEncryption", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "ssl" + ], + "title": "ssl" + }, + { + "type": "string", + "enum": [ + "tls" + ], + "title": "tls" + } + ] + }, + "autoTLS": { + "description": "Enable SMTP AutoTLS feature.", + "type": "boolean", + "default": true, + "example": false + }, + "mailer": { + "description": "The value to use for the X-Mailer header.", + "type": "string", + "default": "", + "example": "<MAILER>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "host": { + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "type": "string", + "default": "", + "example": "<HOST>" + }, + "port": { + "description": "SMTP port.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "username": { + "description": "Authentication username.", + "type": "string", + "default": "", + "example": "<USERNAME>" + }, + "password": { + "description": "Authentication password.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + }, + "encryption": { + "description": "Encryption type. Can be 'ssl' or 'tls'", + "type": "string", + "default": "", + "example": "none", + "title": "SmtpEncryption", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "ssl" + ], + "title": "ssl" + }, + { + "type": "string", + "enum": [ + "tls" + ], + "title": "tls" + } + ] + }, + "autoTLS": { + "description": "Enable SMTP AutoTLS feature.", + "type": "boolean", + "example": false, + "nullable": true + }, + "mailer": { + "description": "The value to use for the X-Mailer header.", + "type": "string", + "default": "", + "example": "<MAILER>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "from": { + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "customerId": { + "description": "Telesign customer ID.", + "type": "string", + "default": "", + "example": "<CUSTOMER_ID>" + }, + "apiKey": { + "description": "Telesign API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "customerId": { + "description": "Telesign customer ID.", + "type": "string", + "default": "", + "example": "<CUSTOMER_ID>" + }, + "apiKey": { + "description": "Telesign API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "from": { + "description": "Sender number.", + "type": "string", + "default": "", + "example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "from": { + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "username": { + "description": "Textmagic username.", + "type": "string", + "default": "", + "example": "<USERNAME>" + }, + "apiKey": { + "description": "Textmagic apiKey.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "username": { + "description": "Textmagic username.", + "type": "string", + "default": "", + "example": "<USERNAME>" + }, + "apiKey": { + "description": "Textmagic apiKey.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "from": { + "description": "Sender number.", + "type": "string", + "default": "", + "example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "from": { + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "accountSid": { + "description": "Twilio account secret ID.", + "type": "string", + "default": "", + "example": "<ACCOUNT_SID>" + }, + "authToken": { + "description": "Twilio authentication token.", + "type": "string", + "default": "", + "example": "<AUTH_TOKEN>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "accountSid": { + "description": "Twilio account secret ID.", + "type": "string", + "default": "", + "example": "<ACCOUNT_SID>" + }, + "authToken": { + "description": "Twilio authentication token.", + "type": "string", + "default": "", + "example": "<AUTH_TOKEN>" + }, + "from": { + "description": "Sender number.", + "type": "string", + "default": "", + "example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "from": { + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "apiKey": { + "description": "Vonage API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "apiSecret": { + "description": "Vonage API secret.", + "type": "string", + "default": "", + "example": "<API_SECRET>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "apiKey": { + "description": "Vonage API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "apiSecret": { + "description": "Vonage API secret.", + "type": "string", + "default": "", + "example": "<API_SECRET>" + }, + "from": { + "description": "Sender number.", + "type": "string", + "default": "", + "example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topicList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topicId": { + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "type": "string", + "example": "<TOPIC_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Topic Name.", + "type": "string", + "example": "<NAME>" + }, + "subscribe": { + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "type": "array", + "default": [ + "users" + ], + "example": [ + "any" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Topic Name.", + "type": "string", + "example": "<NAME>", + "nullable": true + }, + "subscribe": { + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "type": "array", + "example": [ + "any" + ], + "items": { + "type": "string" + }, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriberList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: targetId, topicId, userId, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "type": "string", + "example": "<SUBSCRIBER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "targetId": { + "description": "Target ID. The target ID to link to the specified Topic ID.", + "type": "string", + "example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/migrations": { + "get": { + "summary": "List migrations", + "operationId": "migrationsList", + "tags": [ + "migrations" + ], + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", + "responses": { + "200": { + "description": "Migrations List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "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: status, stage, source, destination, resources, resourceId, resourceInternalId, resourceType, parentResourceId, parentResourceInternalId, parentResourceType, destinationResourceId, destinationResourceInternalId, destinationResourceType, statusCounters, resourceData, errors", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/migrations\/appwrite": { + "post": { + "summary": "Create Appwrite migration", + "operationId": "migrationsCreateAppwriteMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/create-appwrite-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "description": "List of resources to migrate", + "type": "array", + "items": { + "title": "AppwriteMigrationResource", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "user" + ], + "title": "user" + }, + { + "type": "string", + "enum": [ + "team" + ], + "title": "team" + }, + { + "type": "string", + "enum": [ + "membership" + ], + "title": "membership" + }, + { + "type": "string", + "enum": [ + "auth-methods" + ], + "title": "auth-methods" + }, + { + "type": "string", + "enum": [ + "policies" + ], + "title": "policies" + }, + { + "type": "string", + "enum": [ + "oauth2-provider" + ], + "title": "oauth2-provider" + }, + { + "type": "string", + "enum": [ + "database" + ], + "title": "database" + }, + { + "type": "string", + "enum": [ + "table" + ], + "title": "table" + }, + { + "type": "string", + "enum": [ + "column" + ], + "title": "column" + }, + { + "type": "string", + "enum": [ + "index" + ], + "title": "index" + }, + { + "type": "string", + "enum": [ + "row" + ], + "title": "row" + }, + { + "type": "string", + "enum": [ + "document" + ], + "title": "document" + }, + { + "type": "string", + "enum": [ + "attribute" + ], + "title": "attribute" + }, + { + "type": "string", + "enum": [ + "collection" + ], + "title": "collection" + }, + { + "type": "string", + "enum": [ + "documentsdb" + ], + "title": "documentsdb" + }, + { + "type": "string", + "enum": [ + "vectorsdb" + ], + "title": "vectorsdb" + }, + { + "type": "string", + "enum": [ + "bucket" + ], + "title": "bucket" + }, + { + "type": "string", + "enum": [ + "file" + ], + "title": "file" + }, + { + "type": "string", + "enum": [ + "function" + ], + "title": "function" + }, + { + "type": "string", + "enum": [ + "deployment" + ], + "title": "deployment" + }, + { + "type": "string", + "enum": [ + "environment-variable" + ], + "title": "environment-variable" + }, + { + "type": "string", + "enum": [ + "provider" + ], + "title": "provider" + }, + { + "type": "string", + "enum": [ + "topic" + ], + "title": "topic" + }, + { + "type": "string", + "enum": [ + "subscriber" + ], + "title": "subscriber" + }, + { + "type": "string", + "enum": [ + "message" + ], + "title": "message" + }, + { + "type": "string", + "enum": [ + "site" + ], + "title": "site" + }, + { + "type": "string", + "enum": [ + "site-deployment" + ], + "title": "site-deployment" + }, + { + "type": "string", + "enum": [ + "site-variable" + ], + "title": "site-variable" + }, + { + "type": "string", + "enum": [ + "platform" + ], + "title": "platform" + }, + { + "type": "string", + "enum": [ + "api-key" + ], + "title": "api-key" + }, + { + "type": "string", + "enum": [ + "webhook" + ], + "title": "webhook" + }, + { + "type": "string", + "enum": [ + "smtp" + ], + "title": "smtp" + }, + { + "type": "string", + "enum": [ + "backup-policy" + ], + "title": "backup-policy" + }, + { + "type": "string", + "enum": [ + "project-variable" + ], + "title": "project-variable" + }, + { + "type": "string", + "enum": [ + "project-protocols" + ], + "title": "project-protocols" + }, + { + "type": "string", + "enum": [ + "project-labels" + ], + "title": "project-labels" + }, + { + "type": "string", + "enum": [ + "project-services" + ], + "title": "project-services" + }, + { + "type": "string", + "enum": [ + "project-email-template" + ], + "title": "project-email-template" + }, + { + "type": "string", + "enum": [ + "rule" + ], + "title": "rule" + } + ] + } + }, + "endpoint": { + "description": "Source Appwrite endpoint", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + }, + "projectId": { + "description": "Source Project ID", + "type": "string", + "example": "<PROJECT_ID>" + }, + "apiKey": { + "description": "Source API Key", + "type": "string", + "example": "<API_KEY>" + }, + "onDuplicate": { + "description": "Behavior when a row with an existing $id is encountered. \"fail\" (default): abort on first conflict. \"skip\": silently ignore. \"overwrite\": replace existing row.", + "type": "string", + "default": "fail", + "example": "fail", + "title": "OnDuplicate", + "oneOf": [ + { + "type": "string", + "enum": [ + "fail" + ], + "title": "fail" + }, + { + "type": "string", + "enum": [ + "skip" + ], + "title": "skip" + }, + { + "type": "string", + "enum": [ + "overwrite" + ], + "title": "overwrite" + } + ] + } + }, + "required": [ + "resources", + "endpoint", + "projectId", + "apiKey" + ] + } + } + } + } + } + }, + "\/migrations\/appwrite\/report": { + "get": { + "summary": "Get Appwrite migration report", + "operationId": "migrationsGetAppwriteReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/get-appwrite-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "title": "AppwriteMigrationResource", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "user" + ], + "title": "user" + }, + { + "type": "string", + "enum": [ + "team" + ], + "title": "team" + }, + { + "type": "string", + "enum": [ + "membership" + ], + "title": "membership" + }, + { + "type": "string", + "enum": [ + "auth-methods" + ], + "title": "auth-methods" + }, + { + "type": "string", + "enum": [ + "policies" + ], + "title": "policies" + }, + { + "type": "string", + "enum": [ + "oauth2-provider" + ], + "title": "oauth2-provider" + }, + { + "type": "string", + "enum": [ + "database" + ], + "title": "database" + }, + { + "type": "string", + "enum": [ + "table" + ], + "title": "table" + }, + { + "type": "string", + "enum": [ + "column" + ], + "title": "column" + }, + { + "type": "string", + "enum": [ + "index" + ], + "title": "index" + }, + { + "type": "string", + "enum": [ + "row" + ], + "title": "row" + }, + { + "type": "string", + "enum": [ + "document" + ], + "title": "document" + }, + { + "type": "string", + "enum": [ + "attribute" + ], + "title": "attribute" + }, + { + "type": "string", + "enum": [ + "collection" + ], + "title": "collection" + }, + { + "type": "string", + "enum": [ + "documentsdb" + ], + "title": "documentsdb" + }, + { + "type": "string", + "enum": [ + "vectorsdb" + ], + "title": "vectorsdb" + }, + { + "type": "string", + "enum": [ + "bucket" + ], + "title": "bucket" + }, + { + "type": "string", + "enum": [ + "file" + ], + "title": "file" + }, + { + "type": "string", + "enum": [ + "function" + ], + "title": "function" + }, + { + "type": "string", + "enum": [ + "deployment" + ], + "title": "deployment" + }, + { + "type": "string", + "enum": [ + "environment-variable" + ], + "title": "environment-variable" + }, + { + "type": "string", + "enum": [ + "provider" + ], + "title": "provider" + }, + { + "type": "string", + "enum": [ + "topic" + ], + "title": "topic" + }, + { + "type": "string", + "enum": [ + "subscriber" + ], + "title": "subscriber" + }, + { + "type": "string", + "enum": [ + "message" + ], + "title": "message" + }, + { + "type": "string", + "enum": [ + "site" + ], + "title": "site" + }, + { + "type": "string", + "enum": [ + "site-deployment" + ], + "title": "site-deployment" + }, + { + "type": "string", + "enum": [ + "site-variable" + ], + "title": "site-variable" + }, + { + "type": "string", + "enum": [ + "platform" + ], + "title": "platform" + }, + { + "type": "string", + "enum": [ + "api-key" + ], + "title": "api-key" + }, + { + "type": "string", + "enum": [ + "webhook" + ], + "title": "webhook" + }, + { + "type": "string", + "enum": [ + "smtp" + ], + "title": "smtp" + }, + { + "type": "string", + "enum": [ + "backup-policy" + ], + "title": "backup-policy" + }, + { + "type": "string", + "enum": [ + "project-variable" + ], + "title": "project-variable" + }, + { + "type": "string", + "enum": [ + "project-protocols" + ], + "title": "project-protocols" + }, + { + "type": "string", + "enum": [ + "project-labels" + ], + "title": "project-labels" + }, + { + "type": "string", + "enum": [ + "project-services" + ], + "title": "project-services" + }, + { + "type": "string", + "enum": [ + "project-email-template" + ], + "title": "project-email-template" + }, + { + "type": "string", + "enum": [ + "rule" + ], + "title": "rule" + } + ] + } + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Appwrite Endpoint", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "projectID", + "description": "Source's Project ID", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "query" + }, + { + "name": "key", + "description": "Source's API Key", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "query" + } + ] + } + }, + "\/migrations\/csv\/exports": { + "post": { + "summary": "Export documents to CSV", + "operationId": "migrationsCreateCSVExport", + "tags": [ + "migrations" + ], + "description": "Export documents to a CSV file from your Appwrite database. This endpoint allows you to export documents to a CSV file stored in a secure internal bucket. You'll receive an email with a download link when the export is complete.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/create-csv-export.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Database ID containing the source collection.", + "type": "string", + "example": "<DATABASE_ID>" + }, + "collectionId": { + "description": "Collection ID to export documents from.", + "type": "string", + "example": "<COLLECTION_ID>" + }, + "filename": { + "description": "The name of the file to be created for the export, excluding the .csv extension.", + "type": "string", + "example": "<FILENAME>" + }, + "columns": { + "description": "List of attributes to export. If empty, all attributes will be exported. You can use the `*` wildcard to export all attributes from the collection.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK to filter documents to export. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "delimiter": { + "description": "The character that separates each column value. Default is comma.", + "type": "string", + "default": ",", + "example": "<DELIMITER>" + }, + "enclosure": { + "description": "The character that encloses each column value. Default is double quotes.", + "type": "string", + "default": "\"", + "example": "<ENCLOSURE>" + }, + "escape": { + "description": "The escape character for the enclosure character. Default is double quotes.", + "type": "string", + "default": "\"", + "example": "<ESCAPE>" + }, + "header": { + "description": "Whether to include the header row with column names. Default is true.", + "type": "boolean", + "default": true, + "example": false + }, + "notify": { + "description": "Set to true to receive an email when the export is complete. Default is true.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "collectionId", + "filename" + ] + } + } + } + } + } + }, + "\/migrations\/csv\/imports": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCSVImport", + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/create-csv-import.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "type": "string", + "example": "<BUCKET_ID>" + }, + "fileId": { + "description": "File ID.", + "type": "string", + "example": "<FILE_ID>" + }, + "databaseId": { + "description": "Database ID containing the target collection.", + "type": "string", + "example": "<DATABASE_ID>" + }, + "collectionId": { + "description": "Collection ID to import documents into.", + "type": "string", + "example": "<COLLECTION_ID>" + }, + "internalFile": { + "description": "Is the file stored in an internal bucket?", + "type": "boolean", + "default": false, + "example": false + }, + "onDuplicate": { + "description": "Behavior when a row with an existing $id is encountered. \"fail\" (default): abort on first conflict. \"skip\": silently ignore. \"overwrite\": replace existing row.", + "type": "string", + "default": "fail", + "example": "fail", + "title": "OnDuplicate", + "oneOf": [ + { + "type": "string", + "enum": [ + "fail" + ], + "title": "fail" + }, + { + "type": "string", + "enum": [ + "skip" + ], + "title": "skip" + }, + { + "type": "string", + "enum": [ + "overwrite" + ], + "title": "overwrite" + } + ] + } + }, + "required": [ + "bucketId", + "fileId", + "databaseId", + "collectionId" + ] + } + } + } + } + } + }, + "\/migrations\/firebase": { + "post": { + "summary": "Create Firebase migration", + "operationId": "migrationsCreateFirebaseMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/create-firebase-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "description": "List of resources to migrate", + "type": "array", + "items": { + "title": "FirebaseMigrationResource", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "user" + ], + "title": "user" + }, + { + "type": "string", + "enum": [ + "database" + ], + "title": "database" + }, + { + "type": "string", + "enum": [ + "table" + ], + "title": "table" + }, + { + "type": "string", + "enum": [ + "column" + ], + "title": "column" + }, + { + "type": "string", + "enum": [ + "row" + ], + "title": "row" + }, + { + "type": "string", + "enum": [ + "document" + ], + "title": "document" + }, + { + "type": "string", + "enum": [ + "attribute" + ], + "title": "attribute" + }, + { + "type": "string", + "enum": [ + "collection" + ], + "title": "collection" + }, + { + "type": "string", + "enum": [ + "bucket" + ], + "title": "bucket" + }, + { + "type": "string", + "enum": [ + "file" + ], + "title": "file" + } + ] + } + }, + "serviceAccount": { + "description": "JSON of the Firebase service account credentials", + "type": "string", + "example": "<SERVICE_ACCOUNT>" + } + }, + "required": [ + "resources", + "serviceAccount" + ] + } + } + } + } + } + }, + "\/migrations\/firebase\/report": { + "get": { + "summary": "Get Firebase migration report", + "operationId": "migrationsGetFirebaseReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/get-firebase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "title": "FirebaseMigrationResource", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "user" + ], + "title": "user" + }, + { + "type": "string", + "enum": [ + "database" + ], + "title": "database" + }, + { + "type": "string", + "enum": [ + "table" + ], + "title": "table" + }, + { + "type": "string", + "enum": [ + "column" + ], + "title": "column" + }, + { + "type": "string", + "enum": [ + "row" + ], + "title": "row" + }, + { + "type": "string", + "enum": [ + "document" + ], + "title": "document" + }, + { + "type": "string", + "enum": [ + "attribute" + ], + "title": "attribute" + }, + { + "type": "string", + "enum": [ + "collection" + ], + "title": "collection" + }, + { + "type": "string", + "enum": [ + "bucket" + ], + "title": "bucket" + }, + { + "type": "string", + "enum": [ + "file" + ], + "title": "file" + } + ] + } + }, + "in": "query" + }, + { + "name": "serviceAccount", + "description": "JSON of the Firebase service account credentials", + "required": true, + "schema": { + "type": "string", + "example": "<SERVICE_ACCOUNT>" + }, + "in": "query" + } + ] + } + }, + "\/migrations\/json\/exports": { + "post": { + "summary": "Export documents to JSON", + "operationId": "migrationsCreateJSONExport", + "tags": [ + "migrations" + ], + "description": "Export documents to a JSON file from your Appwrite database. This endpoint allows you to export documents to a JSON file stored in a secure internal bucket. You'll receive an email with a download link when the export is complete.\n", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/create-json-export.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Database ID containing the source collection.", + "type": "string", + "example": "<DATABASE_ID>" + }, + "collectionId": { + "description": "Collection ID to export documents from.", + "type": "string", + "example": "<COLLECTION_ID>" + }, + "filename": { + "description": "The name of the file to be created for the export, excluding the .json extension.", + "type": "string", + "example": "<FILENAME>" + }, + "columns": { + "description": "List of attributes to export. If empty, all attributes will be exported. You can use the `*` wildcard to export all attributes from the collection.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK to filter documents to export. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "notify": { + "description": "Set to true to receive an email when the export is complete. Default is true.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "collectionId", + "filename" + ] + } + } + } + } + } + }, + "\/migrations\/json\/imports": { + "post": { + "summary": "Import documents from a JSON", + "operationId": "migrationsCreateJSONImport", + "tags": [ + "migrations" + ], + "description": "Import documents from a JSON file into your Appwrite database. This endpoint allows you to import documents from a JSON file uploaded to Appwrite Storage bucket.\n", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/create-json-import.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "type": "string", + "example": "<BUCKET_ID>" + }, + "fileId": { + "description": "File ID.", + "type": "string", + "example": "<FILE_ID>" + }, + "databaseId": { + "description": "Database ID containing the target collection.", + "type": "string", + "example": "<DATABASE_ID>" + }, + "collectionId": { + "description": "Collection ID to import documents into.", + "type": "string", + "example": "<COLLECTION_ID>" + }, + "internalFile": { + "description": "Is the file stored in an internal bucket?", + "type": "boolean", + "default": false, + "example": false + }, + "onDuplicate": { + "description": "Behavior when a row with an existing $id is encountered. \"fail\" (default): abort on first conflict. \"skip\": silently ignore. \"overwrite\": replace existing row.", + "type": "string", + "default": "fail", + "example": "fail", + "title": "OnDuplicate", + "oneOf": [ + { + "type": "string", + "enum": [ + "fail" + ], + "title": "fail" + }, + { + "type": "string", + "enum": [ + "skip" + ], + "title": "skip" + }, + { + "type": "string", + "enum": [ + "overwrite" + ], + "title": "overwrite" + } + ] + } + }, + "required": [ + "bucketId", + "fileId", + "databaseId", + "collectionId" + ] + } + } + } + } + } + }, + "\/migrations\/nhost": { + "post": { + "summary": "Create NHost migration", + "operationId": "migrationsCreateNHostMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/create-n-host-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "description": "List of resources to migrate", + "type": "array", + "items": { + "title": "NHostMigrationResource", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "user" + ], + "title": "user" + }, + { + "type": "string", + "enum": [ + "database" + ], + "title": "database" + }, + { + "type": "string", + "enum": [ + "table" + ], + "title": "table" + }, + { + "type": "string", + "enum": [ + "column" + ], + "title": "column" + }, + { + "type": "string", + "enum": [ + "index" + ], + "title": "index" + }, + { + "type": "string", + "enum": [ + "row" + ], + "title": "row" + }, + { + "type": "string", + "enum": [ + "document" + ], + "title": "document" + }, + { + "type": "string", + "enum": [ + "attribute" + ], + "title": "attribute" + }, + { + "type": "string", + "enum": [ + "collection" + ], + "title": "collection" + }, + { + "type": "string", + "enum": [ + "bucket" + ], + "title": "bucket" + }, + { + "type": "string", + "enum": [ + "file" + ], + "title": "file" + } + ] + } + }, + "subdomain": { + "description": "Source's Subdomain", + "type": "string", + "example": "<SUBDOMAIN>" + }, + "region": { + "description": "Source's Region", + "type": "string", + "example": "<REGION>" + }, + "adminSecret": { + "description": "Source's Admin Secret", + "type": "string", + "example": "<ADMIN_SECRET>" + }, + "database": { + "description": "Source's Database Name", + "type": "string", + "example": "<DATABASE>" + }, + "username": { + "description": "Source's Database Username", + "type": "string", + "example": "<USERNAME>" + }, + "password": { + "description": "Source's Database Password", + "type": "string", + "example": "password", + "format": "password" + }, + "port": { + "description": "Source's Database Port", + "type": "integer", + "default": 5432, + "example": 5432, + "format": "int32" + } + }, + "required": [ + "resources", + "subdomain", + "region", + "adminSecret", + "database", + "username", + "password" + ] + } + } + } + } + } + }, + "\/migrations\/nhost\/report": { + "get": { + "summary": "Get NHost migration report", + "operationId": "migrationsGetNHostReport", + "tags": [ + "migrations" + ], + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/get-n-host-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate.", + "required": true, + "schema": { + "type": "array", + "items": { + "title": "NHostMigrationResource", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "user" + ], + "title": "user" + }, + { + "type": "string", + "enum": [ + "database" + ], + "title": "database" + }, + { + "type": "string", + "enum": [ + "table" + ], + "title": "table" + }, + { + "type": "string", + "enum": [ + "column" + ], + "title": "column" + }, + { + "type": "string", + "enum": [ + "index" + ], + "title": "index" + }, + { + "type": "string", + "enum": [ + "row" + ], + "title": "row" + }, + { + "type": "string", + "enum": [ + "document" + ], + "title": "document" + }, + { + "type": "string", + "enum": [ + "attribute" + ], + "title": "attribute" + }, + { + "type": "string", + "enum": [ + "collection" + ], + "title": "collection" + }, + { + "type": "string", + "enum": [ + "bucket" + ], + "title": "bucket" + }, + { + "type": "string", + "enum": [ + "file" + ], + "title": "file" + } + ] + } + }, + "in": "query" + }, + { + "name": "subdomain", + "description": "Source's Subdomain.", + "required": true, + "schema": { + "type": "string", + "example": "<SUBDOMAIN>" + }, + "in": "query" + }, + { + "name": "region", + "description": "Source's Region.", + "required": true, + "schema": { + "type": "string", + "example": "<REGION>" + }, + "in": "query" + }, + { + "name": "adminSecret", + "description": "Source's Admin Secret.", + "required": true, + "schema": { + "type": "string", + "example": "<ADMIN_SECRET>" + }, + "in": "query" + }, + { + "name": "database", + "description": "Source's Database Name.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE>" + }, + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "schema": { + "type": "string", + "example": "<USERNAME>" + }, + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "schema": { + "type": "string", + "format": "password", + "example": "password" + }, + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 5432, + "default": 5432 + }, + "in": "query" + } + ] + } + }, + "\/migrations\/supabase": { + "post": { + "summary": "Create Supabase migration", + "operationId": "migrationsCreateSupabaseMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/create-supabase-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "description": "List of resources to migrate", + "type": "array", + "items": { + "title": "SupabaseMigrationResource", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "user" + ], + "title": "user" + }, + { + "type": "string", + "enum": [ + "database" + ], + "title": "database" + }, + { + "type": "string", + "enum": [ + "table" + ], + "title": "table" + }, + { + "type": "string", + "enum": [ + "column" + ], + "title": "column" + }, + { + "type": "string", + "enum": [ + "index" + ], + "title": "index" + }, + { + "type": "string", + "enum": [ + "row" + ], + "title": "row" + }, + { + "type": "string", + "enum": [ + "document" + ], + "title": "document" + }, + { + "type": "string", + "enum": [ + "attribute" + ], + "title": "attribute" + }, + { + "type": "string", + "enum": [ + "collection" + ], + "title": "collection" + }, + { + "type": "string", + "enum": [ + "bucket" + ], + "title": "bucket" + }, + { + "type": "string", + "enum": [ + "file" + ], + "title": "file" + } + ] + } + }, + "endpoint": { + "description": "Source's Supabase Endpoint", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + }, + "apiKey": { + "description": "Source's API Key", + "type": "string", + "example": "<API_KEY>" + }, + "databaseHost": { + "description": "Source's Database Host", + "type": "string", + "example": "<DATABASE_HOST>" + }, + "username": { + "description": "Source's Database Username", + "type": "string", + "example": "<USERNAME>" + }, + "password": { + "description": "Source's Database Password", + "type": "string", + "example": "password", + "format": "password" + }, + "port": { + "description": "Source's Database Port", + "type": "integer", + "default": 5432, + "example": 5432, + "format": "int32" + } + }, + "required": [ + "resources", + "endpoint", + "apiKey", + "databaseHost", + "username", + "password" + ] + } + } + } + } + } + }, + "\/migrations\/supabase\/report": { + "get": { + "summary": "Get Supabase migration report", + "operationId": "migrationsGetSupabaseReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/get-supabase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "title": "SupabaseMigrationResource", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "user" + ], + "title": "user" + }, + { + "type": "string", + "enum": [ + "database" + ], + "title": "database" + }, + { + "type": "string", + "enum": [ + "table" + ], + "title": "table" + }, + { + "type": "string", + "enum": [ + "column" + ], + "title": "column" + }, + { + "type": "string", + "enum": [ + "index" + ], + "title": "index" + }, + { + "type": "string", + "enum": [ + "row" + ], + "title": "row" + }, + { + "type": "string", + "enum": [ + "document" + ], + "title": "document" + }, + { + "type": "string", + "enum": [ + "attribute" + ], + "title": "attribute" + }, + { + "type": "string", + "enum": [ + "collection" + ], + "title": "collection" + }, + { + "type": "string", + "enum": [ + "bucket" + ], + "title": "bucket" + }, + { + "type": "string", + "enum": [ + "file" + ], + "title": "file" + } + ] + } + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Supabase Endpoint.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "apiKey", + "description": "Source's API Key.", + "required": true, + "schema": { + "type": "string", + "example": "<API_KEY>" + }, + "in": "query" + }, + { + "name": "databaseHost", + "description": "Source's Database Host.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_HOST>" + }, + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "schema": { + "type": "string", + "example": "<USERNAME>" + }, + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "schema": { + "type": "string", + "format": "password", + "example": "password" + }, + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 5432, + "default": 5432 + }, + "in": "query" + } + ] + } + }, + "\/migrations\/{migrationId}": { + "get": { + "summary": "Get migration", + "operationId": "migrationsGet", + "tags": [ + "migrations" + ], + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", + "responses": { + "200": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update retry migration", + "operationId": "migrationsRetry", + "tags": [ + "migrations" + ], + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/retry.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete migration", + "operationId": "migrationsDelete", + "tags": [ + "migrations" + ], + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "migrations\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/notifications": { + "get": { + "summary": "List notifications", + "operationId": "notificationsList", + "tags": [ + "notifications" + ], + "description": "Get the list of notifications for the currently logged in console user. Use queries to filter the results by attributes such as read status, view timestamps, or creation date.\n", + "responses": { + "200": { + "description": "Notifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/notificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "notifications\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: read, type, channel, messageId, projectId, resourceType, resourceId, parentResourceType, parentResourceId, firstSeen, lastSeen", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/notifications\/{notificationId}": { + "patch": { + "summary": "Update notification", + "operationId": "notificationsUpdate", + "tags": [ + "notifications" + ], + "description": "Update a notification by its unique ID. Use the `read` parameter to mark the notification as read or unread.\n", + "responses": { + "200": { + "description": "Notification", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/notification" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "notifications\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "notificationId", + "description": "Notification ID.", + "required": true, + "schema": { + "type": "string", + "example": "<NOTIFICATION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "read": { + "description": "Notification read status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "read" + ] + } + } + } + } + } + }, + "\/organization\/projects": { + "get": { + "summary": "List organization projects", + "operationId": "organizationListProjects", + "tags": [ + "organization" + ], + "description": "Get a list of all projects. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Projects List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/projectList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/list-projects.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create organization project", + "operationId": "organizationCreateProject", + "tags": [ + "organization" + ], + "description": "Create a new project.", + "responses": { + "201": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/create-project.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "projectId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROJECT_ID>" + }, + "name": { + "description": "Project name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "region": { + "description": "Project Region.", + "type": "string", + "default": "default", + "example": "default", + "title": "Region", + "oneOf": [ + { + "type": "string", + "enum": [ + "default" + ], + "title": "default" + } + ] + } + }, + "required": [ + "projectId", + "name" + ] + } + } + } + } + } + }, + "\/organization\/projects\/{projectId}": { + "get": { + "summary": "Get organization project", + "operationId": "organizationGetProject", + "tags": [ + "organization" + ], + "description": "Get a project.", + "responses": { + "200": { + "description": "Project", + "content": { + "": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/get-project.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update organization project", + "operationId": "organizationUpdateProject", + "tags": [ + "organization" + ], + "description": "Update a project by its unique ID.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/update-project.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Project name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete organization project", + "operationId": "organizationDeleteProject", + "tags": [ + "organization" + ], + "description": "Delete a project by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/delete-project.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/ping": { + "get": { + "summary": "Test the connection between the Appwrite and the SDK.", + "operationId": "pingGet", + "tags": [ + "ping" + ], + "description": "Send a ping to project as part of onboarding.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "ping\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "global", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [], + "Session": [] + } + ] + } + }, + "\/presences": { + "get": { + "summary": "List presences", + "operationId": "presencesList", + "tags": [ + "presences" + ], + "description": "List presence logs. Expired entries are filtered out automatically.\n", + "responses": { + "200": { + "description": "Presences List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presenceList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/presences\/{presenceId}": { + "get": { + "summary": "Get presence", + "operationId": "presencesGet", + "tags": [ + "presences" + ], + "description": "Get a presence log by its unique ID. Entries whose `expiresAt` is in the past are treated as not found.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Upsert presence", + "operationId": "presencesUpsert", + "tags": [ + "presences" + ], + "description": "Create or update a presence log by its user ID.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/upsert.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "client", + "console" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsert", + "namespace": "presences", + "desc": "Upsert presence", + "auth": { + "Project": [] + }, + "parameters": [ + "presenceId", + "status", + "permissions", + "expiresAt", + "metadata" + ], + "required": [ + "presenceId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/presence" + } + ], + "description": "Create or update a presence log by its user ID.\n", + "demo": "presences\/upsert.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "status": { + "description": "Presence status.", + "type": "string", + "example": "<STATUS>" + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "expiresAt": { + "description": "Presence expiry datetime.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime" + }, + "metadata": { + "description": "Presence metadata object.", + "type": "object", + "default": [], + "example": {} + } + }, + "required": [ + "status" + ] + } + } + } + } + }, + "patch": { + "summary": "Update presence", + "operationId": "presencesUpdate", + "tags": [ + "presences" + ], + "description": "Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "client", + "console" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "update", + "namespace": "presences", + "desc": "Update presence", + "auth": { + "Project": [] + }, + "parameters": [ + "presenceId", + "status", + "expiresAt", + "metadata", + "permissions", + "purge" + ], + "required": [ + "presenceId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/presence" + } + ], + "description": "Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated.\n", + "demo": "presences\/update.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "status": { + "description": "Presence status.", + "type": "string", + "example": "<STATUS>" + }, + "expiresAt": { + "description": "Presence expiry datetime.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime" + }, + "metadata": { + "description": "Presence metadata object.", + "type": "object", + "default": {}, + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "purge": { + "description": "When true, purge cached responses used by list presences endpoint.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete presence", + "operationId": "presencesDelete", + "tags": [ + "presences" + ], + "description": "Delete a presence log by its unique ID.\n", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/project": { + "get": { + "summary": "Get project", + "operationId": "projectGet", + "tags": [ + "project" + ], + "description": "Get a project.", + "responses": { + "200": { + "description": "Project", + "content": { + "": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + }, + "delete": { + "summary": "Delete project", + "operationId": "projectDelete", + "tags": [ + "project" + ], + "description": "Delete a project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/project\/auth-methods\/{methodId}": { + "patch": { + "summary": "Update project auth method status", + "operationId": "projectUpdateAuthMethod", + "tags": [ + "project" + ], + "description": "Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/update-auth-method.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "methodId", + "description": "Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone", + "required": true, + "schema": { + "type": "string", + "example": "email-password", + "title": "ProjectAuthMethodId", + "oneOf": [ + { + "type": "string", + "enum": [ + "email-password" + ], + "title": "email-password" + }, + { + "type": "string", + "enum": [ + "magic-url" + ], + "title": "magic-url" + }, + { + "type": "string", + "enum": [ + "email-otp" + ], + "title": "email-otp" + }, + { + "type": "string", + "enum": [ + "anonymous" + ], + "title": "anonymous" + }, + { + "type": "string", + "enum": [ + "invites" + ], + "title": "invites" + }, + { + "type": "string", + "enum": [ + "jwt" + ], + "title": "jwt" + }, + { + "type": "string", + "enum": [ + "phone" + ], + "title": "phone" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Auth method status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/keys": { + "get": { + "summary": "List project keys", + "operationId": "projectListKeys", + "tags": [ + "project" + ], + "description": "Get a list of all API keys from the current project.", + "responses": { + "200": { + "description": "API Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/keyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/list-keys.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create project key", + "operationId": "projectCreateKey", + "tags": [ + "project" + ], + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.\n\nYou can also create an ephemeral API key if you need a short-lived key instead.", + "responses": { + "201": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/create-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "keyId": { + "description": "Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<KEY_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Key name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "scopes": { + "description": "Key scopes list. Maximum of 200 scopes are allowed.", + "type": "array", + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "expire": { + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + }, + "required": [ + "keyId", + "name", + "scopes" + ] + } + } + } + } + } + }, + "\/project\/keys\/ephemeral": { + "post": { + "summary": "Create ephemeral project key", + "operationId": "projectCreateEphemeralKey", + "tags": [ + "project" + ], + "description": "Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.\n\nYou can also create a standard API key if you need a longer-lived key instead.", + "responses": { + "201": { + "description": "Ephemeral Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/ephemeralKey" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/create-ephemeral-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "scopes": { + "description": "Key scopes list. Maximum of 200 scopes are allowed.", + "type": "array", + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "duration": { + "description": "Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds.", + "type": "integer", + "example": 600, + "format": "int32" + } + }, + "required": [ + "scopes", + "duration" + ] + } + } + } + } + } + }, + "\/project\/keys\/{keyId}": { + "get": { + "summary": "Get project key", + "operationId": "projectGetKey", + "tags": [ + "project" + ], + "description": "Get a key by its unique ID. ", + "responses": { + "200": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/get-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "keyId", + "description": "Key ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update project key", + "operationId": "projectUpdateKey", + "tags": [ + "project" + ], + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.", + "responses": { + "200": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/update-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "keyId", + "description": "Key ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Key name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "scopes": { + "description": "Key scopes list. Maximum of 200 scopes are allowed.", + "type": "array", + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "expire": { + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + }, + "required": [ + "name", + "scopes" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete project key", + "operationId": "projectDeleteKey", + "tags": [ + "project" + ], + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/delete-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "keyId", + "description": "Key ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/project\/labels": { + "put": { + "summary": "Update project labels", + "operationId": "projectUpdateLabels", + "tags": [ + "project" + ], + "description": "Update the project labels. Labels can be used to easily filter projects in an organization.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/update-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "description": "Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, + "\/project\/mock-phones": { + "get": { + "summary": "List project mock phones", + "operationId": "projectListMockPhones", + "tags": [ + "project" + ], + "description": "Get a list of all mock phones in the project. This endpoint returns an array of all mock phones and their OTPs.", + "responses": { + "200": { + "description": "Mock Numbers List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mockNumberList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/list-mock-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create project mock phone", + "operationId": "projectCreateMockPhone", + "tags": [ + "project" + ], + "description": "Create a new mock phone for your project. Use this endpoint to register a mock phone number and its sign-in OTP for your testers.", + "responses": { + "201": { + "description": "Mock Number", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mockNumber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/create-mock-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "description": "Phone number to associate with the mock phone. Must be a valid E.164 formatted phone number.", + "type": "string", + "example": "+12065550100", + "format": "phone" + }, + "otp": { + "description": "One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "number", + "otp" + ] + } + } + } + } + } + }, + "\/project\/mock-phones\/{number}": { + "get": { + "summary": "Get project mock phone", + "operationId": "projectGetMockPhone", + "tags": [ + "project" + ], + "description": "Get a mock phone by its unique number. This endpoint returns the mock phone's OTP.", + "responses": { + "200": { + "description": "Mock Number", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mockNumber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/get-mock-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "number", + "description": "Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.", + "required": true, + "schema": { + "type": "string", + "format": "phone", + "example": "+12065550100" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update project mock phone", + "operationId": "projectUpdateMockPhone", + "tags": [ + "project" + ], + "description": "Update a mock phone by its unique number. Use this endpoint to update the mock phone's OTP.", + "responses": { + "200": { + "description": "Mock Number", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mockNumber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/update-mock-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "number", + "description": "Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.", + "required": true, + "schema": { + "type": "string", + "format": "phone", + "example": "+12065550100" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "description": "One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete project mock phone", + "operationId": "projectDeleteMockPhone", + "tags": [ + "project" + ], + "description": "Delete a mock phone by its unique number. This endpoint removes the mock phone and its OTP configuration from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/delete-mock-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "number", + "description": "Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.", + "required": true, + "schema": { + "type": "string", + "format": "phone", + "example": "+12065550100" + }, + "in": "path" + } + ] + } + }, + "\/project\/oauth2": { + "get": { + "summary": "List project OAuth2 providers", + "operationId": "projectListOAuth2Providers", + "tags": [ + "project" + ], + "description": "Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty.", + "responses": { + "200": { + "description": "OAuth2 Providers List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2ProviderList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/list-o-auth-2-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/project\/oauth2\/amazon": { + "patch": { + "summary": "Update project OAuth2 Amazon", + "operationId": "projectUpdateOAuth2Amazon", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Amazon configuration.", + "responses": { + "200": { + "description": "OAuth2Amazon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Amazon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-amazon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/apple": { + "patch": { + "summary": "Update project OAuth2 Apple", + "operationId": "projectUpdateOAuth2Apple", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Apple configuration.", + "responses": { + "200": { + "description": "OAuth2Apple", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Apple" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-apple.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "serviceId": { + "description": "'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web", + "type": "string", + "example": "<SERVICE_ID>", + "nullable": true + }, + "keyId": { + "description": "'Key ID' of Apple OAuth2 app. For example: P4000000N8", + "type": "string", + "example": "<KEY_ID>", + "nullable": true + }, + "teamId": { + "description": "'Team ID' of Apple OAuth2 app. For example: D4000000R6", + "type": "string", + "example": "<TEAM_ID>", + "nullable": true + }, + "p8File": { + "description": "Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----", + "type": "string", + "example": "<P8_FILE>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/appwrite": { + "patch": { + "summary": "Update project OAuth2 Appwrite", + "operationId": "projectUpdateOAuth2Appwrite", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Appwrite configuration.", + "responses": { + "200": { + "description": "OAuth2Appwrite", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Appwrite" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-appwrite.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/auth0": { + "patch": { + "summary": "Update project OAuth2 Auth0", + "operationId": "projectUpdateOAuth2Auth0", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Auth0 configuration.", + "responses": { + "200": { + "description": "OAuth2Auth0", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Auth0" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-auth-0.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Domain of Auth0 instance. For example: example.us.auth0.com", + "type": "string", + "example": "<ENDPOINT>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/authentik": { + "patch": { + "summary": "Update project OAuth2 Authentik", + "operationId": "projectUpdateOAuth2Authentik", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Authentik configuration.", + "responses": { + "200": { + "description": "OAuth2Authentik", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Authentik" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-authentik.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Domain of Authentik instance. For example: example.authentik.com", + "type": "string", + "example": "<ENDPOINT>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/autodesk": { + "patch": { + "summary": "Update project OAuth2 Autodesk", + "operationId": "projectUpdateOAuth2Autodesk", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Autodesk configuration.", + "responses": { + "200": { + "description": "OAuth2Autodesk", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Autodesk" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-autodesk.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/bitbucket": { + "patch": { + "summary": "Update project OAuth2 Bitbucket", + "operationId": "projectUpdateOAuth2Bitbucket", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Bitbucket configuration.", + "responses": { + "200": { + "description": "OAuth2Bitbucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Bitbucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-bitbucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "secret": { + "description": "'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx", + "type": "string", + "example": "<SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/bitly": { + "patch": { + "summary": "Update project OAuth2 Bitly", + "operationId": "projectUpdateOAuth2Bitly", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Bitly configuration.", + "responses": { + "200": { + "description": "OAuth2Bitly", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Bitly" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-bitly.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/box": { + "patch": { + "summary": "Update project OAuth2 Box", + "operationId": "projectUpdateOAuth2Box", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Box configuration.", + "responses": { + "200": { + "description": "OAuth2Box", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Box" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-box.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/cloudflare": { + "patch": { + "summary": "Update project OAuth2 Cloudflare", + "operationId": "projectUpdateOAuth2Cloudflare", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Cloudflare configuration.", + "responses": { + "200": { + "description": "OAuth2Cloudflare", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Cloudflare" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-cloudflare.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Cloudflare OAuth2 app. For example: 4b866000000000000000000000c9e4e2", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Cloudflare OAuth2 app. For example: cfoc_5Q6YRl0000000000000000000000000000000000003d214f", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/dailymotion": { + "patch": { + "summary": "Update project OAuth2 Dailymotion", + "operationId": "projectUpdateOAuth2Dailymotion", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Dailymotion configuration.", + "responses": { + "200": { + "description": "OAuth2Dailymotion", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Dailymotion" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-dailymotion.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "apiKey": { + "description": "'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f", + "type": "string", + "example": "<API_KEY>", + "nullable": true + }, + "apiSecret": { + "description": "'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639", + "type": "string", + "example": "<API_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/discord": { + "patch": { + "summary": "Update project OAuth2 Discord", + "operationId": "projectUpdateOAuth2Discord", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Discord configuration.", + "responses": { + "200": { + "description": "OAuth2Discord", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Discord" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-discord.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Discord OAuth2 app. For example: 950722000000343754", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/disqus": { + "patch": { + "summary": "Update project OAuth2 Disqus", + "operationId": "projectUpdateOAuth2Disqus", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Disqus configuration.", + "responses": { + "200": { + "description": "OAuth2Disqus", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Disqus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-disqus.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "publicKey": { + "description": "'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX", + "type": "string", + "example": "<PUBLIC_KEY>", + "nullable": true + }, + "secretKey": { + "description": "'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9", + "type": "string", + "example": "<SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/dropbox": { + "patch": { + "summary": "Update project OAuth2 Dropbox", + "operationId": "projectUpdateOAuth2Dropbox", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Dropbox configuration.", + "responses": { + "200": { + "description": "OAuth2Dropbox", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Dropbox" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-dropbox.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "appKey": { + "description": "'App Key' of Dropbox OAuth2 app. For example: jl000000000009t", + "type": "string", + "example": "<APP_KEY>", + "nullable": true + }, + "appSecret": { + "description": "'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw", + "type": "string", + "example": "<APP_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/etsy": { + "patch": { + "summary": "Update project OAuth2 Etsy", + "operationId": "projectUpdateOAuth2Etsy", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Etsy configuration.", + "responses": { + "200": { + "description": "OAuth2Etsy", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Etsy" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-etsy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "keyString": { + "description": "'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2", + "type": "string", + "example": "<KEY_STRING>", + "nullable": true + }, + "sharedSecret": { + "description": "'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru", + "type": "string", + "example": "<SHARED_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/facebook": { + "patch": { + "summary": "Update project OAuth2 Facebook", + "operationId": "projectUpdateOAuth2Facebook", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Facebook configuration.", + "responses": { + "200": { + "description": "OAuth2Facebook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Facebook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-facebook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "appId": { + "description": "'App ID' of Facebook OAuth2 app. For example: 260600000007694", + "type": "string", + "example": "<APP_ID>", + "nullable": true + }, + "appSecret": { + "description": "'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4", + "type": "string", + "example": "<APP_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/figma": { + "patch": { + "summary": "Update project OAuth2 Figma", + "operationId": "projectUpdateOAuth2Figma", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Figma configuration.", + "responses": { + "200": { + "description": "OAuth2Figma", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Figma" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-figma.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/fusionauth": { + "patch": { + "summary": "Update project OAuth2 FusionAuth", + "operationId": "projectUpdateOAuth2FusionAuth", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 FusionAuth configuration.", + "responses": { + "200": { + "description": "OAuth2FusionAuth", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2FusionAuth" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-fusion-auth.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Domain of FusionAuth instance. For example: example.fusionauth.io", + "type": "string", + "example": "<ENDPOINT>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/github": { + "patch": { + "summary": "Update project OAuth2 GitHub", + "operationId": "projectUpdateOAuth2GitHub", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 GitHub configuration.", + "responses": { + "200": { + "description": "OAuth2GitHub", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Github" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-git-hub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/gitlab": { + "patch": { + "summary": "Update project OAuth2 Gitlab", + "operationId": "projectUpdateOAuth2Gitlab", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Gitlab configuration.", + "responses": { + "200": { + "description": "OAuth2Gitlab", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Gitlab" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-gitlab.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "applicationId": { + "description": "'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252", + "type": "string", + "example": "<APPLICATION_ID>", + "nullable": true + }, + "secret": { + "description": "'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38", + "type": "string", + "example": "<SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Endpoint URL of self-hosted GitLab instance. For example: https:\/\/gitlab.com", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/google": { + "patch": { + "summary": "Update project OAuth2 Google", + "operationId": "projectUpdateOAuth2Google", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Google configuration.", + "responses": { + "200": { + "description": "OAuth2Google", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Google" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-google.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "prompt": { + "description": "Array of Google OAuth2 prompt values. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. Must not be specified with other values. \"consent\" means: prompt the user for consent. \"select_account\" means: prompt the user to select an account.", + "type": "array", + "items": { + "title": "ProjectOAuth2GooglePrompt", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "consent" + ], + "title": "consent" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/huggingface": { + "patch": { + "summary": "Update project OAuth2 Hugging Face", + "operationId": "projectUpdateOAuth2HuggingFace", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Hugging Face configuration.", + "responses": { + "200": { + "description": "OAuth2HuggingFace", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2HuggingFace" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-hugging-face.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/keycloak": { + "patch": { + "summary": "Update project OAuth2 Keycloak", + "operationId": "projectUpdateOAuth2Keycloak", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Keycloak configuration.", + "responses": { + "200": { + "description": "OAuth2Keycloak", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Keycloak" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-keycloak.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Domain of Keycloak instance. For example: keycloak.example.com", + "type": "string", + "example": "<ENDPOINT>", + "nullable": true + }, + "realmName": { + "description": "Keycloak realm name. For example: appwrite-realm", + "type": "string", + "example": "<REALM_NAME>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/kick": { + "patch": { + "summary": "Update project OAuth2 Kick", + "operationId": "projectUpdateOAuth2Kick", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Kick configuration.", + "responses": { + "200": { + "description": "OAuth2Kick", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Kick" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-kick.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/linkedin": { + "patch": { + "summary": "Update project OAuth2 Linkedin", + "operationId": "projectUpdateOAuth2Linkedin", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Linkedin configuration.", + "responses": { + "200": { + "description": "OAuth2Linkedin", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Linkedin" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-linkedin.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "primaryClientSecret": { + "description": "'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000.\/HtlYw==", + "type": "string", + "example": "<PRIMARY_CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/microsoft": { + "patch": { + "summary": "Update project OAuth2 Microsoft", + "operationId": "projectUpdateOAuth2Microsoft", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Microsoft configuration.", + "responses": { + "200": { + "description": "OAuth2Microsoft", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Microsoft" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-microsoft.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "applicationId": { + "description": "'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444", + "type": "string", + "example": "<APPLICATION_ID>", + "nullable": true + }, + "applicationSecret": { + "description": "'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", + "type": "string", + "example": "<APPLICATION_SECRET>", + "nullable": true + }, + "tenant": { + "description": "Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common", + "type": "string", + "example": "<TENANT>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/notion": { + "patch": { + "summary": "Update project OAuth2 Notion", + "operationId": "projectUpdateOAuth2Notion", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Notion configuration.", + "responses": { + "200": { + "description": "OAuth2Notion", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Notion" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-notion.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "oauthClientId": { + "description": "'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3", + "type": "string", + "example": "<OAUTH_CLIENT_ID>", + "nullable": true + }, + "oauthClientSecret": { + "description": "'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9", + "type": "string", + "example": "<OAUTH_CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/oidc": { + "patch": { + "summary": "Update project OAuth2 Oidc", + "operationId": "projectUpdateOAuth2Oidc", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Oidc configuration.", + "responses": { + "200": { + "description": "OAuth2Oidc", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Oidc" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-oidc.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "wellKnownURL": { + "description": "OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https:\/\/myoauth.com\/.well-known\/openid-configuration", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "authorizationURL": { + "description": "OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https:\/\/myoauth.com\/oauth2\/authorize", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "tokenURL": { + "description": "OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https:\/\/myoauth.com\/oauth2\/token", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "userInfoURL": { + "description": "OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https:\/\/myoauth.com\/oauth2\/userinfo", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "prompt": { + "description": "Array of OpenID Connect prompt values controlling the authentication and consent screens. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. \"login\" means: prompt the user to re-authenticate. \"consent\" means: prompt the user for consent. \"select_account\" means: prompt the user to select an account.", + "type": "array", + "items": { + "title": "ProjectOAuth2OidcPrompt", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "login" + ], + "title": "login" + }, + { + "type": "string", + "enum": [ + "consent" + ], + "title": "consent" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "nullable": true + }, + "maxAge": { + "description": "Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate.", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/okta": { + "patch": { + "summary": "Update project OAuth2 Okta", + "operationId": "projectUpdateOAuth2Okta", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Okta configuration.", + "responses": { + "200": { + "description": "OAuth2Okta", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Okta" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-okta.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "domain": { + "description": "Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https:\/\/trial-6400025.okta.com\/", + "type": "string", + "example": "example.com", + "nullable": true + }, + "authorizationServerId": { + "description": "Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z", + "type": "string", + "example": "<AUTHORIZATION_SERVER_ID>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/paypal": { + "patch": { + "summary": "Update project OAuth2 Paypal", + "operationId": "projectUpdateOAuth2Paypal", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Paypal configuration.", + "responses": { + "200": { + "description": "OAuth2Paypal", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Paypal" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-paypal.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "secretKey": { + "description": "'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp", + "type": "string", + "example": "<SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/paypalSandbox": { + "patch": { + "summary": "Update project OAuth2 PaypalSandbox", + "operationId": "projectUpdateOAuth2PaypalSandbox", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 PaypalSandbox configuration.", + "responses": { + "200": { + "description": "OAuth2Paypal", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Paypal" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-paypal-sandbox.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "secretKey": { + "description": "'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp", + "type": "string", + "example": "<SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/podio": { + "patch": { + "summary": "Update project OAuth2 Podio", + "operationId": "projectUpdateOAuth2Podio", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Podio configuration.", + "responses": { + "200": { + "description": "OAuth2Podio", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Podio" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-podio.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/resend": { + "patch": { + "summary": "Update project OAuth2 Resend", + "operationId": "projectUpdateOAuth2Resend", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Resend configuration.", + "responses": { + "200": { + "description": "OAuth2Resend", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Resend" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-resend.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Resend OAuth2 app. For example: f47ac10b-58cc-4372-a567-0e02b2c3d479", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Resend OAuth2 app. For example: 9c1e4b00000000000000000000000000000000000000000000000000a72d5f4", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/salesforce": { + "patch": { + "summary": "Update project OAuth2 Salesforce", + "operationId": "projectUpdateOAuth2Salesforce", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Salesforce configuration.", + "responses": { + "200": { + "description": "OAuth2Salesforce", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Salesforce" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-salesforce.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "customerKey": { + "description": "'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq", + "type": "string", + "example": "<CUSTOMER_KEY>", + "nullable": true + }, + "customerSecret": { + "description": "'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2", + "type": "string", + "example": "<CUSTOMER_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/slack": { + "patch": { + "summary": "Update project OAuth2 Slack", + "operationId": "projectUpdateOAuth2Slack", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Slack configuration.", + "responses": { + "200": { + "description": "OAuth2Slack", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Slack" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-slack.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/spotify": { + "patch": { + "summary": "Update project OAuth2 Spotify", + "operationId": "projectUpdateOAuth2Spotify", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Spotify configuration.", + "responses": { + "200": { + "description": "OAuth2Spotify", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Spotify" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-spotify.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/stripe": { + "patch": { + "summary": "Update project OAuth2 Stripe", + "operationId": "projectUpdateOAuth2Stripe", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Stripe configuration.", + "responses": { + "200": { + "description": "OAuth2Stripe", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Stripe" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-stripe.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "apiSecretKey": { + "description": "'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp", + "type": "string", + "example": "<API_SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/tradeshift": { + "patch": { + "summary": "Update project OAuth2 Tradeshift", + "operationId": "projectUpdateOAuth2Tradeshift", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Tradeshift configuration.", + "responses": { + "200": { + "description": "OAuth2Tradeshift", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Tradeshift" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-tradeshift.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "oauth2ClientId": { + "description": "'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app", + "type": "string", + "example": "<OAUTH2_CLIENT_ID>", + "nullable": true + }, + "oauth2ClientSecret": { + "description": "'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83", + "type": "string", + "example": "<OAUTH2_CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/tradeshiftBox": { + "patch": { + "summary": "Update project OAuth2 Tradeshift Sandbox", + "operationId": "projectUpdateOAuth2TradeshiftSandbox", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Tradeshift Sandbox configuration.", + "responses": { + "200": { + "description": "OAuth2Tradeshift", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Tradeshift" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-tradeshift-sandbox.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "oauth2ClientId": { + "description": "'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app", + "type": "string", + "example": "<OAUTH2_CLIENT_ID>", + "nullable": true + }, + "oauth2ClientSecret": { + "description": "'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83", + "type": "string", + "example": "<OAUTH2_CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/twitch": { + "patch": { + "summary": "Update project OAuth2 Twitch", + "operationId": "projectUpdateOAuth2Twitch", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Twitch configuration.", + "responses": { + "200": { + "description": "OAuth2Twitch", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Twitch" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-twitch.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/wordpress": { + "patch": { + "summary": "Update project OAuth2 WordPress", + "operationId": "projectUpdateOAuth2WordPress", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 WordPress configuration.", + "responses": { + "200": { + "description": "OAuth2WordPress", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2WordPress" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-word-press.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of WordPress OAuth2 app. For example: 130005", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/x": { + "patch": { + "summary": "Update project OAuth2 X", + "operationId": "projectUpdateOAuth2X", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 X configuration.", + "responses": { + "200": { + "description": "OAuth2X", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2X" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2x.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "customerKey": { + "description": "'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT", + "type": "string", + "example": "<CUSTOMER_KEY>", + "nullable": true + }, + "secretKey": { + "description": "'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9", + "type": "string", + "example": "<SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/yahoo": { + "patch": { + "summary": "Update project OAuth2 Yahoo", + "operationId": "projectUpdateOAuth2Yahoo", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Yahoo configuration.", + "responses": { + "200": { + "description": "OAuth2Yahoo", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Yahoo" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-yahoo.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/yandex": { + "patch": { + "summary": "Update project OAuth2 Yandex", + "operationId": "projectUpdateOAuth2Yandex", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Yandex configuration.", + "responses": { + "200": { + "description": "OAuth2Yandex", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Yandex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-yandex.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/zoho": { + "patch": { + "summary": "Update project OAuth2 Zoho", + "operationId": "projectUpdateOAuth2Zoho", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Zoho configuration.", + "responses": { + "200": { + "description": "OAuth2Zoho", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Zoho" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-zoho.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/zoom": { + "patch": { + "summary": "Update project OAuth2 Zoom", + "operationId": "projectUpdateOAuth2Zoom", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Zoom configuration.", + "responses": { + "200": { + "description": "OAuth2Zoom", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Zoom" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-zoom.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/{providerId}": { + "get": { + "summary": "Get project OAuth2 provider", + "operationId": "projectGetOAuth2Provider", + "tags": [ + "project" + ], + "description": "Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key\/team IDs) are write-only and always returned empty.", + "responses": { + "200": { + "description": "OAuth2GitHub, or OAuth2Discord, or OAuth2Figma, or OAuth2Dropbox, or OAuth2Dailymotion, or OAuth2Bitbucket, or OAuth2Bitly, or OAuth2Box, or OAuth2Autodesk, or OAuth2Google, or OAuth2Zoom, or OAuth2Zoho, or OAuth2Yandex, or OAuth2X, or OAuth2WordPress, or OAuth2Twitch, or OAuth2Stripe, or OAuth2Spotify, or OAuth2Slack, or OAuth2Podio, or OAuth2Notion, or OAuth2Salesforce, or OAuth2Yahoo, or OAuth2HuggingFace, or OAuth2Resend, or OAuth2Cloudflare, or OAuth2Linkedin, or OAuth2Disqus, or OAuth2Amazon, or OAuth2Etsy, or OAuth2Facebook, or OAuth2Tradeshift, or OAuth2Paypal, or OAuth2Gitlab, or OAuth2Authentik, or OAuth2Auth0, or OAuth2FusionAuth, or OAuth2Keycloak, or OAuth2Oidc, or OAuth2Apple, or OAuth2Okta, or OAuth2Kick, or OAuth2Microsoft", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/oAuth2Github" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Discord" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Figma" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Dropbox" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Dailymotion" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Bitbucket" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Bitly" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Box" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Autodesk" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Google" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Zoom" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Zoho" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Yandex" + }, + { + "$ref": "#\/components\/schemas\/oAuth2X" + }, + { + "$ref": "#\/components\/schemas\/oAuth2WordPress" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Twitch" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Stripe" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Spotify" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Slack" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Podio" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Notion" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Salesforce" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Yahoo" + }, + { + "$ref": "#\/components\/schemas\/oAuth2HuggingFace" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Resend" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Cloudflare" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Linkedin" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Disqus" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Amazon" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Etsy" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Facebook" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Tradeshift" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Paypal" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Gitlab" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Authentik" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Auth0" + }, + { + "$ref": "#\/components\/schemas\/oAuth2FusionAuth" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Keycloak" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Oidc" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Apple" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Okta" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Kick" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Microsoft" + } + ], + "discriminator": { + "propertyName": "$id", + "mapping": { + "github": "#\/components\/schemas\/oAuth2Github", + "discord": "#\/components\/schemas\/oAuth2Discord", + "figma": "#\/components\/schemas\/oAuth2Figma", + "dropbox": "#\/components\/schemas\/oAuth2Dropbox", + "dailymotion": "#\/components\/schemas\/oAuth2Dailymotion", + "bitbucket": "#\/components\/schemas\/oAuth2Bitbucket", + "bitly": "#\/components\/schemas\/oAuth2Bitly", + "box": "#\/components\/schemas\/oAuth2Box", + "autodesk": "#\/components\/schemas\/oAuth2Autodesk", + "google": "#\/components\/schemas\/oAuth2Google", + "zoom": "#\/components\/schemas\/oAuth2Zoom", + "zoho": "#\/components\/schemas\/oAuth2Zoho", + "yandex": "#\/components\/schemas\/oAuth2Yandex", + "x": "#\/components\/schemas\/oAuth2X", + "wordpress": "#\/components\/schemas\/oAuth2WordPress", + "twitch": "#\/components\/schemas\/oAuth2Twitch", + "stripe": "#\/components\/schemas\/oAuth2Stripe", + "spotify": "#\/components\/schemas\/oAuth2Spotify", + "slack": "#\/components\/schemas\/oAuth2Slack", + "podio": "#\/components\/schemas\/oAuth2Podio", + "notion": "#\/components\/schemas\/oAuth2Notion", + "salesforce": "#\/components\/schemas\/oAuth2Salesforce", + "yahoo": "#\/components\/schemas\/oAuth2Yahoo", + "huggingface": "#\/components\/schemas\/oAuth2HuggingFace", + "resend": "#\/components\/schemas\/oAuth2Resend", + "cloudflare": "#\/components\/schemas\/oAuth2Cloudflare", + "linkedin": "#\/components\/schemas\/oAuth2Linkedin", + "disqus": "#\/components\/schemas\/oAuth2Disqus", + "amazon": "#\/components\/schemas\/oAuth2Amazon", + "etsy": "#\/components\/schemas\/oAuth2Etsy", + "facebook": "#\/components\/schemas\/oAuth2Facebook", + "tradeshift": "#\/components\/schemas\/oAuth2Tradeshift", + "tradeshiftBox": "#\/components\/schemas\/oAuth2Tradeshift", + "paypal": "#\/components\/schemas\/oAuth2Paypal", + "paypalSandbox": "#\/components\/schemas\/oAuth2Paypal", + "gitlab": "#\/components\/schemas\/oAuth2Gitlab", + "authentik": "#\/components\/schemas\/oAuth2Authentik", + "auth0": "#\/components\/schemas\/oAuth2Auth0", + "fusionauth": "#\/components\/schemas\/oAuth2FusionAuth", + "keycloak": "#\/components\/schemas\/oAuth2Keycloak", + "oidc": "#\/components\/schemas\/oAuth2Oidc", + "apple": "#\/components\/schemas\/oAuth2Apple", + "okta": "#\/components\/schemas\/oAuth2Okta", + "kick": "#\/components\/schemas\/oAuth2Kick", + "microsoft": "#\/components\/schemas\/oAuth2Microsoft" + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/get-o-auth-2-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "OAuth2 provider key. For example: github, google, apple.", + "required": true, + "schema": { + "type": "string", + "example": "amazon", + "title": "ProjectOAuthProviderId", + "oneOf": [ + { + "type": "string", + "enum": [ + "amazon" + ], + "title": "amazon" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "appwrite" + ], + "title": "appwrite" + }, + { + "type": "string", + "enum": [ + "auth0" + ], + "title": "auth0" + }, + { + "type": "string", + "enum": [ + "authentik" + ], + "title": "authentik" + }, + { + "type": "string", + "enum": [ + "autodesk" + ], + "title": "autodesk" + }, + { + "type": "string", + "enum": [ + "bitbucket" + ], + "title": "bitbucket" + }, + { + "type": "string", + "enum": [ + "bitly" + ], + "title": "bitly" + }, + { + "type": "string", + "enum": [ + "box" + ], + "title": "box" + }, + { + "type": "string", + "enum": [ + "cloudflare" + ], + "title": "cloudflare" + }, + { + "type": "string", + "enum": [ + "dailymotion" + ], + "title": "dailymotion" + }, + { + "type": "string", + "enum": [ + "discord" + ], + "title": "discord" + }, + { + "type": "string", + "enum": [ + "disqus" + ], + "title": "disqus" + }, + { + "type": "string", + "enum": [ + "dropbox" + ], + "title": "dropbox" + }, + { + "type": "string", + "enum": [ + "etsy" + ], + "title": "etsy" + }, + { + "type": "string", + "enum": [ + "facebook" + ], + "title": "facebook" + }, + { + "type": "string", + "enum": [ + "figma" + ], + "title": "figma" + }, + { + "type": "string", + "enum": [ + "fusionauth" + ], + "title": "fusionauth" + }, + { + "type": "string", + "enum": [ + "github" + ], + "title": "github" + }, + { + "type": "string", + "enum": [ + "gitlab" + ], + "title": "gitlab" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + }, + { + "type": "string", + "enum": [ + "huggingface" + ], + "title": "huggingface" + }, + { + "type": "string", + "enum": [ + "keycloak" + ], + "title": "keycloak" + }, + { + "type": "string", + "enum": [ + "kick" + ], + "title": "kick" + }, + { + "type": "string", + "enum": [ + "linkedin" + ], + "title": "linkedin" + }, + { + "type": "string", + "enum": [ + "microsoft" + ], + "title": "microsoft" + }, + { + "type": "string", + "enum": [ + "notion" + ], + "title": "notion" + }, + { + "type": "string", + "enum": [ + "oidc" + ], + "title": "oidc" + }, + { + "type": "string", + "enum": [ + "okta" + ], + "title": "okta" + }, + { + "type": "string", + "enum": [ + "paypal" + ], + "title": "paypal" + }, + { + "type": "string", + "enum": [ + "paypalSandbox" + ], + "title": "paypalSandbox" + }, + { + "type": "string", + "enum": [ + "podio" + ], + "title": "podio" + }, + { + "type": "string", + "enum": [ + "resend" + ], + "title": "resend" + }, + { + "type": "string", + "enum": [ + "salesforce" + ], + "title": "salesforce" + }, + { + "type": "string", + "enum": [ + "slack" + ], + "title": "slack" + }, + { + "type": "string", + "enum": [ + "spotify" + ], + "title": "spotify" + }, + { + "type": "string", + "enum": [ + "stripe" + ], + "title": "stripe" + }, + { + "type": "string", + "enum": [ + "tradeshift" + ], + "title": "tradeshift" + }, + { + "type": "string", + "enum": [ + "tradeshiftBox" + ], + "title": "tradeshiftBox" + }, + { + "type": "string", + "enum": [ + "twitch" + ], + "title": "twitch" + }, + { + "type": "string", + "enum": [ + "wordpress" + ], + "title": "wordpress" + }, + { + "type": "string", + "enum": [ + "x" + ], + "title": "x" + }, + { + "type": "string", + "enum": [ + "yahoo" + ], + "title": "yahoo" + }, + { + "type": "string", + "enum": [ + "yammer" + ], + "title": "yammer" + }, + { + "type": "string", + "enum": [ + "yandex" + ], + "title": "yandex" + }, + { + "type": "string", + "enum": [ + "zoho" + ], + "title": "zoho" + }, + { + "type": "string", + "enum": [ + "zoom" + ], + "title": "zoom" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/project\/platforms": { + "get": { + "summary": "List project platforms", + "operationId": "projectListPlatforms", + "tags": [ + "project" + ], + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations.", + "responses": { + "200": { + "description": "Platforms List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/list-platforms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/project\/platforms\/android": { + "post": { + "summary": "Create project Android platform", + "operationId": "projectCreateAndroidPlatform", + "tags": [ + "project" + ], + "description": "Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Android", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformAndroid" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-android-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "applicationId": { + "description": "Android application ID. Max length: 256 chars.", + "type": "string", + "example": "<APPLICATION_ID>" + } + }, + "required": [ + "platformId", + "name", + "applicationId" + ] + } + } + } + } + } + }, + "\/project\/platforms\/android\/{platformId}": { + "put": { + "summary": "Update project Android platform", + "operationId": "projectUpdateAndroidPlatform", + "tags": [ + "project" + ], + "description": "Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID.", + "responses": { + "200": { + "description": "Platform Android", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformAndroid" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-android-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "applicationId": { + "description": "Android application ID. Max length: 256 chars.", + "type": "string", + "example": "<APPLICATION_ID>" + } + }, + "required": [ + "name", + "applicationId" + ] + } + } + } + } + } + }, + "\/project\/platforms\/apple": { + "post": { + "summary": "Create project Apple platform", + "operationId": "projectCreateApplePlatform", + "tags": [ + "project" + ], + "description": "Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Apple", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformApple" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-apple-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "bundleIdentifier": { + "description": "Apple bundle identifier. Max length: 256 chars.", + "type": "string", + "example": "<BUNDLE_IDENTIFIER>" + } + }, + "required": [ + "platformId", + "name", + "bundleIdentifier" + ] + } + } + } + } + } + }, + "\/project\/platforms\/apple\/{platformId}": { + "put": { + "summary": "Update project Apple platform", + "operationId": "projectUpdateApplePlatform", + "tags": [ + "project" + ], + "description": "Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier.", + "responses": { + "200": { + "description": "Platform Apple", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformApple" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-apple-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "bundleIdentifier": { + "description": "Apple bundle identifier. Max length: 256 chars.", + "type": "string", + "example": "<BUNDLE_IDENTIFIER>" + } + }, + "required": [ + "name", + "bundleIdentifier" + ] + } + } + } + } + } + }, + "\/project\/platforms\/linux": { + "post": { + "summary": "Create project Linux platform", + "operationId": "projectCreateLinuxPlatform", + "tags": [ + "project" + ], + "description": "Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Linux", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformLinux" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-linux-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "packageName": { + "description": "Linux package name. Max length: 256 chars.", + "type": "string", + "example": "<PACKAGE_NAME>" + } + }, + "required": [ + "platformId", + "name", + "packageName" + ] + } + } + } + } + } + }, + "\/project\/platforms\/linux\/{platformId}": { + "put": { + "summary": "Update project Linux platform", + "operationId": "projectUpdateLinuxPlatform", + "tags": [ + "project" + ], + "description": "Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name.", + "responses": { + "200": { + "description": "Platform Linux", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformLinux" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-linux-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "packageName": { + "description": "Linux package name. Max length: 256 chars.", + "type": "string", + "example": "<PACKAGE_NAME>" + } + }, + "required": [ + "name", + "packageName" + ] + } + } + } + } + } + }, + "\/project\/platforms\/web": { + "post": { + "summary": "Create project web platform", + "operationId": "projectCreateWebPlatform", + "tags": [ + "project" + ], + "description": "Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Web", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformWeb" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-web-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "hostname": { + "description": "Platform web hostname. Max length: 256 chars.", + "type": "string", + "example": "app.example.com" + } + }, + "required": [ + "platformId", + "name", + "hostname" + ] + } + } + } + } + } + }, + "\/project\/platforms\/web\/{platformId}": { + "put": { + "summary": "Update project web platform", + "operationId": "projectUpdateWebPlatform", + "tags": [ + "project" + ], + "description": "Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname.", + "responses": { + "200": { + "description": "Platform Web", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformWeb" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-web-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "hostname": { + "description": "Platform web hostname. Max length: 256 chars.", + "type": "string", + "example": "app.example.com" + } + }, + "required": [ + "name", + "hostname" + ] + } + } + } + } + } + }, + "\/project\/platforms\/windows": { + "post": { + "summary": "Create project Windows platform", + "operationId": "projectCreateWindowsPlatform", + "tags": [ + "project" + ], + "description": "Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Windows", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformWindows" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-windows-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "packageIdentifierName": { + "description": "Windows package identifier name. Max length: 256 chars.", + "type": "string", + "example": "<PACKAGE_IDENTIFIER_NAME>" + } + }, + "required": [ + "platformId", + "name", + "packageIdentifierName" + ] + } + } + } + } + } + }, + "\/project\/platforms\/windows\/{platformId}": { + "put": { + "summary": "Update project Windows platform", + "operationId": "projectUpdateWindowsPlatform", + "tags": [ + "project" + ], + "description": "Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name.", + "responses": { + "200": { + "description": "Platform Windows", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformWindows" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-windows-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "packageIdentifierName": { + "description": "Windows package identifier name. Max length: 256 chars.", + "type": "string", + "example": "<PACKAGE_IDENTIFIER_NAME>" + } + }, + "required": [ + "name", + "packageIdentifierName" + ] + } + } + } + } + } + }, + "\/project\/platforms\/{platformId}": { + "get": { + "summary": "Get project platform", + "operationId": "projectGetPlatform", + "tags": [ + "project" + ], + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations.", + "responses": { + "200": { + "description": "Platform Web, or Platform Apple, or Platform Android, or Platform Windows, or Platform Linux", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/platformWeb" + }, + { + "$ref": "#\/components\/schemas\/platformApple" + }, + { + "$ref": "#\/components\/schemas\/platformAndroid" + }, + { + "$ref": "#\/components\/schemas\/platformWindows" + }, + { + "$ref": "#\/components\/schemas\/platformLinux" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "web": "#\/components\/schemas\/platformWeb", + "apple": "#\/components\/schemas\/platformApple", + "android": "#\/components\/schemas\/platformAndroid", + "windows": "#\/components\/schemas\/platformWindows", + "linux": "#\/components\/schemas\/platformLinux" + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/get-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete project platform", + "operationId": "projectDeletePlatform", + "tags": [ + "project" + ], + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/delete-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/project\/policies": { + "get": { + "summary": "List project policies", + "operationId": "projectListPolicies", + "tags": [ + "project" + ], + "description": "Get a list of all project policies and their current configuration.", + "responses": { + "200": { + "description": "Policies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/policyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/list-policies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.read", + "project.policies.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/project\/policies\/membership-privacy": { + "patch": { + "summary": "Update membership privacy policy", + "operationId": "projectUpdateMembershipPrivacyPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members..", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-membership-privacy-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "Set to true if you want make user ID visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userEmail": { + "description": "Set to true if you want make user email visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userPhone": { + "description": "Set to true if you want make user phone number visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userName": { + "description": "Set to true if you want make user name visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userMFA": { + "description": "Set to true if you want make user MFA status visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userAccessedAt": { + "description": "Set to true if you want make user last access time visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + } + } + } + } + } + } + } + }, + "\/project\/policies\/mfa-factors": { + "patch": { + "summary": "Update MFA factors policy", + "operationId": "projectUpdateMFAFactorsPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control which factors users can use to complete an MFA challenge. Disabled factors cannot be used to create a challenge and are reported as unavailable when listing factors. The custom factor is disabled by default; enable it to deliver challenge codes through your own channel. Recovery codes always remain available as a fallback.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-mfa-factors-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "totp": { + "description": "Set to true to allow TOTP to complete an MFA challenge, or false to disable it.", + "type": "boolean", + "example": false + }, + "email": { + "description": "Set to true to allow email to complete an MFA challenge, or false to disable it.", + "type": "boolean", + "example": false + }, + "phone": { + "description": "Set to true to allow phone (SMS) to complete an MFA challenge, or false to disable it.", + "type": "boolean", + "example": false + }, + "custom": { + "description": "Set to true to allow the custom factor to complete an MFA challenge, or false to disable it.", + "type": "boolean", + "example": false + } + } + } + } + } + } + } + }, + "\/project\/policies\/password-dictionary": { + "patch": { + "summary": "Update password dictionary policy", + "operationId": "projectUpdatePasswordDictionaryPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-dictionary-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/policies\/password-history": { + "patch": { + "summary": "Update password history policy", + "operationId": "projectUpdatePasswordHistoryPolicy", + "tags": [ + "project" + ], + "description": "Updates one of password strength policies. Based on total length configured, previous password hashes are stored, and users cannot choose a new password that is already stored in the passwird history list, when updating an user password, or setting new one through password recovery.\n\nKeep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-history-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "total": { + "description": "Set the password history length per user. Value can be between 1 and 20, or null to disable the limit.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + } + }, + "required": [ + "total" + ] + } + } + } + } + } + }, + "\/project\/policies\/password-personal-data": { + "patch": { + "summary": "Update password personal data policy", + "operationId": "projectUpdatePasswordPersonalDataPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-personal-data-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/policies\/password-strength": { + "patch": { + "summary": "Update password strength policy", + "operationId": "projectUpdatePasswordStrengthPolicy", + "tags": [ + "project" + ], + "description": "Update the password strength requirements for users in the project.", + "responses": { + "200": { + "description": "Policy Password Strength", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/policyPasswordStrength" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-strength-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "min": { + "description": "Minimum password length. Value must be between 8 and 256. Default is 8.", + "type": "integer", + "example": 8, + "format": "int32" + }, + "uppercase": { + "description": "Whether passwords must include at least one uppercase letter.", + "type": "boolean", + "example": false + }, + "lowercase": { + "description": "Whether passwords must include at least one lowercase letter.", + "type": "boolean", + "example": false + }, + "number": { + "description": "Whether passwords must include at least one number.", + "type": "boolean", + "example": false + }, + "symbols": { + "description": "Whether passwords must include at least one symbol.", + "type": "boolean", + "example": false + } + } + } + } + } + } + } + }, + "\/project\/policies\/session-alert": { + "patch": { + "summary": "Update session alert policy", + "operationId": "projectUpdateSessionAlertPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if email alert is sent upon session creation. When enabled, and user signs into their account, they will be sent an email notification. There is an exception, the first session after a new sign up does not trigger an alert, even if the policy is enabled.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-session-alert-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle session alert policy. Set to true if you want users to receive email notifications when a sessions are created for their users, or false to not send email alerts.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/policies\/session-duration": { + "patch": { + "summary": "Update session duration policy", + "operationId": "projectUpdateSessionDurationPolicy", + "tags": [ + "project" + ], + "description": "Update maximum duration how long sessions created within a project should stay active for.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-session-duration-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "duration": { + "description": "Maximum session length in seconds. Minium allowed value is 60 seconds, and maximum is 1 year, which is 31536000 seconds.", + "type": "integer", + "example": 60, + "format": "int32" + } + }, + "required": [ + "duration" + ] + } + } + } + } + } + }, + "\/project\/policies\/session-invalidation": { + "patch": { + "summary": "Update session invalidation policy", + "operationId": "projectUpdateSessionInvalidationPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if existing sessions should be invalidated when a password of a user is changed. When enabled, and user changes their password, they will be logged out of all their devices.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-session-invalidation-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle session invalidation policy. Set to true if you want password change to invalidate all sessions of an user, or false to keep sessions active.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/policies\/session-limit": { + "patch": { + "summary": "Update session limit policy", + "operationId": "projectUpdateSessionLimitPolicy", + "tags": [ + "project" + ], + "description": "Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-session-limit-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "total": { + "description": "Set the maximum number of sessions allowed per user. Value can be between 1 and 100.", + "type": "integer", + "example": 1, + "format": "int32" + } + }, + "required": [ + "total" + ] + } + } + } + } + } + }, + "\/project\/policies\/user-limit": { + "patch": { + "summary": "Update user limit policy", + "operationId": "projectUpdateUserLimitPolicy", + "tags": [ + "project" + ], + "description": "Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-user-limit-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "total": { + "description": "Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit.", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + } + }, + "required": [ + "total" + ] + } + } + } + } + } + }, + "\/project\/policies\/{policyId}": { + "get": { + "summary": "Get project policy", + "operationId": "projectGetPolicy", + "tags": [ + "project" + ], + "description": "Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy.", + "responses": { + "200": { + "description": "Policy Password Dictionary, or Policy Password History, or Policy Password Strength, or Policy Password Personal Data, or Policy Session Alert, or Policy Session Duration, or Policy Session Invalidation, or Policy Session Limit, or Policy User Limit, or Policy Membership Privacy, or Policy MFA Factors", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/policyPasswordDictionary" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordHistory" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordStrength" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordPersonalData" + }, + { + "$ref": "#\/components\/schemas\/policySessionAlert" + }, + { + "$ref": "#\/components\/schemas\/policySessionDuration" + }, + { + "$ref": "#\/components\/schemas\/policySessionInvalidation" + }, + { + "$ref": "#\/components\/schemas\/policySessionLimit" + }, + { + "$ref": "#\/components\/schemas\/policyUserLimit" + }, + { + "$ref": "#\/components\/schemas\/policyMembershipPrivacy" + }, + { + "$ref": "#\/components\/schemas\/policyMfaFactors" + } + ], + "discriminator": { + "propertyName": "$id", + "mapping": { + "password-dictionary": "#\/components\/schemas\/policyPasswordDictionary", + "password-history": "#\/components\/schemas\/policyPasswordHistory", + "password-strength": "#\/components\/schemas\/policyPasswordStrength", + "password-personal-data": "#\/components\/schemas\/policyPasswordPersonalData", + "session-alert": "#\/components\/schemas\/policySessionAlert", + "session-duration": "#\/components\/schemas\/policySessionDuration", + "session-invalidation": "#\/components\/schemas\/policySessionInvalidation", + "session-limit": "#\/components\/schemas\/policySessionLimit", + "user-limit": "#\/components\/schemas\/policyUserLimit", + "membership-privacy": "#\/components\/schemas\/policyMembershipPrivacy", + "mfa-factors": "#\/components\/schemas\/policyMfaFactors" + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/get-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.read", + "project.policies.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "policyId", + "description": "Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors.", + "required": true, + "schema": { + "type": "string", + "example": "password-dictionary", + "title": "ProjectPolicyId", + "oneOf": [ + { + "type": "string", + "enum": [ + "password-dictionary" + ], + "title": "password-dictionary" + }, + { + "type": "string", + "enum": [ + "password-history" + ], + "title": "password-history" + }, + { + "type": "string", + "enum": [ + "password-strength" + ], + "title": "password-strength" + }, + { + "type": "string", + "enum": [ + "password-personal-data" + ], + "title": "password-personal-data" + }, + { + "type": "string", + "enum": [ + "session-alert" + ], + "title": "session-alert" + }, + { + "type": "string", + "enum": [ + "session-duration" + ], + "title": "session-duration" + }, + { + "type": "string", + "enum": [ + "session-invalidation" + ], + "title": "session-invalidation" + }, + { + "type": "string", + "enum": [ + "session-limit" + ], + "title": "session-limit" + }, + { + "type": "string", + "enum": [ + "user-limit" + ], + "title": "user-limit" + }, + { + "type": "string", + "enum": [ + "membership-privacy" + ], + "title": "membership-privacy" + }, + { + "type": "string", + "enum": [ + "mfa-factors" + ], + "title": "mfa-factors" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/project\/protocols\/{protocolId}": { + "patch": { + "summary": "Update project protocol", + "operationId": "projectUpdateProtocol", + "tags": [ + "project" + ], + "description": "Update properties of a specific protocol. Use this endpoint to enable or disable a protocol in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/update-protocol.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "protocolId", + "description": "Protocol name. Can be one of: rest, graphql, websocket", + "required": true, + "schema": { + "type": "string", + "example": "rest", + "title": "ProjectProtocolId", + "oneOf": [ + { + "type": "string", + "enum": [ + "rest" + ], + "title": "rest" + }, + { + "type": "string", + "enum": [ + "graphql" + ], + "title": "graphql" + }, + { + "type": "string", + "enum": [ + "websocket" + ], + "title": "websocket" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Protocol status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/services\/{serviceId}": { + "patch": { + "summary": "Update project service", + "operationId": "projectUpdateService", + "tags": [ + "project" + ], + "description": "Update properties of a specific service. Use this endpoint to enable or disable a service in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/update-service.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "serviceId", + "description": "Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor", + "required": true, + "schema": { + "type": "string", + "example": "account", + "title": "ProjectServiceId", + "oneOf": [ + { + "type": "string", + "enum": [ + "account" + ], + "title": "account" + }, + { + "type": "string", + "enum": [ + "avatars" + ], + "title": "avatars" + }, + { + "type": "string", + "enum": [ + "databases" + ], + "title": "databases" + }, + { + "type": "string", + "enum": [ + "tablesdb" + ], + "title": "tablesdb" + }, + { + "type": "string", + "enum": [ + "locale" + ], + "title": "locale" + }, + { + "type": "string", + "enum": [ + "health" + ], + "title": "health" + }, + { + "type": "string", + "enum": [ + "project" + ], + "title": "project" + }, + { + "type": "string", + "enum": [ + "storage" + ], + "title": "storage" + }, + { + "type": "string", + "enum": [ + "teams" + ], + "title": "teams" + }, + { + "type": "string", + "enum": [ + "users" + ], + "title": "users" + }, + { + "type": "string", + "enum": [ + "vcs" + ], + "title": "vcs" + }, + { + "type": "string", + "enum": [ + "sites" + ], + "title": "sites" + }, + { + "type": "string", + "enum": [ + "functions" + ], + "title": "functions" + }, + { + "type": "string", + "enum": [ + "proxy" + ], + "title": "proxy" + }, + { + "type": "string", + "enum": [ + "graphql" + ], + "title": "graphql" + }, + { + "type": "string", + "enum": [ + "migrations" + ], + "title": "migrations" + }, + { + "type": "string", + "enum": [ + "messaging" + ], + "title": "messaging" + }, + { + "type": "string", + "enum": [ + "advisor" + ], + "title": "advisor" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Service status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/smtp": { + "patch": { + "summary": "Update project SMTP configuration", + "operationId": "projectUpdateSMTP", + "tags": [ + "project" + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "smtp", + "demo": "project\/update-smtp.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "host": { + "description": "SMTP server hostname (domain)", + "type": "string", + "example": "example.com", + "nullable": true + }, + "port": { + "description": "SMTP server port", + "type": "integer", + "example": 587, + "format": "int32", + "nullable": true + }, + "username": { + "description": "SMTP server username. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "<USERNAME>", + "nullable": true + }, + "password": { + "description": "SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only).", + "type": "string", + "example": "password", + "format": "password", + "nullable": true + }, + "senderEmail": { + "description": "Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "senderName": { + "description": "Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "<SENDER_NAME>", + "nullable": true + }, + "replyToEmail": { + "description": "Email used when user replies to the email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "replyToName": { + "description": "Name used when user replies to the email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "<REPLY_TO_NAME>", + "nullable": true + }, + "secure": { + "description": "Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption.", + "type": "string", + "example": "tls", + "title": "ProjectSMTPSecure", + "oneOf": [ + { + "type": "string", + "enum": [ + "tls" + ], + "title": "tls" + }, + { + "type": "string", + "enum": [ + "ssl" + ], + "title": "ssl" + } + ], + "nullable": true + }, + "enabled": { + "description": "Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/smtp\/tests": { + "post": { + "summary": "Create project SMTP test", + "operationId": "projectCreateSMTPTest", + "tags": [ + "project" + ], + "description": "Send a test email to verify SMTP configuration. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "smtp", + "demo": "project\/create-smtp-test.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emails": { + "description": "Array of emails to send test email to. Maximum of 10 emails are allowed.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "emails" + ] + } + } + } + } + } + }, + "\/project\/templates\/email": { + "get": { + "summary": "List project email templates", + "operationId": "projectListEmailTemplates", + "tags": [ + "project" + ], + "description": "Get a list of all custom email templates configured for the project. This endpoint returns an array of all configured email templates and their locales.", + "responses": { + "200": { + "description": "Email Templates List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplateList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "project\/list-email-templates.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "templates.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "patch": { + "summary": "Update project email template", + "operationId": "projectUpdateEmailTemplate", + "tags": [ + "project" + ], + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "project\/update-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "templates.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "templateId": { + "description": "Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession", + "type": "string", + "example": "verification", + "title": "ProjectEmailTemplateId", + "oneOf": [ + { + "type": "string", + "enum": [ + "verification" + ], + "title": "verification" + }, + { + "type": "string", + "enum": [ + "magicSession" + ], + "title": "magicSession" + }, + { + "type": "string", + "enum": [ + "recovery" + ], + "title": "recovery" + }, + { + "type": "string", + "enum": [ + "invitation" + ], + "title": "invitation" + }, + { + "type": "string", + "enum": [ + "mfaChallenge" + ], + "title": "mfaChallenge" + }, + { + "type": "string", + "enum": [ + "sessionAlert" + ], + "title": "sessionAlert" + }, + { + "type": "string", + "enum": [ + "otpSession" + ], + "title": "otpSession" + } + ] + }, + "locale": { + "description": "Custom email template locale. If left empty, the fallback locale (en) will be used.", + "type": "string", + "default": "", + "example": "af", + "title": "ProjectEmailTemplateLocale", + "oneOf": [ + { + "type": "string", + "enum": [ + "af" + ], + "title": "af" + }, + { + "type": "string", + "enum": [ + "ar-ae" + ], + "title": "ar-ae" + }, + { + "type": "string", + "enum": [ + "ar-bh" + ], + "title": "ar-bh" + }, + { + "type": "string", + "enum": [ + "ar-dz" + ], + "title": "ar-dz" + }, + { + "type": "string", + "enum": [ + "ar-eg" + ], + "title": "ar-eg" + }, + { + "type": "string", + "enum": [ + "ar-iq" + ], + "title": "ar-iq" + }, + { + "type": "string", + "enum": [ + "ar-jo" + ], + "title": "ar-jo" + }, + { + "type": "string", + "enum": [ + "ar-kw" + ], + "title": "ar-kw" + }, + { + "type": "string", + "enum": [ + "ar-lb" + ], + "title": "ar-lb" + }, + { + "type": "string", + "enum": [ + "ar-ly" + ], + "title": "ar-ly" + }, + { + "type": "string", + "enum": [ + "ar-ma" + ], + "title": "ar-ma" + }, + { + "type": "string", + "enum": [ + "ar-om" + ], + "title": "ar-om" + }, + { + "type": "string", + "enum": [ + "ar-qa" + ], + "title": "ar-qa" + }, + { + "type": "string", + "enum": [ + "ar-sa" + ], + "title": "ar-sa" + }, + { + "type": "string", + "enum": [ + "ar-sy" + ], + "title": "ar-sy" + }, + { + "type": "string", + "enum": [ + "ar-tn" + ], + "title": "ar-tn" + }, + { + "type": "string", + "enum": [ + "ar-ye" + ], + "title": "ar-ye" + }, + { + "type": "string", + "enum": [ + "as" + ], + "title": "as" + }, + { + "type": "string", + "enum": [ + "az" + ], + "title": "az" + }, + { + "type": "string", + "enum": [ + "be" + ], + "title": "be" + }, + { + "type": "string", + "enum": [ + "bg" + ], + "title": "bg" + }, + { + "type": "string", + "enum": [ + "bh" + ], + "title": "bh" + }, + { + "type": "string", + "enum": [ + "bn" + ], + "title": "bn" + }, + { + "type": "string", + "enum": [ + "bs" + ], + "title": "bs" + }, + { + "type": "string", + "enum": [ + "ca" + ], + "title": "ca" + }, + { + "type": "string", + "enum": [ + "cs" + ], + "title": "cs" + }, + { + "type": "string", + "enum": [ + "cy" + ], + "title": "cy" + }, + { + "type": "string", + "enum": [ + "da" + ], + "title": "da" + }, + { + "type": "string", + "enum": [ + "de" + ], + "title": "de" + }, + { + "type": "string", + "enum": [ + "de-at" + ], + "title": "de-at" + }, + { + "type": "string", + "enum": [ + "de-ch" + ], + "title": "de-ch" + }, + { + "type": "string", + "enum": [ + "de-li" + ], + "title": "de-li" + }, + { + "type": "string", + "enum": [ + "de-lu" + ], + "title": "de-lu" + }, + { + "type": "string", + "enum": [ + "el" + ], + "title": "el" + }, + { + "type": "string", + "enum": [ + "en" + ], + "title": "en" + }, + { + "type": "string", + "enum": [ + "en-au" + ], + "title": "en-au" + }, + { + "type": "string", + "enum": [ + "en-bz" + ], + "title": "en-bz" + }, + { + "type": "string", + "enum": [ + "en-ca" + ], + "title": "en-ca" + }, + { + "type": "string", + "enum": [ + "en-gb" + ], + "title": "en-gb" + }, + { + "type": "string", + "enum": [ + "en-ie" + ], + "title": "en-ie" + }, + { + "type": "string", + "enum": [ + "en-jm" + ], + "title": "en-jm" + }, + { + "type": "string", + "enum": [ + "en-nz" + ], + "title": "en-nz" + }, + { + "type": "string", + "enum": [ + "en-tt" + ], + "title": "en-tt" + }, + { + "type": "string", + "enum": [ + "en-us" + ], + "title": "en-us" + }, + { + "type": "string", + "enum": [ + "en-za" + ], + "title": "en-za" + }, + { + "type": "string", + "enum": [ + "eo" + ], + "title": "eo" + }, + { + "type": "string", + "enum": [ + "es" + ], + "title": "es" + }, + { + "type": "string", + "enum": [ + "es-ar" + ], + "title": "es-ar" + }, + { + "type": "string", + "enum": [ + "es-bo" + ], + "title": "es-bo" + }, + { + "type": "string", + "enum": [ + "es-cl" + ], + "title": "es-cl" + }, + { + "type": "string", + "enum": [ + "es-co" + ], + "title": "es-co" + }, + { + "type": "string", + "enum": [ + "es-cr" + ], + "title": "es-cr" + }, + { + "type": "string", + "enum": [ + "es-do" + ], + "title": "es-do" + }, + { + "type": "string", + "enum": [ + "es-ec" + ], + "title": "es-ec" + }, + { + "type": "string", + "enum": [ + "es-gt" + ], + "title": "es-gt" + }, + { + "type": "string", + "enum": [ + "es-hn" + ], + "title": "es-hn" + }, + { + "type": "string", + "enum": [ + "es-mx" + ], + "title": "es-mx" + }, + { + "type": "string", + "enum": [ + "es-ni" + ], + "title": "es-ni" + }, + { + "type": "string", + "enum": [ + "es-pa" + ], + "title": "es-pa" + }, + { + "type": "string", + "enum": [ + "es-pe" + ], + "title": "es-pe" + }, + { + "type": "string", + "enum": [ + "es-pr" + ], + "title": "es-pr" + }, + { + "type": "string", + "enum": [ + "es-py" + ], + "title": "es-py" + }, + { + "type": "string", + "enum": [ + "es-sv" + ], + "title": "es-sv" + }, + { + "type": "string", + "enum": [ + "es-uy" + ], + "title": "es-uy" + }, + { + "type": "string", + "enum": [ + "es-ve" + ], + "title": "es-ve" + }, + { + "type": "string", + "enum": [ + "et" + ], + "title": "et" + }, + { + "type": "string", + "enum": [ + "eu" + ], + "title": "eu" + }, + { + "type": "string", + "enum": [ + "fa" + ], + "title": "fa" + }, + { + "type": "string", + "enum": [ + "fi" + ], + "title": "fi" + }, + { + "type": "string", + "enum": [ + "fo" + ], + "title": "fo" + }, + { + "type": "string", + "enum": [ + "fr" + ], + "title": "fr" + }, + { + "type": "string", + "enum": [ + "fr-be" + ], + "title": "fr-be" + }, + { + "type": "string", + "enum": [ + "fr-ca" + ], + "title": "fr-ca" + }, + { + "type": "string", + "enum": [ + "fr-ch" + ], + "title": "fr-ch" + }, + { + "type": "string", + "enum": [ + "fr-lu" + ], + "title": "fr-lu" + }, + { + "type": "string", + "enum": [ + "ga" + ], + "title": "ga" + }, + { + "type": "string", + "enum": [ + "gd" + ], + "title": "gd" + }, + { + "type": "string", + "enum": [ + "he" + ], + "title": "he" + }, + { + "type": "string", + "enum": [ + "hi" + ], + "title": "hi" + }, + { + "type": "string", + "enum": [ + "hr" + ], + "title": "hr" + }, + { + "type": "string", + "enum": [ + "hu" + ], + "title": "hu" + }, + { + "type": "string", + "enum": [ + "id" + ], + "title": "id" + }, + { + "type": "string", + "enum": [ + "is" + ], + "title": "is" + }, + { + "type": "string", + "enum": [ + "it" + ], + "title": "it" + }, + { + "type": "string", + "enum": [ + "it-ch" + ], + "title": "it-ch" + }, + { + "type": "string", + "enum": [ + "ja" + ], + "title": "ja" + }, + { + "type": "string", + "enum": [ + "ji" + ], + "title": "ji" + }, + { + "type": "string", + "enum": [ + "ko" + ], + "title": "ko" + }, + { + "type": "string", + "enum": [ + "ku" + ], + "title": "ku" + }, + { + "type": "string", + "enum": [ + "lt" + ], + "title": "lt" + }, + { + "type": "string", + "enum": [ + "lv" + ], + "title": "lv" + }, + { + "type": "string", + "enum": [ + "mk" + ], + "title": "mk" + }, + { + "type": "string", + "enum": [ + "ml" + ], + "title": "ml" + }, + { + "type": "string", + "enum": [ + "ms" + ], + "title": "ms" + }, + { + "type": "string", + "enum": [ + "mt" + ], + "title": "mt" + }, + { + "type": "string", + "enum": [ + "nb" + ], + "title": "nb" + }, + { + "type": "string", + "enum": [ + "ne" + ], + "title": "ne" + }, + { + "type": "string", + "enum": [ + "nl" + ], + "title": "nl" + }, + { + "type": "string", + "enum": [ + "nl-be" + ], + "title": "nl-be" + }, + { + "type": "string", + "enum": [ + "nn" + ], + "title": "nn" + }, + { + "type": "string", + "enum": [ + "no" + ], + "title": "no" + }, + { + "type": "string", + "enum": [ + "pa" + ], + "title": "pa" + }, + { + "type": "string", + "enum": [ + "pl" + ], + "title": "pl" + }, + { + "type": "string", + "enum": [ + "pt" + ], + "title": "pt" + }, + { + "type": "string", + "enum": [ + "pt-br" + ], + "title": "pt-br" + }, + { + "type": "string", + "enum": [ + "rm" + ], + "title": "rm" + }, + { + "type": "string", + "enum": [ + "ro" + ], + "title": "ro" + }, + { + "type": "string", + "enum": [ + "ro-md" + ], + "title": "ro-md" + }, + { + "type": "string", + "enum": [ + "ru" + ], + "title": "ru" + }, + { + "type": "string", + "enum": [ + "ru-md" + ], + "title": "ru-md" + }, + { + "type": "string", + "enum": [ + "sb" + ], + "title": "sb" + }, + { + "type": "string", + "enum": [ + "sk" + ], + "title": "sk" + }, + { + "type": "string", + "enum": [ + "sl" + ], + "title": "sl" + }, + { + "type": "string", + "enum": [ + "sq" + ], + "title": "sq" + }, + { + "type": "string", + "enum": [ + "sr" + ], + "title": "sr" + }, + { + "type": "string", + "enum": [ + "sv" + ], + "title": "sv" + }, + { + "type": "string", + "enum": [ + "sv-fi" + ], + "title": "sv-fi" + }, + { + "type": "string", + "enum": [ + "th" + ], + "title": "th" + }, + { + "type": "string", + "enum": [ + "tn" + ], + "title": "tn" + }, + { + "type": "string", + "enum": [ + "tr" + ], + "title": "tr" + }, + { + "type": "string", + "enum": [ + "ts" + ], + "title": "ts" + }, + { + "type": "string", + "enum": [ + "ua" + ], + "title": "ua" + }, + { + "type": "string", + "enum": [ + "ur" + ], + "title": "ur" + }, + { + "type": "string", + "enum": [ + "ve" + ], + "title": "ve" + }, + { + "type": "string", + "enum": [ + "vi" + ], + "title": "vi" + }, + { + "type": "string", + "enum": [ + "xh" + ], + "title": "xh" + }, + { + "type": "string", + "enum": [ + "zh-cn" + ], + "title": "zh-cn" + }, + { + "type": "string", + "enum": [ + "zh-hk" + ], + "title": "zh-hk" + }, + { + "type": "string", + "enum": [ + "zh-sg" + ], + "title": "zh-sg" + }, + { + "type": "string", + "enum": [ + "zh-tw" + ], + "title": "zh-tw" + }, + { + "type": "string", + "enum": [ + "zu" + ], + "title": "zu" + } + ] + }, + "subject": { + "description": "Subject of the email template. Can be up to 255 characters.", + "type": "string", + "example": "<SUBJECT>", + "nullable": true + }, + "message": { + "description": "Plain or HTML body of the email template message. Can be up to 10MB of content.", + "type": "string", + "example": "<MESSAGE>", + "nullable": true + }, + "senderName": { + "description": "Name of the email sender.", + "type": "string", + "example": "<SENDER_NAME>", + "nullable": true + }, + "senderEmail": { + "description": "Email of the sender. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "replyToEmail": { + "description": "Reply to email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "replyToName": { + "description": "Reply to name.", + "type": "string", + "example": "<REPLY_TO_NAME>", + "nullable": true + } + }, + "required": [ + "templateId" + ] + } + } + } + } + } + }, + "\/project\/templates\/email\/{templateId}": { + "get": { + "summary": "Get project email template", + "operationId": "projectGetEmailTemplate", + "tags": [ + "project" + ], + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details.", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "project\/get-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "templates.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession", + "required": true, + "schema": { + "type": "string", + "example": "verification", + "title": "ProjectEmailTemplateId", + "oneOf": [ + { + "type": "string", + "enum": [ + "verification" + ], + "title": "verification" + }, + { + "type": "string", + "enum": [ + "magicSession" + ], + "title": "magicSession" + }, + { + "type": "string", + "enum": [ + "recovery" + ], + "title": "recovery" + }, + { + "type": "string", + "enum": [ + "invitation" + ], + "title": "invitation" + }, + { + "type": "string", + "enum": [ + "mfaChallenge" + ], + "title": "mfaChallenge" + }, + { + "type": "string", + "enum": [ + "sessionAlert" + ], + "title": "sessionAlert" + }, + { + "type": "string", + "enum": [ + "otpSession" + ], + "title": "otpSession" + } + ] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Custom email template locale. If left empty, the fallback locale (en) will be used.", + "required": false, + "schema": { + "type": "string", + "example": "af", + "title": "ProjectEmailTemplateLocale", + "oneOf": [ + { + "type": "string", + "enum": [ + "af" + ], + "title": "af" + }, + { + "type": "string", + "enum": [ + "ar-ae" + ], + "title": "ar-ae" + }, + { + "type": "string", + "enum": [ + "ar-bh" + ], + "title": "ar-bh" + }, + { + "type": "string", + "enum": [ + "ar-dz" + ], + "title": "ar-dz" + }, + { + "type": "string", + "enum": [ + "ar-eg" + ], + "title": "ar-eg" + }, + { + "type": "string", + "enum": [ + "ar-iq" + ], + "title": "ar-iq" + }, + { + "type": "string", + "enum": [ + "ar-jo" + ], + "title": "ar-jo" + }, + { + "type": "string", + "enum": [ + "ar-kw" + ], + "title": "ar-kw" + }, + { + "type": "string", + "enum": [ + "ar-lb" + ], + "title": "ar-lb" + }, + { + "type": "string", + "enum": [ + "ar-ly" + ], + "title": "ar-ly" + }, + { + "type": "string", + "enum": [ + "ar-ma" + ], + "title": "ar-ma" + }, + { + "type": "string", + "enum": [ + "ar-om" + ], + "title": "ar-om" + }, + { + "type": "string", + "enum": [ + "ar-qa" + ], + "title": "ar-qa" + }, + { + "type": "string", + "enum": [ + "ar-sa" + ], + "title": "ar-sa" + }, + { + "type": "string", + "enum": [ + "ar-sy" + ], + "title": "ar-sy" + }, + { + "type": "string", + "enum": [ + "ar-tn" + ], + "title": "ar-tn" + }, + { + "type": "string", + "enum": [ + "ar-ye" + ], + "title": "ar-ye" + }, + { + "type": "string", + "enum": [ + "as" + ], + "title": "as" + }, + { + "type": "string", + "enum": [ + "az" + ], + "title": "az" + }, + { + "type": "string", + "enum": [ + "be" + ], + "title": "be" + }, + { + "type": "string", + "enum": [ + "bg" + ], + "title": "bg" + }, + { + "type": "string", + "enum": [ + "bh" + ], + "title": "bh" + }, + { + "type": "string", + "enum": [ + "bn" + ], + "title": "bn" + }, + { + "type": "string", + "enum": [ + "bs" + ], + "title": "bs" + }, + { + "type": "string", + "enum": [ + "ca" + ], + "title": "ca" + }, + { + "type": "string", + "enum": [ + "cs" + ], + "title": "cs" + }, + { + "type": "string", + "enum": [ + "cy" + ], + "title": "cy" + }, + { + "type": "string", + "enum": [ + "da" + ], + "title": "da" + }, + { + "type": "string", + "enum": [ + "de" + ], + "title": "de" + }, + { + "type": "string", + "enum": [ + "de-at" + ], + "title": "de-at" + }, + { + "type": "string", + "enum": [ + "de-ch" + ], + "title": "de-ch" + }, + { + "type": "string", + "enum": [ + "de-li" + ], + "title": "de-li" + }, + { + "type": "string", + "enum": [ + "de-lu" + ], + "title": "de-lu" + }, + { + "type": "string", + "enum": [ + "el" + ], + "title": "el" + }, + { + "type": "string", + "enum": [ + "en" + ], + "title": "en" + }, + { + "type": "string", + "enum": [ + "en-au" + ], + "title": "en-au" + }, + { + "type": "string", + "enum": [ + "en-bz" + ], + "title": "en-bz" + }, + { + "type": "string", + "enum": [ + "en-ca" + ], + "title": "en-ca" + }, + { + "type": "string", + "enum": [ + "en-gb" + ], + "title": "en-gb" + }, + { + "type": "string", + "enum": [ + "en-ie" + ], + "title": "en-ie" + }, + { + "type": "string", + "enum": [ + "en-jm" + ], + "title": "en-jm" + }, + { + "type": "string", + "enum": [ + "en-nz" + ], + "title": "en-nz" + }, + { + "type": "string", + "enum": [ + "en-tt" + ], + "title": "en-tt" + }, + { + "type": "string", + "enum": [ + "en-us" + ], + "title": "en-us" + }, + { + "type": "string", + "enum": [ + "en-za" + ], + "title": "en-za" + }, + { + "type": "string", + "enum": [ + "eo" + ], + "title": "eo" + }, + { + "type": "string", + "enum": [ + "es" + ], + "title": "es" + }, + { + "type": "string", + "enum": [ + "es-ar" + ], + "title": "es-ar" + }, + { + "type": "string", + "enum": [ + "es-bo" + ], + "title": "es-bo" + }, + { + "type": "string", + "enum": [ + "es-cl" + ], + "title": "es-cl" + }, + { + "type": "string", + "enum": [ + "es-co" + ], + "title": "es-co" + }, + { + "type": "string", + "enum": [ + "es-cr" + ], + "title": "es-cr" + }, + { + "type": "string", + "enum": [ + "es-do" + ], + "title": "es-do" + }, + { + "type": "string", + "enum": [ + "es-ec" + ], + "title": "es-ec" + }, + { + "type": "string", + "enum": [ + "es-gt" + ], + "title": "es-gt" + }, + { + "type": "string", + "enum": [ + "es-hn" + ], + "title": "es-hn" + }, + { + "type": "string", + "enum": [ + "es-mx" + ], + "title": "es-mx" + }, + { + "type": "string", + "enum": [ + "es-ni" + ], + "title": "es-ni" + }, + { + "type": "string", + "enum": [ + "es-pa" + ], + "title": "es-pa" + }, + { + "type": "string", + "enum": [ + "es-pe" + ], + "title": "es-pe" + }, + { + "type": "string", + "enum": [ + "es-pr" + ], + "title": "es-pr" + }, + { + "type": "string", + "enum": [ + "es-py" + ], + "title": "es-py" + }, + { + "type": "string", + "enum": [ + "es-sv" + ], + "title": "es-sv" + }, + { + "type": "string", + "enum": [ + "es-uy" + ], + "title": "es-uy" + }, + { + "type": "string", + "enum": [ + "es-ve" + ], + "title": "es-ve" + }, + { + "type": "string", + "enum": [ + "et" + ], + "title": "et" + }, + { + "type": "string", + "enum": [ + "eu" + ], + "title": "eu" + }, + { + "type": "string", + "enum": [ + "fa" + ], + "title": "fa" + }, + { + "type": "string", + "enum": [ + "fi" + ], + "title": "fi" + }, + { + "type": "string", + "enum": [ + "fo" + ], + "title": "fo" + }, + { + "type": "string", + "enum": [ + "fr" + ], + "title": "fr" + }, + { + "type": "string", + "enum": [ + "fr-be" + ], + "title": "fr-be" + }, + { + "type": "string", + "enum": [ + "fr-ca" + ], + "title": "fr-ca" + }, + { + "type": "string", + "enum": [ + "fr-ch" + ], + "title": "fr-ch" + }, + { + "type": "string", + "enum": [ + "fr-lu" + ], + "title": "fr-lu" + }, + { + "type": "string", + "enum": [ + "ga" + ], + "title": "ga" + }, + { + "type": "string", + "enum": [ + "gd" + ], + "title": "gd" + }, + { + "type": "string", + "enum": [ + "he" + ], + "title": "he" + }, + { + "type": "string", + "enum": [ + "hi" + ], + "title": "hi" + }, + { + "type": "string", + "enum": [ + "hr" + ], + "title": "hr" + }, + { + "type": "string", + "enum": [ + "hu" + ], + "title": "hu" + }, + { + "type": "string", + "enum": [ + "id" + ], + "title": "id" + }, + { + "type": "string", + "enum": [ + "is" + ], + "title": "is" + }, + { + "type": "string", + "enum": [ + "it" + ], + "title": "it" + }, + { + "type": "string", + "enum": [ + "it-ch" + ], + "title": "it-ch" + }, + { + "type": "string", + "enum": [ + "ja" + ], + "title": "ja" + }, + { + "type": "string", + "enum": [ + "ji" + ], + "title": "ji" + }, + { + "type": "string", + "enum": [ + "ko" + ], + "title": "ko" + }, + { + "type": "string", + "enum": [ + "ku" + ], + "title": "ku" + }, + { + "type": "string", + "enum": [ + "lt" + ], + "title": "lt" + }, + { + "type": "string", + "enum": [ + "lv" + ], + "title": "lv" + }, + { + "type": "string", + "enum": [ + "mk" + ], + "title": "mk" + }, + { + "type": "string", + "enum": [ + "ml" + ], + "title": "ml" + }, + { + "type": "string", + "enum": [ + "ms" + ], + "title": "ms" + }, + { + "type": "string", + "enum": [ + "mt" + ], + "title": "mt" + }, + { + "type": "string", + "enum": [ + "nb" + ], + "title": "nb" + }, + { + "type": "string", + "enum": [ + "ne" + ], + "title": "ne" + }, + { + "type": "string", + "enum": [ + "nl" + ], + "title": "nl" + }, + { + "type": "string", + "enum": [ + "nl-be" + ], + "title": "nl-be" + }, + { + "type": "string", + "enum": [ + "nn" + ], + "title": "nn" + }, + { + "type": "string", + "enum": [ + "no" + ], + "title": "no" + }, + { + "type": "string", + "enum": [ + "pa" + ], + "title": "pa" + }, + { + "type": "string", + "enum": [ + "pl" + ], + "title": "pl" + }, + { + "type": "string", + "enum": [ + "pt" + ], + "title": "pt" + }, + { + "type": "string", + "enum": [ + "pt-br" + ], + "title": "pt-br" + }, + { + "type": "string", + "enum": [ + "rm" + ], + "title": "rm" + }, + { + "type": "string", + "enum": [ + "ro" + ], + "title": "ro" + }, + { + "type": "string", + "enum": [ + "ro-md" + ], + "title": "ro-md" + }, + { + "type": "string", + "enum": [ + "ru" + ], + "title": "ru" + }, + { + "type": "string", + "enum": [ + "ru-md" + ], + "title": "ru-md" + }, + { + "type": "string", + "enum": [ + "sb" + ], + "title": "sb" + }, + { + "type": "string", + "enum": [ + "sk" + ], + "title": "sk" + }, + { + "type": "string", + "enum": [ + "sl" + ], + "title": "sl" + }, + { + "type": "string", + "enum": [ + "sq" + ], + "title": "sq" + }, + { + "type": "string", + "enum": [ + "sr" + ], + "title": "sr" + }, + { + "type": "string", + "enum": [ + "sv" + ], + "title": "sv" + }, + { + "type": "string", + "enum": [ + "sv-fi" + ], + "title": "sv-fi" + }, + { + "type": "string", + "enum": [ + "th" + ], + "title": "th" + }, + { + "type": "string", + "enum": [ + "tn" + ], + "title": "tn" + }, + { + "type": "string", + "enum": [ + "tr" + ], + "title": "tr" + }, + { + "type": "string", + "enum": [ + "ts" + ], + "title": "ts" + }, + { + "type": "string", + "enum": [ + "ua" + ], + "title": "ua" + }, + { + "type": "string", + "enum": [ + "ur" + ], + "title": "ur" + }, + { + "type": "string", + "enum": [ + "ve" + ], + "title": "ve" + }, + { + "type": "string", + "enum": [ + "vi" + ], + "title": "vi" + }, + { + "type": "string", + "enum": [ + "xh" + ], + "title": "xh" + }, + { + "type": "string", + "enum": [ + "zh-cn" + ], + "title": "zh-cn" + }, + { + "type": "string", + "enum": [ + "zh-hk" + ], + "title": "zh-hk" + }, + { + "type": "string", + "enum": [ + "zh-sg" + ], + "title": "zh-sg" + }, + { + "type": "string", + "enum": [ + "zh-tw" + ], + "title": "zh-tw" + }, + { + "type": "string", + "enum": [ + "zu" + ], + "title": "zu" + } + ], + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/project\/variables": { + "get": { + "summary": "List project variables", + "operationId": "projectListVariables", + "tags": [ + "project" + ], + "description": "Get a list of all project environment variables.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create project variable", + "operationId": "projectCreateVariable", + "tags": [ + "project" + ], + "description": "Create a new project environment variable. These variables can be accessed by all functions and sites in the project.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "variableId": { + "description": "Variable unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<VARIABLE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>" + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>" + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "variableId", + "key", + "value" + ] + } + } + } + } + } + }, + "\/project\/variables\/{variableId}": { + "get": { + "summary": "Get project variable", + "operationId": "projectGetVariable", + "tags": [ + "project" + ], + "description": "Get a variable by its unique ID. ", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update project variable", + "operationId": "projectUpdateVariable", + "tags": [ + "project" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>", + "nullable": true + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete project variable", + "operationId": "projectDeleteVariable", + "tags": [ + "project" + ], + "description": "Delete a variable by its unique ID. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "tags": [ + "projects" + ], + "description": "List all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "responses": { + "200": { + "description": "Dev Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKeyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "devKeys", + "demo": "projects\/list-dev-keys.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "devKeys.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: accessedAt, expire", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "tags": [ + "projects" + ], + "description": "Get a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "devKeys", + "demo": "projects\/get-dev-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "devKeys.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update dev key", + "operationId": "projectsUpdateDevKey", + "tags": [ + "projects" + ], + "description": "Update a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "devKeys", + "demo": "projects\/update-dev-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "devKeys.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Key name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "expire": { + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime" + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "tags": [ + "projects" + ], + "description": "Delete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "devKeys", + "demo": "projects\/delete-dev-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "devKeys.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/schedules": { + "get": { + "summary": "List schedules", + "operationId": "projectsListSchedules", + "tags": [ + "projects" + ], + "description": "Get a list of all the project's schedules. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Schedules List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/scheduleList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "schedules", + "demo": "projects\/list-schedules.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "schedules.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: resourceType, resourceId, projectId, schedule, active, region", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create schedule", + "operationId": "projectsCreateSchedule", + "tags": [ + "projects" + ], + "description": "Create a new schedule for a resource.", + "responses": { + "201": { + "description": "Schedule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/schedule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "schedules", + "demo": "projects\/create-schedule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "schedules.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resourceType": { + "description": "The resource type for the schedule. Possible values: function, execution, message.", + "type": "string", + "example": "function", + "title": "ScheduleResourceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "function" + ], + "title": "function" + }, + { + "type": "string", + "enum": [ + "execution" + ], + "title": "execution" + }, + { + "type": "string", + "enum": [ + "message" + ], + "title": "message" + } + ] + }, + "resourceId": { + "description": "The resource ID to associate with this schedule.", + "type": "string", + "example": "<RESOURCE_ID>" + }, + "schedule": { + "description": "Schedule CRON expression.", + "type": "string", + "example": "0 0 * * *" + }, + "active": { + "description": "Whether the schedule is active.", + "type": "boolean", + "default": false, + "example": false + }, + "data": { + "description": "Schedule data as a JSON string. Used to store resource-specific context needed for execution.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "resourceType", + "resourceId", + "schedule" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/schedules\/{scheduleId}": { + "get": { + "summary": "Get schedule", + "operationId": "projectsGetSchedule", + "tags": [ + "projects" + ], + "description": "Get a schedule by its unique ID.", + "responses": { + "200": { + "description": "Schedule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/schedule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "schedules", + "demo": "projects\/get-schedule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "schedules.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "scheduleId", + "description": "Schedule ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SCHEDULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/stages": { + "get": { + "summary": "List stages", + "operationId": "projectsListStages", + "tags": [ + "projects" + ], + "description": "Get the onboarding stages for the current project, including each stage\u2019s SDK method key and status (for example pending, completed, or skipped).\n", + "responses": { + "200": { + "description": "Stages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/stageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "stages", + "demo": "projects\/list-stages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "stages.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/stages\/{stageId}": { + "patch": { + "summary": "Update stage", + "operationId": "projectsUpdateStage", + "tags": [ + "projects" + ], + "description": "Update an onboarding stage for the current project. Use this endpoint to skip a stage or leave it unchanged without performing the related API action.\n", + "responses": { + "200": { + "description": "Stage", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/stage" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "stages", + "demo": "projects\/update-stage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "stages.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "stageId", + "description": "SDK method key (namespace.method).", + "required": true, + "schema": { + "type": "string", + "example": "<STAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "skip": { + "description": "Mark the stage as skipped.", + "type": "boolean", + "default": true, + "example": false + } + } + } + } + } + } + } + }, + "\/projects\/{projectId}\/team": { + "patch": { + "summary": "Update project team", + "operationId": "projectsUpdateTeam", + "tags": [ + "projects" + ], + "description": "Update the team ID of a project allowing for it to be transferred to another team.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "projects\/update-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "description": "Team ID of the team to transfer project to.", + "type": "string", + "example": "<TEAM_ID>" + } + }, + "required": [ + "teamId" + ] + } + } + } + } + } + }, + "\/proxy\/rules": { + "get": { + "summary": "List rules", + "operationId": "proxyListRules", + "tags": [ + "proxy" + ], + "description": "Get a list of all the proxy rules. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rule List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRuleList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/list-rules.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "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: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/proxy\/rules\/api": { + "post": { + "summary": "Create API rule", + "operationId": "proxyCreateAPIRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite's API on custom domain.\n\nRule ID is automatically generated as MD5 hash of a rule domain for performance purposes.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-api-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain name.", + "type": "string", + "example": "example.com" + } + }, + "required": [ + "domain" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/function": { + "post": { + "summary": "Create function rule", + "operationId": "proxyCreateFunctionRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for executing Appwrite Function on custom domain.\n\nRule ID is automatically generated as MD5 hash of a rule domain for performance purposes.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-function-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain name.", + "type": "string", + "example": "example.com" + }, + "functionId": { + "description": "ID of function to be executed.", + "type": "string", + "example": "<FUNCTION_ID>" + }, + "branch": { + "description": "Name of VCS branch to deploy changes automatically", + "type": "string", + "default": "", + "example": "<BRANCH>" + } + }, + "required": [ + "domain", + "functionId" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/redirect": { + "post": { + "summary": "Create redirect rule", + "operationId": "proxyCreateRedirectRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for to redirect from custom domain to another domain.\n\nRule ID is automatically generated as MD5 hash of a rule domain for performance purposes.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-redirect-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain name.", + "type": "string", + "example": "example.com" + }, + "url": { + "description": "Target URL of redirection", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + }, + "statusCode": { + "description": "Status code of redirection", + "type": "string", + "example": "301", + "title": "StatusCode", + "oneOf": [ + { + "type": "string", + "enum": [ + "301" + ], + "title": "MovedPermanently" + }, + { + "type": "string", + "enum": [ + "302" + ], + "title": "Found" + }, + { + "type": "string", + "enum": [ + "307" + ], + "title": "TemporaryRedirect" + }, + { + "type": "string", + "enum": [ + "308" + ], + "title": "PermanentRedirect" + } + ] + }, + "resourceId": { + "description": "ID of parent resource.", + "type": "string", + "example": "<RESOURCE_ID>" + }, + "resourceType": { + "description": "Type of parent resource.", + "type": "string", + "example": "site", + "title": "ProxyResourceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "site" + ], + "title": "Site" + }, + { + "type": "string", + "enum": [ + "function" + ], + "title": "Function" + } + ] + } + }, + "required": [ + "domain", + "url", + "statusCode", + "resourceId", + "resourceType" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/site": { + "post": { + "summary": "Create site rule", + "operationId": "proxyCreateSiteRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite Site on custom domain.\n\nRule ID is automatically generated as MD5 hash of a rule domain for performance purposes.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-site-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain name.", + "type": "string", + "example": "example.com" + }, + "siteId": { + "description": "ID of site to be executed.", + "type": "string", + "example": "<SITE_ID>" + }, + "branch": { + "description": "Name of VCS branch to deploy changes automatically", + "type": "string", + "default": "", + "example": "<BRANCH>" + } + }, + "required": [ + "domain", + "siteId" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/{ruleId}": { + "get": { + "summary": "Get rule", + "operationId": "proxyGetRule", + "tags": [ + "proxy" + ], + "description": "Get a proxy rule by its unique ID.", + "responses": { + "200": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/get-rule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RULE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete rule", + "operationId": "proxyDeleteRule", + "tags": [ + "proxy" + ], + "description": "Delete a proxy rule by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/delete-rule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/proxy\/rules\/{ruleId}\/status": { + "patch": { + "summary": "Update rule status", + "operationId": "proxyUpdateRuleStatus", + "tags": [ + "proxy" + ], + "description": "If not succeeded yet, retry verification process of a proxy rule domain. This endpoint triggers domain verification by checking DNS records. If verification is successful, a TLS certificate will be automatically provisioned for the domain asynchronously in the background.", + "responses": { + "200": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/update-rule-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/reports": { + "get": { + "summary": "List reports", + "operationId": "advisorListReports", + "tags": [ + "advisor" + ], + "description": "Get a list of all the project's analyzer reports. You can use the query params to filter your results.\n", + "responses": { + "200": { + "description": "Reports List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/reportList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "reports", + "demo": "advisor\/list-reports.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "reports.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: appId, type, targetType, target, analyzedAt", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/reports\/{reportId}": { + "get": { + "summary": "Get report", + "operationId": "advisorGetReport", + "tags": [ + "advisor" + ], + "description": "Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced.\n", + "responses": { + "200": { + "description": "Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/report" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "reports", + "demo": "advisor\/get-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "reports.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "reportId", + "description": "Report ID.", + "required": true, + "schema": { + "type": "string", + "example": "<REPORT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete report", + "operationId": "advisorDeleteReport", + "tags": [ + "advisor" + ], + "description": "Delete an analyzer report by its unique ID. Nested insights and CTA metadata are removed asynchronously by the deletes worker.\n", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "reports", + "demo": "advisor\/delete-report.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "projectId:{projectId},userId:{userId}", + "scope": "reports.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "reportId", + "description": "Report ID.", + "required": true, + "schema": { + "type": "string", + "example": "<REPORT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/reports\/{reportId}\/insights": { + "get": { + "summary": "List insights", + "operationId": "advisorListInsights", + "tags": [ + "advisor" + ], + "description": "List the insights produced under a single analyzer report. You can use the query params to filter your results further.\n", + "responses": { + "200": { + "description": "Insights List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/insightList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "insights", + "demo": "advisor\/list-insights.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "insights.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "reportId", + "description": "Parent report ID.", + "required": true, + "schema": { + "type": "string", + "example": "<REPORT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, severity, status, resourceType, resourceId, parentResourceType, parentResourceId, analyzedAt, dismissedAt, dismissedBy", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/reports\/{reportId}\/insights\/{insightId}": { + "get": { + "summary": "Get insight", + "operationId": "advisorGetInsight", + "tags": [ + "advisor" + ], + "description": "Get an insight by its unique ID, scoped to its parent report.\n", + "responses": { + "200": { + "description": "Insight", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/insight" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "insights", + "demo": "advisor\/get-insight.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "insights.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "reportId", + "description": "Parent report ID.", + "required": true, + "schema": { + "type": "string", + "example": "<REPORT_ID>" + }, + "in": "path" + }, + { + "name": "insightId", + "description": "Insight ID.", + "required": true, + "schema": { + "type": "string", + "example": "<INSIGHT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/siteList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "siteId": { + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<SITE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Site name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "framework": { + "description": "Sites framework.", + "type": "string", + "example": "analog", + "title": "Framework", + "oneOf": [ + { + "type": "string", + "enum": [ + "analog" + ], + "title": "analog" + }, + { + "type": "string", + "enum": [ + "angular" + ], + "title": "angular" + }, + { + "type": "string", + "enum": [ + "nextjs" + ], + "title": "nextjs" + }, + { + "type": "string", + "enum": [ + "react" + ], + "title": "react" + }, + { + "type": "string", + "enum": [ + "nuxt" + ], + "title": "nuxt" + }, + { + "type": "string", + "enum": [ + "vue" + ], + "title": "vue" + }, + { + "type": "string", + "enum": [ + "sveltekit" + ], + "title": "sveltekit" + }, + { + "type": "string", + "enum": [ + "astro" + ], + "title": "astro" + }, + { + "type": "string", + "enum": [ + "tanstack-start" + ], + "title": "tanstack-start" + }, + { + "type": "string", + "enum": [ + "remix" + ], + "title": "remix" + }, + { + "type": "string", + "enum": [ + "lynx" + ], + "title": "lynx" + }, + { + "type": "string", + "enum": [ + "flutter" + ], + "title": "flutter" + }, + { + "type": "string", + "enum": [ + "react-native" + ], + "title": "react-native" + }, + { + "type": "string", + "enum": [ + "vite" + ], + "title": "vite" + }, + { + "type": "string", + "enum": [ + "other" + ], + "title": "other" + } + ] + }, + "enabled": { + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "logging": { + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "type": "boolean", + "default": true, + "example": false + }, + "timeout": { + "description": "Maximum request time in seconds.", + "type": "integer", + "default": 30, + "example": 1, + "format": "int32" + }, + "installCommand": { + "description": "Install Command.", + "type": "string", + "default": "", + "example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "description": "Build Command.", + "type": "string", + "default": "", + "example": "<BUILD_COMMAND>" + }, + "startCommand": { + "description": "Custom start command. Leave empty to use default.", + "type": "string", + "default": "", + "example": "<START_COMMAND>" + }, + "outputDirectory": { + "description": "Output Directory for site.", + "type": "string", + "default": "", + "example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "description": "Runtime to use during build step.", + "type": "string", + "example": "node-14.5", + "title": "BuildRuntime", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "adapter": { + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "type": "string", + "default": "", + "example": "static", + "title": "Adapter", + "oneOf": [ + { + "type": "string", + "enum": [ + "static" + ], + "title": "static" + }, + { + "type": "string", + "enum": [ + "ssr" + ], + "title": "ssr" + } + ] + }, + "installationId": { + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "type": "string", + "default": "", + "example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "description": "Fallback file for single page application sites.", + "type": "string", + "default": "", + "example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "description": "Repository ID of the repo linked to the site.", + "type": "string", + "default": "", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "description": "Production branch for the repo linked to the site.", + "type": "string", + "default": "", + "example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "type": "boolean", + "default": false, + "example": false + }, + "providerRootDirectory": { + "description": "Path to site code in the linked repo.", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "providerBranches": { + "description": "List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "providerPaths": { + "description": "List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "buildSpecification": { + "description": "Build specification for the site deployments.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "runtimeSpecification": { + "description": "Runtime specification for the SSR executions.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "deploymentRetention": { + "description": "Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + }, + "scopes": { + "description": "List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed.", + "type": "array", + "default": [], + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + } + } + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/frameworkList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "frameworks", + "demo": "sites\/list-frameworks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "frameworks", + "demo": "sites\/list-specifications.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes.", + "required": false, + "schema": { + "type": "string", + "example": "runtimes", + "default": "runtimes" + }, + "in": "query" + } + ] + } + }, + "\/sites\/templates": { + "get": { + "summary": "List templates", + "operationId": "sitesListTemplates", + "tags": [ + "sites" + ], + "description": "List available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Site Templates List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateSiteList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "sites\/list-templates.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "frameworks", + "description": "List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "Framework", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "analog" + ], + "title": "analog" + }, + { + "type": "string", + "enum": [ + "angular" + ], + "title": "angular" + }, + { + "type": "string", + "enum": [ + "nextjs" + ], + "title": "nextjs" + }, + { + "type": "string", + "enum": [ + "react" + ], + "title": "react" + }, + { + "type": "string", + "enum": [ + "nuxt" + ], + "title": "nuxt" + }, + { + "type": "string", + "enum": [ + "vue" + ], + "title": "vue" + }, + { + "type": "string", + "enum": [ + "sveltekit" + ], + "title": "sveltekit" + }, + { + "type": "string", + "enum": [ + "astro" + ], + "title": "astro" + }, + { + "type": "string", + "enum": [ + "tanstack-start" + ], + "title": "tanstack-start" + }, + { + "type": "string", + "enum": [ + "remix" + ], + "title": "remix" + }, + { + "type": "string", + "enum": [ + "lynx" + ], + "title": "lynx" + }, + { + "type": "string", + "enum": [ + "flutter" + ], + "title": "flutter" + }, + { + "type": "string", + "enum": [ + "react-native" + ], + "title": "react-native" + }, + { + "type": "string", + "enum": [ + "vite" + ], + "title": "vite" + }, + { + "type": "string", + "enum": [ + "other" + ], + "title": "other" + } + ] + }, + "default": [] + }, + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "SiteTemplateUseCase", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "portfolio" + ], + "title": "portfolio" + }, + { + "type": "string", + "enum": [ + "starter" + ], + "title": "starter" + }, + { + "type": "string", + "enum": [ + "events" + ], + "title": "events" + }, + { + "type": "string", + "enum": [ + "ecommerce" + ], + "title": "ecommerce" + }, + { + "type": "string", + "enum": [ + "documentation" + ], + "title": "documentation" + }, + { + "type": "string", + "enum": [ + "blog" + ], + "title": "blog" + }, + { + "type": "string", + "enum": [ + "ai" + ], + "title": "ai" + }, + { + "type": "string", + "enum": [ + "forms" + ], + "title": "forms" + }, + { + "type": "string", + "enum": [ + "dashboard" + ], + "title": "dashboard" + } + ] + }, + "default": [] + }, + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1, + "default": 25 + }, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/sites\/templates\/{templateId}": { + "get": { + "summary": "Get site template", + "operationId": "sitesGetTemplate", + "tags": [ + "sites" + ], + "description": "Get a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Template Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateSite" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "sites\/get-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEMPLATE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Site name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "framework": { + "description": "Sites framework.", + "type": "string", + "example": "analog", + "title": "Framework", + "oneOf": [ + { + "type": "string", + "enum": [ + "analog" + ], + "title": "analog" + }, + { + "type": "string", + "enum": [ + "angular" + ], + "title": "angular" + }, + { + "type": "string", + "enum": [ + "nextjs" + ], + "title": "nextjs" + }, + { + "type": "string", + "enum": [ + "react" + ], + "title": "react" + }, + { + "type": "string", + "enum": [ + "nuxt" + ], + "title": "nuxt" + }, + { + "type": "string", + "enum": [ + "vue" + ], + "title": "vue" + }, + { + "type": "string", + "enum": [ + "sveltekit" + ], + "title": "sveltekit" + }, + { + "type": "string", + "enum": [ + "astro" + ], + "title": "astro" + }, + { + "type": "string", + "enum": [ + "tanstack-start" + ], + "title": "tanstack-start" + }, + { + "type": "string", + "enum": [ + "remix" + ], + "title": "remix" + }, + { + "type": "string", + "enum": [ + "lynx" + ], + "title": "lynx" + }, + { + "type": "string", + "enum": [ + "flutter" + ], + "title": "flutter" + }, + { + "type": "string", + "enum": [ + "react-native" + ], + "title": "react-native" + }, + { + "type": "string", + "enum": [ + "vite" + ], + "title": "vite" + }, + { + "type": "string", + "enum": [ + "other" + ], + "title": "other" + } + ] + }, + "enabled": { + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "logging": { + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "type": "boolean", + "default": true, + "example": false + }, + "timeout": { + "description": "Maximum request time in seconds.", + "type": "integer", + "default": 30, + "example": 1, + "format": "int32" + }, + "installCommand": { + "description": "Install Command.", + "type": "string", + "default": "", + "example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "description": "Build Command.", + "type": "string", + "default": "", + "example": "<BUILD_COMMAND>" + }, + "startCommand": { + "description": "Custom start command. Leave empty to use default.", + "type": "string", + "default": "", + "example": "<START_COMMAND>" + }, + "outputDirectory": { + "description": "Output Directory for site.", + "type": "string", + "default": "", + "example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "description": "Runtime to use during build step.", + "type": "string", + "default": "", + "example": "node-14.5", + "title": "BuildRuntime", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "adapter": { + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "type": "string", + "default": "", + "example": "static", + "title": "Adapter", + "oneOf": [ + { + "type": "string", + "enum": [ + "static" + ], + "title": "static" + }, + { + "type": "string", + "enum": [ + "ssr" + ], + "title": "ssr" + } + ] + }, + "fallbackFile": { + "description": "Fallback file for single page application sites.", + "type": "string", + "default": "", + "example": "<FALLBACK_FILE>" + }, + "installationId": { + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "type": "string", + "default": "", + "example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "description": "Repository ID of the repo linked to the site.", + "type": "string", + "default": "", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "description": "Production branch for the repo linked to the site.", + "type": "string", + "default": "", + "example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "type": "boolean", + "default": false, + "example": false + }, + "providerRootDirectory": { + "description": "Path to site code in the linked repo.", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "providerBranches": { + "description": "List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "providerPaths": { + "description": "List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "buildSpecification": { + "description": "Build specification for the site deployments.", + "type": "string", + "example": "s-1vcpu-512mb", + "nullable": true + }, + "runtimeSpecification": { + "description": "Runtime specification for the SSR executions.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "deploymentRetention": { + "description": "Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + }, + "scopes": { + "description": "List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed.", + "type": "array", + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + }, + "nullable": true + } + }, + "required": [ + "name", + "framework" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/update-site-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "description": "Deployment ID.", + "type": "string", + "example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/list-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/create-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": true, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "installCommand": { + "description": "Install Commands.", + "type": "string", + "example": "<INSTALL_COMMAND>", + "nullable": true + }, + "buildCommand": { + "description": "Build Commands.", + "type": "string", + "example": "<BUILD_COMMAND>", + "nullable": true + }, + "outputDirectory": { + "description": "Output Directory.", + "type": "string", + "example": "<OUTPUT_DIRECTORY>", + "nullable": true + }, + "code": { + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "type": "string", + "format": "binary" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "code" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/create-duplicate-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "description": "Deployment ID.", + "type": "string", + "example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/products\/sites\/templates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/create-template-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "description": "Repository name of the template.", + "type": "string", + "example": "<REPOSITORY>" + }, + "owner": { + "description": "The name of the owner of the template.", + "type": "string", + "example": "<OWNER>" + }, + "rootDirectory": { + "description": "Path to site code in the template repo.", + "type": "string", + "example": "<ROOT_DIRECTORY>" + }, + "type": { + "description": "Type for the reference provided. Can be commit, branch, or tag", + "type": "string", + "example": "branch", + "title": "TemplateReferenceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "branch" + ], + "title": "branch" + }, + { + "type": "string", + "enum": [ + "commit" + ], + "title": "commit" + }, + { + "type": "string", + "enum": [ + "tag" + ], + "title": "tag" + } + ] + }, + "reference": { + "description": "Reference value, can be a commit hash, branch name, or release tag", + "type": "string", + "example": "<REFERENCE>" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "type", + "reference" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/create-vcs-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "description": "Type of reference passed. Allowed values are: branch, commit", + "type": "string", + "example": "branch", + "title": "VCSReferenceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "branch" + ], + "title": "branch" + }, + { + "type": "string", + "enum": [ + "commit" + ], + "title": "commit" + }, + { + "type": "string", + "enum": [ + "tag" + ], + "title": "tag" + } + ] + }, + "reference": { + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "type": "string", + "example": "<REFERENCE>" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/get-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/delete-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "tags": [ + "sites" + ], + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/get-deployment-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "public", + "sites.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "example": "source", + "title": "DeploymentDownloadType", + "oneOf": [ + { + "type": "string", + "enum": [ + "source" + ], + "title": "source" + }, + { + "type": "string", + "enum": [ + "output" + ], + "title": "output" + } + ], + "default": "source" + }, + "in": "query" + }, + { + "name": "token", + "description": "Presigned source-download token for accessing this deployment without a session (jobs-service).", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/update-deployment-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "logs", + "demo": "sites\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "logs", + "demo": "sites\/get-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "example": "<LOG_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "logs", + "demo": "sites\/delete-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "produces": [ + "application\/json" + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "example": "<LOG_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "variableId": { + "description": "Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<VARIABLE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>" + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>" + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "variableId", + "key", + "value" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>", + "nullable": true + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucketList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<BUCKET_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Bucket name", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "fileSecurity": { + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "maximumFileSize": { + "description": "Maximum file size allowed in bytes. Maximum allowed value is 0B.", + "type": "integer", + "default": {}, + "example": 1, + "format": "int32" + }, + "allowedFileExtensions": { + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "compression": { + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "type": "string", + "default": "none", + "example": "none", + "title": "Compression", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "gzip" + ], + "title": "gzip" + }, + { + "type": "string", + "enum": [ + "zstd" + ], + "title": "zstd" + } + ] + }, + "encryption": { + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "type": "boolean", + "default": true, + "example": false + }, + "antivirus": { + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "type": "boolean", + "default": true, + "example": false + }, + "transformations": { + "description": "Are image transformations enabled?", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Bucket name", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "fileSecurity": { + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "maximumFileSize": { + "description": "Maximum file size allowed in bytes. Maximum allowed value is 0B.", + "type": "integer", + "default": {}, + "example": 1, + "format": "int32" + }, + "allowedFileExtensions": { + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "compression": { + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "type": "string", + "default": "none", + "example": "none", + "title": "Compression", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "gzip" + ], + "title": "gzip" + }, + { + "type": "string", + "enum": [ + "zstd" + ], + "title": "zstd" + } + ] + }, + "encryption": { + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "type": "boolean", + "default": true, + "example": false + }, + "antivirus": { + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "type": "boolean", + "default": true, + "example": false + }, + "transformations": { + "description": "Are image transformations enabled?", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<FILE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "file": { + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "type": "string", + "format": "binary" + }, + "permissions": { + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "folder": { + "description": "Virtual folder to place the file in, for example \"photos\/2026\". Nest folders with `\/`. Defaults to the bucket root.", + "type": "string", + "default": "", + "example": "photos\/2026" + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/update-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "File name.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "example": "center", + "title": "ImageGravity", + "oneOf": [ + { + "type": "string", + "enum": [ + "center" + ], + "title": "center" + }, + { + "type": "string", + "enum": [ + "top-left" + ], + "title": "top-left" + }, + { + "type": "string", + "enum": [ + "top" + ], + "title": "top" + }, + { + "type": "string", + "enum": [ + "top-right" + ], + "title": "top-right" + }, + { + "type": "string", + "enum": [ + "left" + ], + "title": "left" + }, + { + "type": "string", + "enum": [ + "right" + ], + "title": "right" + }, + { + "type": "string", + "enum": [ + "bottom-left" + ], + "title": "bottom-left" + }, + { + "type": "string", + "enum": [ + "bottom" + ], + "title": "bottom" + }, + { + "type": "string", + "enum": [ + "bottom-right" + ], + "title": "bottom-right" + } + ], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -360, + "default": 0 + }, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "example": "jpg", + "title": "ImageFormat", + "oneOf": [ + { + "type": "string", + "enum": [ + "jpg" + ], + "title": "jpg" + }, + { + "type": "string", + "enum": [ + "jpeg" + ], + "title": "jpeg" + }, + { + "type": "string", + "enum": [ + "png" + ], + "title": "png" + }, + { + "type": "string", + "enum": [ + "webp" + ], + "title": "webp" + }, + { + "type": "string", + "enum": [ + "heic" + ], + "title": "heic" + }, + { + "type": "string", + "enum": [ + "avif" + ], + "title": "avif" + }, + { + "type": "string", + "enum": [ + "gif" + ], + "title": "gif" + } + ], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DATABASE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "tablesDBListTransactions", + "tags": [ + "tablesDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.read", + "rows.read" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "tablesDBCreateTransaction", + "tags": [ + "tablesDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/tablesdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "tablesDBGetTransaction", + "tags": [ + "tablesDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.read", + "rows.read" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "tablesDBUpdateTransaction", + "tags": [ + "tablesDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "tablesDBDeleteTransaction", + "tags": [ + "tablesDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "tablesDBCreateOperations", + "tags": [ + "tablesDB" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/tableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "tableId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TABLE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Table name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "rowSecurity": { + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "columns": { + "description": "Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "indexes": { + "description": "Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC\/DESC, optional), and lengths (array of integers, optional).", + "type": "array", + "default": [], + "items": { + "type": "object" + } + } + }, + "required": [ + "tableId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Table name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "rowSecurity": { + "description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "purge": { + "description": "When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read", + "columns.read", + "attributes.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/bigint": { + "post": { + "summary": "Create bigint column", + "operationId": "tablesDBCreateBigIntColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a bigint column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnBigInt", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBigint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-big-int-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 1000000, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/bigint\/{key}": { + "patch": { + "summary": "Update bigint column", + "operationId": "tablesDBUpdateBigIntColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a bigint column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnBigInt", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBigint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-big-int-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 1000000, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "boolean", + "example": false, + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "boolean", + "example": false, + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update datetime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "elements": { + "description": "Array of enum values.", + "type": "array", + "example": [ + "active", + "inactive" + ], + "items": { + "type": "string" + } + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "active", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "description": "Updated list of enum values.", + "type": "array", + "example": [ + "active", + "inactive" + ], + "items": { + "type": "string" + } + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "active", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when required.", + "type": "number", + "example": 10.5, + "format": "float", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when required.", + "type": "number", + "example": 10.5, + "format": "float", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 100, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "integer", + "example": 10, + "format": "int64", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 100, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "integer", + "example": 10, + "format": "int64", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "string", + "example": "192.0.2.0", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "string", + "example": "192.0.2.0", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "type": "array", + "example": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "type": "array", + "example": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/longtext": { + "post": { + "summary": "Create longtext column", + "operationId": "tablesDBCreateLongtextColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a longtext column.\n", + "responses": { + "202": { + "description": "ColumnLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLongtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-longtext-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/longtext\/{key}": { + "patch": { + "summary": "Update longtext column", + "operationId": "tablesDBUpdateLongtextColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a longtext column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLongtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-longtext-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/mediumtext": { + "post": { + "summary": "Create mediumtext column", + "operationId": "tablesDBCreateMediumtextColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a mediumtext column.\n", + "responses": { + "202": { + "description": "ColumnMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnMediumtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-mediumtext-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/mediumtext\/{key}": { + "patch": { + "summary": "Update mediumtext column", + "operationId": "tablesDBUpdateMediumtextColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a mediumtext column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnMediumtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-mediumtext-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "type": "array", + "example": [ + 1, + 2 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "type": "array", + "example": [ + 1, + 2 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "type": "array", + "example": [ + [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ], + [ + 1, + 2 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "type": "array", + "example": [ + [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ], + [ + 1, + 2 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "description": "Related Table ID.", + "type": "string", + "example": "<RELATED_TABLE_ID>" + }, + "type": { + "description": "Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany.", + "type": "string", + "example": "oneToOne", + "title": "RelationshipType", + "oneOf": [ + { + "type": "string", + "enum": [ + "oneToOne" + ], + "title": "oneToOne" + }, + { + "type": "string", + "enum": [ + "manyToOne" + ], + "title": "manyToOne" + }, + { + "type": "string", + "enum": [ + "manyToMany" + ], + "title": "manyToMany" + }, + { + "type": "string", + "enum": [ + "oneToMany" + ], + "title": "oneToMany" + } + ] + }, + "twoWay": { + "description": "Is Two Way?", + "type": "boolean", + "default": false, + "example": false + }, + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "twoWayKey": { + "description": "Two Way Column Key.", + "type": "string", + "example": "<TWO_WAY_KEY>", + "nullable": true + }, + "onDelete": { + "description": "Delete constraint. Possible values are: cascade, restrict, setNull.", + "type": "string", + "default": "restrict", + "example": "cascade", + "title": "RelationMutate", + "oneOf": [ + { + "type": "string", + "enum": [ + "cascade" + ], + "title": "cascade" + }, + { + "type": "string", + "enum": [ + "restrict" + ], + "title": "restrict" + }, + { + "type": "string", + "enum": [ + "setNull" + ], + "title": "setNull" + } + ] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.9.0", + "replaceWith": "tablesDB.createTextColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "size": { + "description": "Column size for text columns, in number of characters.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTextColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "size": { + "description": "Maximum size of the string column.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/text": { + "post": { + "summary": "Create text column", + "operationId": "tablesDBCreateTextColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a text column.\n", + "responses": { + "202": { + "description": "ColumnText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnText" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-text-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/text\/{key}": { + "patch": { + "summary": "Update text column", + "operationId": "tablesDBUpdateTextColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a text column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnText" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-text-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/varchar": { + "post": { + "summary": "Create varchar column", + "operationId": "tablesDBCreateVarcharColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a varchar column.\n", + "responses": { + "202": { + "description": "ColumnVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnVarchar" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-varchar-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "size": { + "description": "Column size for varchar columns, in number of characters. Maximum size is 16381.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/varchar\/{key}": { + "patch": { + "summary": "Update varchar column", + "operationId": "tablesDBUpdateVarcharColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a varchar column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnVarchar" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-varchar-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "size": { + "description": "Maximum size of the varchar column.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/columnBoolean", + "integer": "#\/components\/schemas\/columnInteger", + "double": "#\/components\/schemas\/columnFloat", + "string": "#\/components\/schemas\/columnString", + "datetime": "#\/components\/schemas\/columnDatetime", + "relationship": "#\/components\/schemas\/columnRelationship" + }, + "x-mapping": { + "#\/components\/schemas\/columnBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/columnInteger": { + "type": "integer" + }, + "#\/components\/schemas\/columnFloat": { + "type": "double" + }, + "#\/components\/schemas\/columnEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/columnEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/columnUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/columnIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/columnDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/columnRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/columnString": { + "type": "string" + } + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read", + "columns.read", + "attributes.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "description": "Delete constraint. Possible values are: cascade, restrict, setNull.", + "type": "string", + "example": "cascade", + "title": "RelationMutate", + "oneOf": [ + { + "type": "string", + "enum": [ + "cascade" + ], + "title": "cascade" + }, + { + "type": "string", + "enum": [ + "restrict" + ], + "title": "restrict" + }, + { + "type": "string", + "enum": [ + "setNull" + ], + "title": "setNull" + } + ], + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read", + "indexes.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "indexes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Index Key.", + "type": "string", + "example": "<KEY>" + }, + "type": { + "description": "Index type.", + "type": "string", + "example": "key", + "title": "TablesDBIndexType", + "oneOf": [ + { + "type": "string", + "enum": [ + "key" + ], + "title": "key" + }, + { + "type": "string", + "enum": [ + "fulltext" + ], + "title": "fulltext" + }, + { + "type": "string", + "enum": [ + "unique" + ], + "title": "unique" + }, + { + "type": "string", + "enum": [ + "spatial" + ], + "title": "spatial" + } + ] + }, + "columns": { + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "orders": { + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "type": "array", + "default": [], + "items": { + "title": "OrderBy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ] + } + }, + "lengths": { + "description": "Length of index. Maximum of 100", + "type": "array", + "default": [], + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read", + "indexes.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "indexes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/products\/databases\/tables#create-table).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md", + "public": true + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<ROW_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Row data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "rows": { + "description": "Array of rows data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "rowId", + "data" + ] + } + } + } + } + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rows": { + "description": "Array of row data as JSON objects. May contain partial rows.", + "type": "array", + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "rows" + ] + } + } + } + } + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string", + "example": "<COLUMN>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the column by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string", + "example": "<COLUMN>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the column by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TEAM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Team name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "roles": { + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "type": "array", + "default": [ + "owner" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "New team name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/list-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/create-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "Email of the new team member.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "userId": { + "description": "ID of the user to be added to a team.", + "type": "string", + "default": "", + "example": "<USER_ID>" + }, + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "roles": { + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 81 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project 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.", + "type": "string", + "default": "", + "example": "https:\/\/example.com", + "format": "url" + }, + "name": { + "description": "Name of the new team member. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/get-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update team membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/update-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 81 characters long.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/delete-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/update-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Secret key.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update team preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "description": "Prefs key-value JSON object.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "tokens\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "tokens\/create-file-token.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "description": "Token expiry date", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "tokens\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "tokens\/update.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "description": "File token expiry date", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "tokens\/delete.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/usage\/events": { + "get": { + "summary": "List usage events", + "operationId": "usageListEvents", + "tags": [ + "usage" + ], + "description": "Aggregate usage event metrics. `metrics[]` (1-10) is required; the response always contains one entry per requested metric, each with its own `points[]` time series.\n\n**Two response shapes**:\n- Omit `interval` for a flat top-N table \u2014 one point per dimension combination, no time axis. Useful for \"top 10 paths by bandwidth in the last 7 days\".\n- Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series \u2014 one point per (time bucket \u00d7 dimension combination).\n\n`dimensions[]` breaks each point down by one or more attributes. `queries[]` filters the underlying events using standard Utopia query syntax. Pass multiple metrics to render stacked charts in one round-trip. When `startAt` is omitted, the default window adapts to `interval` (or 7d when interval is omitted).", + "responses": { + "200": { + "description": "usageEventList", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageEventList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "events", + "demo": "usage\/list-events.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "projectId:{project.$id}", + "scope": "usage.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "metrics", + "description": "One to ten metric names. Single-metric callers pass a one-element array.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "queries", + "description": "Up to 10 filter queries in Utopia syntax. Allowed attributes, also published as the `UsageEventDimension` enum: path, method, status, service, resourceType, resourceId, country, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion. Allowed methods: equal, notEqual, contains, startsWith, endsWith, isNull, isNotNull. Example: `queries[]=equal(\"resourceType\", [\"bucket\"])`.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "interval", + "description": "Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.", + "required": false, + "schema": { + "type": "string", + "example": "1m", + "title": "UsageInterval", + "oneOf": [ + { + "type": "string", + "enum": [ + "1m" + ], + "title": "One Minute" + }, + { + "type": "string", + "enum": [ + "15m" + ], + "title": "Fifteen Minutes" + }, + { + "type": "string", + "enum": [ + "30m" + ], + "title": "Thirty Minutes" + }, + { + "type": "string", + "enum": [ + "1h" + ], + "title": "One Hour" + }, + { + "type": "string", + "enum": [ + "1d" + ], + "title": "One Day" + } + ] + }, + "in": "query" + }, + { + "name": "dimensions", + "description": "Break-down dimensions (max 10). Allowed: path, method, status, service, resourceType, country, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion, resourceId.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "UsageEventDimension", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "path" + ], + "title": "path" + }, + { + "type": "string", + "enum": [ + "method" + ], + "title": "method" + }, + { + "type": "string", + "enum": [ + "status" + ], + "title": "status" + }, + { + "type": "string", + "enum": [ + "service" + ], + "title": "service" + }, + { + "type": "string", + "enum": [ + "resourceType" + ], + "title": "resourceType" + }, + { + "type": "string", + "enum": [ + "country" + ], + "title": "country" + }, + { + "type": "string", + "enum": [ + "region" + ], + "title": "region" + }, + { + "type": "string", + "enum": [ + "hostname" + ], + "title": "hostname" + }, + { + "type": "string", + "enum": [ + "ip" + ], + "title": "ip" + }, + { + "type": "string", + "enum": [ + "osName" + ], + "title": "osName" + }, + { + "type": "string", + "enum": [ + "clientType" + ], + "title": "clientType" + }, + { + "type": "string", + "enum": [ + "clientName" + ], + "title": "clientName" + }, + { + "type": "string", + "enum": [ + "deviceName" + ], + "title": "deviceName" + }, + { + "type": "string", + "enum": [ + "sdk" + ], + "title": "sdk" + }, + { + "type": "string", + "enum": [ + "sdkVersion" + ], + "title": "sdkVersion" + }, + { + "type": "string", + "enum": [ + "resourceId" + ], + "title": "resourceId" + } + ] + }, + "default": [] + }, + "in": "query" + }, + { + "name": "startAt", + "description": "Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).", + "required": false, + "schema": { + "type": "string", + "format": "datetime", + "example": "2020-10-15T06:38:00.000+00:00", + "default": "" + }, + "in": "query" + }, + { + "name": "endAt", + "description": "Range end in ISO 8601. Defaults to the current time.", + "required": false, + "schema": { + "type": "string", + "format": "datetime", + "example": "2020-10-15T06:38:00.000+00:00", + "default": "" + }, + "in": "query" + }, + { + "name": "orderBy", + "description": "Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.", + "required": false, + "schema": { + "type": "string", + "example": "time", + "title": "UsageOrderBy", + "oneOf": [ + { + "type": "string", + "enum": [ + "time" + ], + "title": "time" + }, + { + "type": "string", + "enum": [ + "value" + ], + "title": "value" + } + ], + "default": "time" + }, + "in": "query" + }, + { + "name": "orderDir", + "description": "Sort direction: asc or desc. Default desc \u2014 paired with the default limit, returns the most recent \/ highest-value groups first.", + "required": false, + "schema": { + "type": "string", + "example": "asc", + "title": "UsageOrderDirection", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ], + "default": "desc" + }, + "in": "query" + }, + { + "name": "limit", + "description": "Maximum rows to return (1-5000).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1, + "default": 500 + }, + "in": "query" + }, + { + "name": "offset", + "description": "Pagination offset (0-100000).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/usage\/gauges": { + "get": { + "summary": "List usage gauges", + "operationId": "usageListGauges", + "tags": [ + "usage" + ], + "description": "Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, \u2026); each point carries the latest snapshot in its interval via `argMax(value, time)`. `metrics[]` (1-10) is required; the response always contains one entry per requested metric, each with its own `points[]` time series.\n\nA metric with no stored samples in the window returns an empty `points[]`. A metric that really did read zero returns a point whose `value` is `0`, so \"no such series\" and \"a genuine zero\" are different answers.\n\n**Two response shapes**:\n- Omit `interval` for a flat top-N table \u2014 `argMax(value, time)` per dimension combination over the whole window, no time axis. Useful for \"top 10 resources by current storage\".\n- Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series \u2014 one snapshot per (time bucket \u00d7 dimension combination).\n\n`dimensions[]` breaks each point down by resource, service, resource type, or ordinal. `queries[]` filters rows using standard Utopia query syntax. Pass multiple metrics to render stacked charts in one round-trip. When `startAt` is omitted, the default window adapts to interval (or 7d when interval is omitted).\n\n`aggregate` selects how the samples in a bucket are combined: `last` (default) is the latest reading \u2014 correct for a snapshot such as storage \u2014 while `max` is the highest reading. Use `max` for a sampled level series: peak concurrent realtime connections is `metrics[]=realtime.connections&aggregate=max`, at whatever `interval` the chart needs, since the peak of a set of samples is just the max of their per-bucket maxima. `realtime.connections` is served only here - it is a concurrency level, not a countable event, so `\/v1\/usage\/events` rejects it.", + "responses": { + "200": { + "description": "usageGaugeList", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageGaugeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "gauges", + "demo": "usage\/list-gauges.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "projectId:{project.$id}", + "scope": "usage.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "metrics", + "description": "One to ten metric names. Single-metric callers pass a one-element array.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "queries", + "description": "Up to 10 filter queries in Utopia syntax. Allowed attributes, also published as the `UsageGaugeDimension` enum: service, resourceType, resourceId, ordinal. Allowed methods: equal, notEqual, isNull, isNotNull. Example: `queries[]=equal(\"resourceType\", [\"bucket\"])`.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "interval", + "description": "Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.", + "required": false, + "schema": { + "type": "string", + "example": "1m", + "title": "UsageInterval", + "oneOf": [ + { + "type": "string", + "enum": [ + "1m" + ], + "title": "One Minute" + }, + { + "type": "string", + "enum": [ + "15m" + ], + "title": "Fifteen Minutes" + }, + { + "type": "string", + "enum": [ + "30m" + ], + "title": "Thirty Minutes" + }, + { + "type": "string", + "enum": [ + "1h" + ], + "title": "One Hour" + }, + { + "type": "string", + "enum": [ + "1d" + ], + "title": "One Day" + } + ] + }, + "in": "query" + }, + { + "name": "dimensions", + "description": "Break-down dimensions. Allowed: resourceId, service, resourceType, ordinal.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "UsageGaugeDimension", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "resourceId" + ], + "title": "resourceId" + }, + { + "type": "string", + "enum": [ + "service" + ], + "title": "service" + }, + { + "type": "string", + "enum": [ + "resourceType" + ], + "title": "resourceType" + }, + { + "type": "string", + "enum": [ + "ordinal" + ], + "title": "ordinal" + } + ] + }, + "default": [] + }, + "in": "query" + }, + { + "name": "startAt", + "description": "Range start in ISO 8601. Defaults to endAt - 7d.", + "required": false, + "schema": { + "type": "string", + "format": "datetime", + "example": "2020-10-15T06:38:00.000+00:00", + "default": "" + }, + "in": "query" + }, + { + "name": "endAt", + "description": "Range end in ISO 8601. Defaults to the current time.", + "required": false, + "schema": { + "type": "string", + "format": "datetime", + "example": "2020-10-15T06:38:00.000+00:00", + "default": "" + }, + "in": "query" + }, + { + "name": "orderBy", + "description": "Column to order by. Allowed: time, value. Default time.", + "required": false, + "schema": { + "type": "string", + "example": "time", + "title": "UsageOrderBy", + "oneOf": [ + { + "type": "string", + "enum": [ + "time" + ], + "title": "time" + }, + { + "type": "string", + "enum": [ + "value" + ], + "title": "value" + } + ], + "default": "time" + }, + "in": "query" + }, + { + "name": "orderDir", + "description": "Sort direction: asc or desc. Default desc \u2014 paired with the default limit, this returns the most recent groups first. Pass asc for chronological charting.", + "required": false, + "schema": { + "type": "string", + "example": "asc", + "title": "UsageOrderDirection", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ], + "default": "desc" + }, + "in": "query" + }, + { + "name": "limit", + "description": "Maximum rows to return (1-5000).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1, + "default": 500 + }, + "in": "query" + }, + { + "name": "offset", + "description": "Pagination offset (0-100000).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "aggregate", + "description": "How to combine the samples in each bucket. `last` (default) returns the latest reading \u2014 the right answer for a snapshot such as storage. `max` returns the highest reading, which is what a sampled level series needs: peak concurrent realtime connections is the max of `realtime.connections` over the window.", + "required": false, + "schema": { + "type": "string", + "example": "last", + "default": "last" + }, + "in": "query" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/userList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator, accessedAt", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "example": "+12065550100", + "format": "phone", + "nullable": true + }, + "password": { + "description": "Plain text user password. Must be at least 8 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + } + } + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-argon-2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using Argon2.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using Bcrypt.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-md-5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using MD5.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-ph-pass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using PHPass.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using Scrypt.", + "type": "string", + "example": "password", + "format": "password" + }, + "passwordSalt": { + "description": "Optional salt used to hash password.", + "type": "string", + "example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "description": "Optional CPU cost used to hash password.", + "type": "integer", + "example": 8, + "format": "int32" + }, + "passwordMemory": { + "description": "Optional memory cost used to hash password.", + "type": "integer", + "example": 65536, + "format": "int32" + }, + "passwordParallel": { + "description": "Optional parallelization cost used to hash password.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "passwordLength": { + "description": "Optional hash length used to hash password.", + "type": "integer", + "example": 64, + "format": "int32" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + } + } + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using Scrypt Modified.", + "type": "string", + "example": "password", + "format": "password" + }, + "passwordSalt": { + "description": "Salt used to hash password.", + "type": "string", + "example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "description": "Salt separator used to hash password.", + "type": "string", + "example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "description": "Signer key used to hash password.", + "type": "string", + "example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + } + } + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using SHA.", + "type": "string", + "example": "password", + "format": "password" + }, + "passwordVersion": { + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "type": "string", + "default": "", + "example": "sha1", + "title": "PasswordHash", + "oneOf": [ + { + "type": "string", + "enum": [ + "sha1" + ], + "title": "sha1" + }, + { + "type": "string", + "enum": [ + "sha224" + ], + "title": "sha224" + }, + { + "type": "string", + "enum": [ + "sha256" + ], + "title": "sha256" + }, + { + "type": "string", + "enum": [ + "sha384" + ], + "title": "sha384" + }, + { + "type": "string", + "enum": [ + "sha512\/224" + ], + "title": "sha512\/224" + }, + { + "type": "string", + "enum": [ + "sha512\/256" + ], + "title": "sha512\/256" + }, + { + "type": "string", + "enum": [ + "sha512" + ], + "title": "sha512" + }, + { + "type": "string", + "enum": [ + "sha3-224" + ], + "title": "sha3-224" + }, + { + "type": "string", + "enum": [ + "sha3-256" + ], + "title": "sha3-256" + }, + { + "type": "string", + "enum": [ + "sha3-384" + ], + "title": "sha3-384" + }, + { + "type": "string", + "enum": [ + "sha3-512" + ], + "title": "sha3-512" + } + ] + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + } + }, + "required": [ + "email" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/impersonator": { + "patch": { + "summary": "Update user impersonator capability", + "operationId": "usersUpdateImpersonator", + "tags": [ + "users" + ], + "description": "Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-impersonator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "impersonator": { + "description": "Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.", + "type": "boolean", + "example": false + } + }, + "required": [ + "impersonator" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/create-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "sessionId": { + "description": "Session ID. Use the string 'recent()' to use the most recent session, which is also the default.", + "type": "string", + "default": "recent()", + "example": "recent()" + }, + "duration": { + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "type": "integer", + "default": 900, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "users\/list-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "users", + "demo": "users\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "description": "Enable or disable MFA.", + "type": "boolean", + "example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/challenges\/{challengeId}": { + "get": { + "summary": "Get MFA challenge", + "operationId": "usersGetMFAChallenge", + "tags": [ + "users" + ], + "description": "Get a custom MFA challenge for a user, including the code to be delivered through your own channel.", + "responses": { + "200": { + "description": "MFA Challenge Secret", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallengeSecret" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mfa", + "demo": "users\/get-mfa-challenge.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "getMFAChallenge", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "challengeId" + ], + "required": [ + "userId", + "challengeId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaChallengeSecret" + } + ], + "description": "", + "demo": "users\/get-mfa-challenge.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "challengeId", + "description": "ID of the challenge.", + "required": true, + "schema": { + "type": "string", + "example": "<CHALLENGE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "public": false + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "description": "New user password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "description": "User phone number.", + "type": "string", + "example": "+12065550100", + "format": "phone" + } + }, + "required": [ + "number" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "description": "Prefs key-value JSON object.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "users.read", + "sessions.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "users.write", + "sessions.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "schema": { + "type": "string", + "x-appwrite": { + "idGenerator": "ID.unique" + }, + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/delete-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "users.write", + "sessions.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/delete-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "users.write", + "sessions.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "type": "boolean", + "example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/list-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TARGET_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "providerType": { + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "type": "string", + "example": "email", + "title": "MessagingProviderType", + "oneOf": [ + { + "type": "string", + "enum": [ + "email" + ], + "title": "email" + }, + { + "type": "string", + "enum": [ + "sms" + ], + "title": "sms" + }, + { + "type": "string", + "enum": [ + "push" + ], + "title": "push" + } + ] + }, + "identifier": { + "description": "The target identifier (token, email, phone etc.)", + "type": "string", + "example": "<IDENTIFIER>" + }, + "providerId": { + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "type": "string", + "default": "", + "example": "<PROVIDER_ID>" + }, + "name": { + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/get-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "description": "The target identifier (token, email, phone etc.)", + "type": "string", + "default": "", + "example": "<IDENTIFIER>" + }, + "providerId": { + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "type": "string", + "default": "", + "example": "<PROVIDER_ID>" + }, + "name": { + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "type": "string", + "default": "", + "example": "<NAME>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "length": { + "description": "Token length in characters. The default length is 6 characters", + "type": "integer", + "default": 6, + "example": 4, + "format": "int32" + }, + "expire": { + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "type": "integer", + "default": 900, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "description": "User email verification status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "description": "User phone verification status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/detections": { + "post": { + "summary": "Create repository detection", + "operationId": "vcsCreateRepositoryDetection", + "tags": [ + "vcs" + ], + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", + "responses": { + "200": { + "description": "DetectionRuntime, or DetectionFramework", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/detectionRuntime" + }, + { + "$ref": "#\/components\/schemas\/detectionFramework" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "runtime": "#\/components\/schemas\/detectionRuntime", + "framework": "#\/components\/schemas\/detectionFramework" + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "repositories", + "demo": "vcs\/create-repository-detection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerRepositoryId": { + "description": "Repository Id", + "type": "string", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "type": { + "description": "Detector type. Must be one of the following: runtime, framework", + "type": "string", + "example": "runtime", + "title": "VCSDetectionType", + "oneOf": [ + { + "type": "string", + "enum": [ + "runtime" + ], + "title": "runtime" + }, + { + "type": "string", + "enum": [ + "framework" + ], + "title": "framework" + } + ] + }, + "providerRootDirectory": { + "description": "Path to Root Directory", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + } + }, + "required": [ + "providerRepositoryId", + "type" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories": { + "get": { + "summary": "List repositories", + "operationId": "vcsListRepositories", + "tags": [ + "vcs" + ], + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", + "responses": { + "200": { + "description": "Runtime Provider Repositories List, or Framework Provider Repositories List", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/providerRepositoryRuntimeList" + }, + { + "$ref": "#\/components\/schemas\/providerRepositoryFrameworkList" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "runtime": "#\/components\/schemas\/providerRepositoryRuntimeList", + "framework": "#\/components\/schemas\/providerRepositoryFrameworkList" + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "repositories", + "demo": "vcs\/list-repositories.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Detector type. Must be one of the following: runtime, framework", + "required": true, + "schema": { + "type": "string", + "example": "runtime", + "title": "VCSDetectionType", + "oneOf": [ + { + "type": "string", + "enum": [ + "runtime" + ], + "title": "runtime" + }, + { + "type": "string", + "enum": [ + "framework" + ], + "title": "framework" + } + ] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit, offset, and equal on namespace.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create repository", + "operationId": "vcsCreateRepository", + "tags": [ + "vcs" + ], + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", + "responses": { + "200": { + "description": "ProviderRepository", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerRepository" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "repositories", + "demo": "vcs\/create-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Repository name (slug)", + "type": "string", + "example": "<NAME>" + }, + "private": { + "description": "Mark repository public or private", + "type": "boolean", + "example": false + }, + "providerNamespace": { + "description": "Namespace of the git repository. Defaults to the installation's own namespace.", + "type": "string", + "default": "", + "example": "<PROVIDER_NAMESPACE>" + } + }, + "required": [ + "name", + "private" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}": { + "get": { + "summary": "Get repository", + "operationId": "vcsGetRepository", + "tags": [ + "vcs" + ], + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", + "responses": { + "200": { + "description": "ProviderRepository", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerRepository" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "repositories", + "demo": "vcs\/get-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/branches": { + "get": { + "summary": "List repository branches", + "operationId": "vcsListRepositoryBranches", + "tags": [ + "vcs" + ], + "description": "Get a list of branches from a GitHub repository in your installation. This endpoint supports filtering by a search term and pagination using query strings such as `Query.limit()`, `Query.offset()`, `Query.cursorAfter()`, and `Query.cursorBefore()`. It returns branch names along with the total number of matches. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", + "responses": { + "200": { + "description": "Branches List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/branchList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "repositories", + "demo": "vcs\/list-repository-branches.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/contents": { + "get": { + "summary": "Get files and directories of a VCS repository", + "operationId": "vcsGetRepositoryContents", + "tags": [ + "vcs" + ], + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", + "responses": { + "200": { + "description": "VCS Content List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vcsContentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "repositories", + "demo": "vcs\/get-repository-contents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + }, + { + "name": "providerRootDirectory", + "description": "Path to get contents of nested directory", + "required": false, + "schema": { + "type": "string", + "example": "<PROVIDER_ROOT_DIRECTORY>", + "default": "" + }, + "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "schema": { + "type": "string", + "example": "<PROVIDER_REFERENCE>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/repositories\/{repositoryId}": { + "patch": { + "summary": "Update external deployment (authorize)", + "operationId": "vcsUpdateExternalDeployments", + "tags": [ + "vcs" + ], + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "repositories", + "demo": "vcs\/update-external-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "produces": [ + "application\/json" + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "repositoryId", + "description": "VCS Repository Id", + "required": true, + "schema": { + "type": "string", + "example": "<REPOSITORY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerPullRequestId": { + "description": "GitHub Pull Request Id", + "type": "string", + "example": "<PROVIDER_PULL_REQUEST_ID>" + } + }, + "required": [ + "providerPullRequestId" + ] + } + } + } + } + } + }, + "\/vcs\/installations": { + "get": { + "summary": "List installations", + "operationId": "vcsListInstallations", + "tags": [ + "vcs" + ], + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", + "responses": { + "200": { + "description": "Installations List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/installationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "installations", + "demo": "vcs\/list-installations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: provider, organization", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/vcs\/installations\/{installationId}": { + "get": { + "summary": "Get installation", + "operationId": "vcsGetInstallation", + "tags": [ + "vcs" + ], + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", + "responses": { + "200": { + "description": "Installation", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/installation" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "installations", + "demo": "vcs\/get-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete installation", + "operationId": "vcsDeleteInstallation", + "tags": [ + "vcs" + ], + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "installations", + "demo": "vcs\/delete-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vcs\/installations\/{installationId}\/namespaces": { + "get": { + "summary": "List namespaces", + "operationId": "vcsListNamespaces", + "tags": [ + "vcs" + ], + "description": "List provider namespaces available to a VCS installation. This can include the user personal namespace and any groups or organizations the installation can browse.", + "responses": { + "200": { + "description": "VCS Namespaces List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vcsNamespaceList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "namespaces", + "demo": "vcs\/list-namespaces.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/vectorsdb": { + "get": { + "summary": "List databases", + "operationId": "vectorsDBList", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "vectorsDBCreate", + "tags": [ + "vectorsDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DATABASE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/vectorsdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "vectorsDBListTransactions", + "tags": [ + "vectorsDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "vectorsDBCreateTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/vectorsdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "vectorsDBGetTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "vectorsDBUpdateTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "vectorsDBDeleteTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vectorsdb\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "vectorsDBCreateOperations", + "tags": [ + "vectorsDB" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "vectorsDBGet", + "tags": [ + "vectorsDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "vectorsDBUpdate", + "tags": [ + "vectorsDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "vectorsDBDelete", + "tags": [ + "vectorsDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vectorsdb\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "vectorsDBListCollections", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "VectorsDB Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vectorsdbCollectionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collection", + "operationId": "vectorsDBCreateCollection", + "tags": [ + "vectorsDB" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "VectorsDB Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vectorsdbCollection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<COLLECTION_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "dimension": { + "description": "Embedding dimension.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "permissions": { + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "collectionId", + "name", + "dimension" + ] + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "vectorsDBGetCollection", + "tags": [ + "vectorsDB" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "VectorsDB Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vectorsdbCollection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "vectorsDBUpdateCollection", + "tags": [ + "vectorsDB" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "VectorsDB Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vectorsdbCollection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "dimension": { + "description": "Embedding dimensions.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "vectorsDBDeleteCollection", + "tags": [ + "vectorsDB" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "vectorsDBListDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 524288 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "vectorsDBCreateDocument", + "tags": [ + "vectorsDB" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createDocument", + "namespace": "vectorsDB", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "vectorsdb\/create-document.md", + "public": true + }, + { + "name": "createDocuments", + "namespace": "vectorsDB", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "vectorsdb\/create-documents.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + }, + "put": { + "summary": "Upsert documents", + "operationId": "vectorsDBUpsertDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "vectorsDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.\n", + "demo": "vectorsdb\/upsert-documents.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "description": "Array of document data as JSON objects. May contain partial documents.", + "type": "array", + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "vectorsDBUpdateDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "vectorsDBDeleteDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents\/query": { + "post": { + "summary": "Create query", + "operationId": "vectorsDBCreateQuery", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/create-query.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 524288 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID to read uncommitted changes within the transaction.", + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "total": { + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "type": "boolean", + "default": true, + "example": false + }, + "ttl": { + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "vectorsDBGetDocument", + "tags": [ + "vectorsDB" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "vectorsDBUpsertDocument", + "tags": [ + "vectorsDB" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocument", + "namespace": "vectorsDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "vectorsdb\/upsert-document.md", + "public": true + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-appwrite": { + "idGenerator": "ID.unique" + }, + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required fields of the document to be created or updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "vectorsDBUpdateDocument", + "tags": [ + "vectorsDB" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only fields and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "vectorsDBDeleteDocument", + "tags": [ + "vectorsDB" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "vectorsDBListIndexes", + "tags": [ + "vectorsDB" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "vectorsdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.indexes.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "vectorsDBCreateIndex", + "tags": [ + "vectorsDB" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "vectorsdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.indexes.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Index Key.", + "type": "string", + "example": "<KEY>" + }, + "type": { + "description": "Index type.", + "type": "string", + "example": "hnsw_euclidean", + "title": "VectorsDBIndexType", + "oneOf": [ + { + "type": "string", + "enum": [ + "hnsw_euclidean" + ], + "title": "hnsw_euclidean" + }, + { + "type": "string", + "enum": [ + "hnsw_dot" + ], + "title": "hnsw_dot" + }, + { + "type": "string", + "enum": [ + "hnsw_cosine" + ], + "title": "hnsw_cosine" + }, + { + "type": "string", + "enum": [ + "object" + ], + "title": "object" + }, + { + "type": "string", + "enum": [ + "key" + ], + "title": "key" + }, + { + "type": "string", + "enum": [ + "unique" + ], + "title": "unique" + } + ] + }, + "attributes": { + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "orders": { + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "type": "array", + "default": [], + "items": { + "title": "OrderBy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ] + } + }, + "lengths": { + "description": "Length of index. Maximum of 100", + "type": "array", + "default": [], + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "vectorsDBGetIndex", + "tags": [ + "vectorsDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "vectorsdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.indexes.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "vectorsDBDeleteIndex", + "tags": [ + "vectorsDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "vectorsdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.indexes.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/webhooks": { + "get": { + "summary": "List webhooks", + "operationId": "webhooksList", + "tags": [ + "webhooks" + ], + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Webhooks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhookList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create webhook", + "operationId": "webhooksCreate", + "tags": [ + "webhooks" + ], + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.", + "responses": { + "201": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "webhookId": { + "description": "Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<WEBHOOK_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "url": { + "description": "Webhook URL.", + "type": "string", + "example": "https:\/\/example.com\/webhook" + }, + "name": { + "description": "Webhook name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "events": { + "description": "Events list. Maximum of 100 events are allowed.", + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "description": "Enable or disable a webhook.", + "type": "boolean", + "default": true, + "example": false + }, + "tls": { + "description": "Certificate verification, false for disabled or true for enabled.", + "type": "boolean", + "default": false, + "example": false + }, + "authUsername": { + "description": "Webhook HTTP user. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "<AUTH_USERNAME>" + }, + "authPassword": { + "description": "Webhook HTTP password. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + }, + "secret": { + "description": "Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.", + "type": "string", + "example": "<SECRET>", + "nullable": true + } + }, + "required": [ + "webhookId", + "url", + "name", + "events" + ] + } + } + } + } + } + }, + "\/webhooks\/{webhookId}": { + "get": { + "summary": "Get webhook", + "operationId": "webhooksGet", + "tags": [ + "webhooks" + ], + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "webhookId", + "description": "Webhook ID.", + "required": true, + "schema": { + "type": "string", + "example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update webhook", + "operationId": "webhooksUpdate", + "tags": [ + "webhooks" + ], + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "webhookId", + "description": "Webhook ID.", + "required": true, + "schema": { + "type": "string", + "example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Webhook name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "url": { + "description": "Webhook URL.", + "type": "string", + "example": "https:\/\/example.com\/webhook" + }, + "events": { + "description": "Events list. Maximum of 100 events are allowed.", + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "description": "Enable or disable a webhook.", + "type": "boolean", + "default": true, + "example": false + }, + "tls": { + "description": "Certificate verification, false for disabled or true for enabled.", + "type": "boolean", + "default": false, + "example": false + }, + "authUsername": { + "description": "Webhook HTTP user. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "<AUTH_USERNAME>" + }, + "authPassword": { + "description": "Webhook HTTP password. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + } + }, + "required": [ + "name", + "url", + "events" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete webhook", + "operationId": "webhooksDelete", + "tags": [ + "webhooks" + ], + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "webhookId", + "description": "Webhook ID.", + "required": true, + "schema": { + "type": "string", + "example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + } + }, + "\/webhooks\/{webhookId}\/secret": { + "patch": { + "summary": "Update webhook secret key", + "operationId": "webhooksUpdateSecret", + "tags": [ + "webhooks" + ], + "description": "Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/update-secret.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "webhookId", + "description": "Webhook ID.", + "required": true, + "schema": { + "type": "string", + "example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "secret": { + "description": "Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.", + "type": "string", + "example": "<SECRET>", + "nullable": true + } + } + } + } + } + } + } + } + }, + "tags": [ + { + "name": "ping", + "description": "" + }, + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesDB", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "documentsDB", + "description": "" + }, + { + "name": "vectorsDB", + "description": "" + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "presences", + "description": "The Presences service allows you to track and manage real-time user presence in your project." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "notifications", + "description": "The Notifications service allows you to read and manage your Appwrite Console notifications." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant information." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "tokens", + "description": "The Tokens service allows you to create and manage resource tokens for secure file access." + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "usage", + "description": "" + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "vcs", + "description": "The VCS service allows you to interact with providers like GitHub, GitLab etc." + }, + { + "name": "webhooks", + "description": "The Webhooks service allows you to manage your project webhooks." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "organization", + "description": "The Organization service allows you to manage organization-level projects." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "advisor", + "description": "The Advisor service surfaces actionable reports about your project resources, with CTA descriptors for one-click remediation in the console." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "embeddings", + "description": "" + }, + { + "name": "assistant", + "description": "" + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": {} + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "format": "int32", + "example": 5 + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "example": [] + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "format": "int32", + "example": 5 + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "example": [] + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "presenceList": { + "description": "Presences List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of presences that matched your query.", + "format": "int32", + "example": 5 + }, + "presences": { + "type": "array", + "description": "List of presences.", + "items": { + "$ref": "#\/components\/schemas\/presence" + }, + "example": [] + } + }, + "required": [ + "total", + "presences" + ], + "example": { + "total": 5, + "presences": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "format": "int32", + "example": 5 + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "$ref": "#\/components\/schemas\/table" + }, + "example": [] + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections that matched your query.", + "format": "int32", + "example": 5 + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "$ref": "#\/components\/schemas\/collection" + }, + "example": [] + } + }, + "required": [ + "total", + "collections" + ], + "example": { + "total": 5, + "collections": "" + } + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases that matched your query.", + "format": "int32", + "example": 5 + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "$ref": "#\/components\/schemas\/database" + }, + "example": [] + } + }, + "required": [ + "total", + "databases" + ], + "example": { + "total": 5, + "databases": "" + } + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "format": "int32", + "example": 5 + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "example": [] + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "format": "int32", + "example": 5 + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "example": [] + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users that matched your query.", + "format": "int32", + "example": 5 + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "$ref": "#\/components\/schemas\/user" + }, + "example": [] + } + }, + "required": [ + "total", + "users" + ], + "example": { + "total": 5, + "users": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "format": "int32", + "example": 5 + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "example": [] + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "format": "int32", + "example": 5 + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "example": [] + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "notificationList": { + "description": "Notifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of notifications that matched your query.", + "format": "int32", + "example": 5 + }, + "notifications": { + "type": "array", + "description": "List of notifications.", + "items": { + "$ref": "#\/components\/schemas\/notification" + }, + "example": [] + } + }, + "required": [ + "total", + "notifications" + ], + "example": { + "total": 5, + "notifications": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "format": "int32", + "example": 5 + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "example": [] + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets that matched your query.", + "format": "int32", + "example": 5 + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "$ref": "#\/components\/schemas\/bucket" + }, + "example": [] + } + }, + "required": [ + "total", + "buckets" + ], + "example": { + "total": 5, + "buckets": "" + } + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens that matched your query.", + "format": "int32", + "example": 5 + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "example": [] + } + }, + "required": [ + "total", + "tokens" + ], + "example": { + "total": 5, + "tokens": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "format": "int32", + "example": 5 + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "example": [] + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "format": "int32", + "example": 5 + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "example": [] + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites that matched your query.", + "format": "int32", + "example": 5 + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "$ref": "#\/components\/schemas\/site" + }, + "example": [] + } + }, + "required": [ + "total", + "sites" + ], + "example": { + "total": 5, + "sites": "" + } + }, + "templateSiteList": { + "description": "Site Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates that matched your query.", + "format": "int32", + "example": 5 + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "$ref": "#\/components\/schemas\/templateSite" + }, + "example": [] + } + }, + "required": [ + "total", + "templates" + ], + "example": { + "total": 5, + "templates": "" + } + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions that matched your query.", + "format": "int32", + "example": 5 + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "$ref": "#\/components\/schemas\/function" + }, + "example": [] + } + }, + "required": [ + "total", + "functions" + ], + "example": { + "total": 5, + "functions": "" + } + }, + "templateFunctionList": { + "description": "Function Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates that matched your query.", + "format": "int32", + "example": 5 + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "$ref": "#\/components\/schemas\/templateFunction" + }, + "example": [] + } + }, + "required": [ + "total", + "templates" + ], + "example": { + "total": 5, + "templates": "" + } + }, + "installationList": { + "description": "Installations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of installations that matched your query.", + "format": "int32", + "example": 5 + }, + "installations": { + "type": "array", + "description": "List of installations.", + "items": { + "$ref": "#\/components\/schemas\/installation" + }, + "example": [] + } + }, + "required": [ + "total", + "installations" + ], + "example": { + "total": 5, + "installations": "" + } + }, + "providerRepositoryFrameworkList": { + "description": "Framework Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworkProviderRepositories that matched your query.", + "format": "int32", + "example": 5 + }, + "frameworkProviderRepositories": { + "type": "array", + "description": "List of frameworkProviderRepositories.", + "items": { + "$ref": "#\/components\/schemas\/providerRepositoryFramework" + }, + "example": [] + }, + "type": { + "type": "string", + "description": "Provider repository list type.", + "example": "framework" + } + }, + "required": [ + "total", + "frameworkProviderRepositories", + "type" + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "", + "type": "framework" + } + }, + "providerRepositoryRuntimeList": { + "description": "Runtime Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimeProviderRepositories that matched your query.", + "format": "int32", + "example": 5 + }, + "runtimeProviderRepositories": { + "type": "array", + "description": "List of runtimeProviderRepositories.", + "items": { + "$ref": "#\/components\/schemas\/providerRepositoryRuntime" + }, + "example": [] + }, + "type": { + "type": "string", + "description": "Provider repository list type.", + "example": "runtime" + } + }, + "required": [ + "total", + "runtimeProviderRepositories", + "type" + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "", + "type": "runtime" + } + }, + "vcsNamespace": { + "description": "VcsNamespace", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "VCS (Version Control System) namespace ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) namespace display name.", + "example": "Appwrite" + }, + "path": { + "type": "string", + "description": "VCS (Version Control System) namespace path, used to filter repositories by namespace.", + "example": "appwrite" + }, + "type": { + "type": "string", + "description": "Namespace type. Either the user's personal namespace or a group\/organization.", + "example": "user" + }, + "avatarUrl": { + "type": "string", + "description": "Namespace avatar URL.", + "example": "https:\/\/example.com\/avatar.png" + } + }, + "required": [ + "$id", + "name", + "path", + "type", + "avatarUrl" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "Appwrite", + "path": "appwrite", + "type": "user", + "avatarUrl": "https:\/\/example.com\/avatar.png" + } + }, + "vcsNamespaceList": { + "description": "VCS Namespaces List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of namespaces that matched your query.", + "format": "int32", + "example": 5 + }, + "namespaces": { + "type": "array", + "description": "List of namespaces.", + "items": { + "$ref": "#\/components\/schemas\/vcsNamespace" + }, + "example": [] + } + }, + "required": [ + "total", + "namespaces" + ], + "example": { + "total": 5, + "namespaces": "" + } + }, + "branchList": { + "description": "Branches List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of branches that matched your query.", + "format": "int32", + "example": 5 + }, + "branches": { + "type": "array", + "description": "List of branches.", + "items": { + "$ref": "#\/components\/schemas\/branch" + }, + "example": [] + } + }, + "required": [ + "total", + "branches" + ], + "example": { + "total": 5, + "branches": "" + } + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks that matched your query.", + "format": "int32", + "example": 5 + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "$ref": "#\/components\/schemas\/framework" + }, + "example": [] + } + }, + "required": [ + "total", + "frameworks" + ], + "example": { + "total": 5, + "frameworks": "" + } + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes that matched your query.", + "format": "int32", + "example": 5 + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "$ref": "#\/components\/schemas\/runtime" + }, + "example": [] + } + }, + "required": [ + "total", + "runtimes" + ], + "example": { + "total": 5, + "runtimes": "" + } + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments that matched your query.", + "format": "int32", + "example": 5 + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "$ref": "#\/components\/schemas\/deployment" + }, + "example": [] + } + }, + "required": [ + "total", + "deployments" + ], + "example": { + "total": 5, + "deployments": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "format": "int32", + "example": 5 + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "example": [] + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "projectList": { + "description": "Projects List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of projects that matched your query.", + "format": "int32", + "example": 5 + }, + "projects": { + "type": "array", + "description": "List of projects.", + "items": { + "$ref": "#\/components\/schemas\/project" + }, + "example": [] + } + }, + "required": [ + "total", + "projects" + ], + "example": { + "total": 5, + "projects": "" + } + }, + "webhookList": { + "description": "Webhooks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of webhooks that matched your query.", + "format": "int32", + "example": 5 + }, + "webhooks": { + "type": "array", + "description": "List of webhooks.", + "items": { + "$ref": "#\/components\/schemas\/webhook" + }, + "example": [] + } + }, + "required": [ + "total", + "webhooks" + ], + "example": { + "total": 5, + "webhooks": "" + } + }, + "keyList": { + "description": "API Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys that matched your query.", + "format": "int32", + "example": 5 + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { + "$ref": "#\/components\/schemas\/key" + }, + "example": [] + } + }, + "required": [ + "total", + "keys" + ], + "example": { + "total": 5, + "keys": "" + } + }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of devKeys that matched your query.", + "format": "int32", + "example": 5 + }, + "devKeys": { + "type": "array", + "description": "List of devKeys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "example": [] + } + }, + "required": [ + "total", + "devKeys" + ], + "example": { + "total": 5, + "devKeys": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "format": "int32", + "example": 5 + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "example": [] + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "format": "int32", + "example": 5 + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "example": [] + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "format": "int32", + "example": 5 + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "example": [] + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "format": "int32", + "example": 5 + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "example": [] + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "format": "int32", + "example": 5 + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "example": [] + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables that matched your query.", + "format": "int32", + "example": 5 + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "example": [] + } + }, + "required": [ + "total", + "variables" + ], + "example": { + "total": 5, + "variables": "" + } + }, + "mockNumberList": { + "description": "Mock Numbers List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of mockNumbers that matched your query.", + "format": "int32", + "example": 5 + }, + "mockNumbers": { + "type": "array", + "description": "List of mockNumbers.", + "items": { + "$ref": "#\/components\/schemas\/mockNumber" + }, + "example": [] + } + }, + "required": [ + "total", + "mockNumbers" + ], + "example": { + "total": 5, + "mockNumbers": "" + } + }, + "policyList": { + "description": "Policies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of policies in the given project.", + "format": "int32", + "example": 10 + }, + "policies": { + "type": "array", + "description": "List of policies.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/policyPasswordDictionary" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordHistory" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordStrength" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordPersonalData" + }, + { + "$ref": "#\/components\/schemas\/policySessionAlert" + }, + { + "$ref": "#\/components\/schemas\/policySessionDuration" + }, + { + "$ref": "#\/components\/schemas\/policySessionInvalidation" + }, + { + "$ref": "#\/components\/schemas\/policySessionLimit" + }, + { + "$ref": "#\/components\/schemas\/policyUserLimit" + }, + { + "$ref": "#\/components\/schemas\/policyMembershipPrivacy" + }, + { + "$ref": "#\/components\/schemas\/policyMfaFactors" + } + ], + "discriminator": { + "propertyName": "$id", + "mapping": { + "password-dictionary": "#\/components\/schemas\/policyPasswordDictionary", + "password-history": "#\/components\/schemas\/policyPasswordHistory", + "password-strength": "#\/components\/schemas\/policyPasswordStrength", + "password-personal-data": "#\/components\/schemas\/policyPasswordPersonalData", + "session-alert": "#\/components\/schemas\/policySessionAlert", + "session-duration": "#\/components\/schemas\/policySessionDuration", + "session-invalidation": "#\/components\/schemas\/policySessionInvalidation", + "session-limit": "#\/components\/schemas\/policySessionLimit", + "user-limit": "#\/components\/schemas\/policyUserLimit", + "membership-privacy": "#\/components\/schemas\/policyMembershipPrivacy", + "mfa-factors": "#\/components\/schemas\/policyMfaFactors" + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "policies" + ], + "example": { + "total": 10, + "policies": "" + } + }, + "emailTemplateList": { + "description": "Email Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates that matched your query.", + "format": "int32", + "example": 5 + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "$ref": "#\/components\/schemas\/emailTemplate" + }, + "example": [] + } + }, + "required": [ + "total", + "templates" + ], + "example": { + "total": 5, + "templates": "" + } + }, + "proxyRuleList": { + "description": "Rule List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rules that matched your query.", + "format": "int32", + "example": 5 + }, + "rules": { + "type": "array", + "description": "List of rules.", + "items": { + "$ref": "#\/components\/schemas\/proxyRule" + }, + "example": [] + } + }, + "required": [ + "total", + "rules" + ], + "example": { + "total": 5, + "rules": "" + } + }, + "scheduleList": { + "description": "Schedules List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of schedules that matched your query.", + "format": "int32", + "example": 5 + }, + "schedules": { + "type": "array", + "description": "List of schedules.", + "items": { + "$ref": "#\/components\/schemas\/schedule" + }, + "example": [] + } + }, + "required": [ + "total", + "schedules" + ], + "example": { + "total": 5, + "schedules": "" + } + }, + "stageList": { + "description": "Stages List", + "type": "object", + "properties": { + "stages": { + "type": "array", + "description": "List of stages.", + "items": { + "$ref": "#\/components\/schemas\/stage" + }, + "example": [] + } + }, + "required": [ + "stages" + ], + "example": { + "stages": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "format": "int32", + "example": 5 + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "example": [] + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers that matched your query.", + "format": "int32", + "example": 5 + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "$ref": "#\/components\/schemas\/provider" + }, + "example": [] + } + }, + "required": [ + "total", + "providers" + ], + "example": { + "total": 5, + "providers": "" + } + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages that matched your query.", + "format": "int32", + "example": 5 + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "$ref": "#\/components\/schemas\/message" + }, + "example": [] + } + }, + "required": [ + "total", + "messages" + ], + "example": { + "total": 5, + "messages": "" + } + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics that matched your query.", + "format": "int32", + "example": 5 + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "$ref": "#\/components\/schemas\/topic" + }, + "example": [] + } + }, + "required": [ + "total", + "topics" + ], + "example": { + "total": 5, + "topics": "" + } + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers that matched your query.", + "format": "int32", + "example": 5 + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "$ref": "#\/components\/schemas\/subscriber" + }, + "example": [] + } + }, + "required": [ + "total", + "subscribers" + ], + "example": { + "total": 5, + "subscribers": "" + } + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets that matched your query.", + "format": "int32", + "example": 5 + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "example": [] + } + }, + "required": [ + "total", + "targets" + ], + "example": { + "total": 5, + "targets": "" + } + }, + "transactionList": { + "description": "Transaction List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of transactions that matched your query.", + "format": "int32", + "example": 5 + }, + "transactions": { + "type": "array", + "description": "List of transactions.", + "items": { + "$ref": "#\/components\/schemas\/transaction" + }, + "example": [] + } + }, + "required": [ + "total", + "transactions" + ], + "example": { + "total": 5, + "transactions": "" + } + }, + "migrationList": { + "description": "Migrations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of migrations that matched your query.", + "format": "int32", + "example": 5 + }, + "migrations": { + "type": "array", + "description": "List of migrations.", + "items": { + "$ref": "#\/components\/schemas\/migration" + }, + "example": [] + } + }, + "required": [ + "total", + "migrations" + ], + "example": { + "total": 5, + "migrations": "" + } + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications that matched your query.", + "format": "int32", + "example": 5 + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "$ref": "#\/components\/schemas\/specification" + }, + "example": [] + } + }, + "required": [ + "total", + "specifications" + ], + "example": { + "total": 5, + "specifications": "" + } + }, + "vcsContentList": { + "description": "VCS Content List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of contents that matched your query.", + "format": "int32", + "example": 5 + }, + "contents": { + "type": "array", + "description": "List of contents.", + "items": { + "$ref": "#\/components\/schemas\/vcsContent" + }, + "example": [] + } + }, + "required": [ + "total", + "contents" + ], + "example": { + "total": 5, + "contents": "" + } + }, + "vectorsdbCollectionList": { + "description": "VectorsDB Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections that matched your query.", + "format": "int32", + "example": 5 + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "$ref": "#\/components\/schemas\/vectorsdbCollection" + }, + "example": [] + } + }, + "required": [ + "total", + "collections" + ], + "example": { + "total": 5, + "collections": "" + } + }, + "embeddingList": { + "description": "Embedding list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of embeddings that matched your query.", + "format": "int32", + "example": 5 + }, + "embeddings": { + "type": "array", + "description": "List of embeddings.", + "items": { + "$ref": "#\/components\/schemas\/embedding" + }, + "example": [] + } + }, + "required": [ + "total", + "embeddings" + ], + "example": { + "total": 5, + "embeddings": "" + } + }, + "insightList": { + "description": "Insights List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of insights that matched your query.", + "format": "int32", + "example": 5 + }, + "insights": { + "type": "array", + "description": "List of insights.", + "items": { + "$ref": "#\/components\/schemas\/insight" + }, + "example": [] + } + }, + "required": [ + "total", + "insights" + ], + "example": { + "total": 5, + "insights": "" + } + }, + "reportList": { + "description": "Reports List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of reports that matched your query.", + "format": "int32", + "example": 5 + }, + "reports": { + "type": "array", + "description": "List of reports.", + "items": { + "$ref": "#\/components\/schemas\/report" + }, + "example": [] + } + }, + "required": [ + "total", + "reports" + ], + "example": { + "total": 5, + "reports": "" + } + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "example": false + }, + "type": { + "description": "Database type.", + "example": "legacy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "legacy" + ], + "title": "legacy" + }, + { + "type": "string", + "enum": [ + "tablesdb" + ], + "title": "tablesdb" + }, + { + "type": "string", + "enum": [ + "documentsdb" + ], + "title": "documentsdb" + }, + { + "type": "string", + "enum": [ + "vectorsdb" + ], + "title": "vectorsdb" + } + ] + }, + "status": { + "description": "Database status. Possible values: `provisioning`, `ready` or `failed`", + "example": "ready", + "title": "DatabaseStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "provisioning" + ], + "title": "provisioning" + }, + { + "type": "string", + "enum": [ + "ready" + ], + "title": "ready" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ], + "nullable": true + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy", + "status": "ready" + } + }, + "embedding": { + "description": "Embedding", + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "Embedding model used to generate embeddings.", + "example": "nomic-embed-text" + }, + "dimension": { + "type": "integer", + "description": "Number of dimensions for each embedding vector.", + "format": "int32", + "example": 768 + }, + "embedding": { + "type": "array", + "description": "Embedding vector values. If an error occurs, this will be an empty array.", + "items": { + "type": "number", + "format": "double" + }, + "example": [ + 0.01, + 0.02, + 0.03 + ] + }, + "error": { + "type": "string", + "description": "Error message if embedding generation fails. Empty string if no error.", + "example": "Error message" + } + }, + "required": [ + "model", + "dimension", + "embedding", + "error" + ], + "example": { + "model": "nomic-embed-text", + "dimension": 768, + "embedding": [ + 0.01, + 0.02, + 0.03 + ], + "error": "Error message" + } + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeBigint" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, + { + "$ref": "#\/components\/schemas\/attributeVarchar" + }, + { + "$ref": "#\/components\/schemas\/attributeText" + }, + { + "$ref": "#\/components\/schemas\/attributeMediumtext" + }, + { + "$ref": "#\/components\/schemas\/attributeLongtext" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/attributeBoolean", + "bigint": "#\/components\/schemas\/attributeBigint", + "integer": "#\/components\/schemas\/attributeInteger", + "double": "#\/components\/schemas\/attributeFloat", + "string": "#\/components\/schemas\/attributeString", + "datetime": "#\/components\/schemas\/attributeDatetime", + "relationship": "#\/components\/schemas\/attributeRelationship", + "point": "#\/components\/schemas\/attributePoint", + "linestring": "#\/components\/schemas\/attributeLine", + "polygon": "#\/components\/schemas\/attributePolygon", + "varchar": "#\/components\/schemas\/attributeVarchar", + "text": "#\/components\/schemas\/attributeText", + "mediumtext": "#\/components\/schemas\/attributeMediumtext", + "longtext": "#\/components\/schemas\/attributeLongtext" + }, + "x-mapping": { + "#\/components\/schemas\/attributeBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/attributeBigint": { + "type": "bigint" + }, + "#\/components\/schemas\/attributeInteger": { + "type": "integer" + }, + "#\/components\/schemas\/attributeFloat": { + "type": "double" + }, + "#\/components\/schemas\/attributeEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/attributeEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/attributeUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/attributeIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/attributeDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/attributeRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/attributePoint": { + "type": "point" + }, + "#\/components\/schemas\/attributeLine": { + "type": "linestring" + }, + "#\/components\/schemas\/attributePolygon": { + "type": "polygon" + }, + "#\/components\/schemas\/attributeVarchar": { + "type": "varchar" + }, + "#\/components\/schemas\/attributeText": { + "type": "text" + }, + "#\/components\/schemas\/attributeMediumtext": { + "type": "mediumtext" + }, + "#\/components\/schemas\/attributeLongtext": { + "type": "longtext" + }, + "#\/components\/schemas\/attributeString": { + "type": "string" + } + } + } + }, + "example": [] + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "example": [] + }, + "bytesMax": { + "type": "integer", + "description": "Maximum document size in bytes. Returns 0 when no limit applies.", + "format": "int32", + "example": 65535 + }, + "bytesUsed": { + "type": "integer", + "description": "Currently used document size in bytes based on defined attributes.", + "format": "int32", + "example": 1500 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes", + "bytesMax", + "bytesUsed" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {}, + "bytesMax": 65535, + "bytesUsed": 1500 + } + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "format": "int32", + "example": 5 + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeBigint" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, + { + "$ref": "#\/components\/schemas\/attributeVarchar" + }, + { + "$ref": "#\/components\/schemas\/attributeText" + }, + { + "$ref": "#\/components\/schemas\/attributeMediumtext" + }, + { + "$ref": "#\/components\/schemas\/attributeLongtext" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/attributeBoolean", + "bigint": "#\/components\/schemas\/attributeBigint", + "integer": "#\/components\/schemas\/attributeInteger", + "double": "#\/components\/schemas\/attributeFloat", + "string": "#\/components\/schemas\/attributeString", + "datetime": "#\/components\/schemas\/attributeDatetime", + "relationship": "#\/components\/schemas\/attributeRelationship", + "point": "#\/components\/schemas\/attributePoint", + "linestring": "#\/components\/schemas\/attributeLine", + "polygon": "#\/components\/schemas\/attributePolygon", + "varchar": "#\/components\/schemas\/attributeVarchar", + "text": "#\/components\/schemas\/attributeText", + "mediumtext": "#\/components\/schemas\/attributeMediumtext", + "longtext": "#\/components\/schemas\/attributeLongtext" + }, + "x-mapping": { + "#\/components\/schemas\/attributeBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/attributeBigint": { + "type": "bigint" + }, + "#\/components\/schemas\/attributeInteger": { + "type": "integer" + }, + "#\/components\/schemas\/attributeFloat": { + "type": "double" + }, + "#\/components\/schemas\/attributeEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/attributeEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/attributeUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/attributeIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/attributeDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/attributeRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/attributePoint": { + "type": "point" + }, + "#\/components\/schemas\/attributeLine": { + "type": "linestring" + }, + "#\/components\/schemas\/attributePolygon": { + "type": "polygon" + }, + "#\/components\/schemas\/attributeVarchar": { + "type": "varchar" + }, + "#\/components\/schemas\/attributeText": { + "type": "text" + }, + "#\/components\/schemas\/attributeMediumtext": { + "type": "mediumtext" + }, + "#\/components\/schemas\/attributeLongtext": { + "type": "longtext" + }, + "#\/components\/schemas\/attributeString": { + "type": "string" + } + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "attributes" + ], + "example": { + "total": 5, + "attributes": "" + } + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "format": "int32", + "example": 128 + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "integer" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "format": "int64", + "example": 1, + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "format": "int64", + "example": 10, + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "format": "int32", + "example": 10, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "attributeBigint": { + "description": "AttributeBigInt", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "bigint" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "format": "int64", + "example": 1, + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "format": "int64", + "example": 10, + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "format": "int64", + "example": 10, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "bigint", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "double" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "format": "double", + "example": 1.5, + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "format": "double", + "example": 10.5, + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "format": "double", + "example": 2.5, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "boolean" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "example": [ + "element" + ] + }, + "format": { + "type": "string", + "description": "String format.", + "example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "http:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "datetime" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": [ + 0, + 0 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "attributeVarchar": { + "description": "AttributeVarchar", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "format": "int32", + "example": 128 + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "attributeText": { + "description": "AttributeText", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "attributeMediumtext": { + "description": "AttributeMediumtext", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "attributeLongtext": { + "description": "AttributeLongtext", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "vectorsdbCollection": { + "description": "VectorsDB Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeObject" + }, + { + "$ref": "#\/components\/schemas\/attributeVector" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "object": "#\/components\/schemas\/attributeObject", + "vector": "#\/components\/schemas\/attributeVector" + } + } + }, + "example": [] + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "example": [] + }, + "bytesMax": { + "type": "integer", + "description": "Maximum document size in bytes. Returns 0 when no limit applies.", + "format": "int32", + "example": 65535 + }, + "bytesUsed": { + "type": "integer", + "description": "Currently used document size in bytes based on defined attributes.", + "format": "int32", + "example": 1500 + }, + "dimension": { + "type": "integer", + "description": "Embedding dimension.", + "format": "int32", + "example": 1536 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes", + "bytesMax", + "bytesUsed", + "dimension" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {}, + "bytesMax": 65535, + "bytesUsed": 1500, + "dimension": 1536 + } + }, + "attributeObject": { + "description": "AttributeObject", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "attributeVector": { + "description": "AttributeVector", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Vector dimensions.", + "format": "int32", + "example": 1536 + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 1536 + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnBigint" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnVarchar" + }, + { + "$ref": "#\/components\/schemas\/columnText" + }, + { + "$ref": "#\/components\/schemas\/columnMediumtext" + }, + { + "$ref": "#\/components\/schemas\/columnLongtext" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/columnBoolean", + "bigint": "#\/components\/schemas\/columnBigint", + "integer": "#\/components\/schemas\/columnInteger", + "double": "#\/components\/schemas\/columnFloat", + "string": "#\/components\/schemas\/columnString", + "datetime": "#\/components\/schemas\/columnDatetime", + "relationship": "#\/components\/schemas\/columnRelationship", + "point": "#\/components\/schemas\/columnPoint", + "linestring": "#\/components\/schemas\/columnLine", + "polygon": "#\/components\/schemas\/columnPolygon", + "varchar": "#\/components\/schemas\/columnVarchar", + "text": "#\/components\/schemas\/columnText", + "mediumtext": "#\/components\/schemas\/columnMediumtext", + "longtext": "#\/components\/schemas\/columnLongtext" + }, + "x-mapping": { + "#\/components\/schemas\/columnBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/columnBigint": { + "type": "bigint" + }, + "#\/components\/schemas\/columnInteger": { + "type": "integer" + }, + "#\/components\/schemas\/columnFloat": { + "type": "double" + }, + "#\/components\/schemas\/columnEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/columnEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/columnUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/columnIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/columnDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/columnRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/columnPoint": { + "type": "point" + }, + "#\/components\/schemas\/columnLine": { + "type": "linestring" + }, + "#\/components\/schemas\/columnPolygon": { + "type": "polygon" + }, + "#\/components\/schemas\/columnVarchar": { + "type": "varchar" + }, + "#\/components\/schemas\/columnText": { + "type": "text" + }, + "#\/components\/schemas\/columnMediumtext": { + "type": "mediumtext" + }, + "#\/components\/schemas\/columnLongtext": { + "type": "longtext" + }, + "#\/components\/schemas\/columnString": { + "type": "string" + } + } + } + }, + "example": [] + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "example": [] + }, + "bytesMax": { + "type": "integer", + "description": "Maximum row size in bytes. Returns 0 when no limit applies.", + "format": "int32", + "example": 65535 + }, + "bytesUsed": { + "type": "integer", + "description": "Currently used row size in bytes based on defined columns.", + "format": "int32", + "example": 1500 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes", + "bytesMax", + "bytesUsed" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {}, + "bytesMax": 65535, + "bytesUsed": 1500 + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "format": "int32", + "example": 5 + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnBigint" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnVarchar" + }, + { + "$ref": "#\/components\/schemas\/columnText" + }, + { + "$ref": "#\/components\/schemas\/columnMediumtext" + }, + { + "$ref": "#\/components\/schemas\/columnLongtext" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/columnBoolean", + "bigint": "#\/components\/schemas\/columnBigint", + "integer": "#\/components\/schemas\/columnInteger", + "double": "#\/components\/schemas\/columnFloat", + "string": "#\/components\/schemas\/columnString", + "datetime": "#\/components\/schemas\/columnDatetime", + "relationship": "#\/components\/schemas\/columnRelationship", + "point": "#\/components\/schemas\/columnPoint", + "linestring": "#\/components\/schemas\/columnLine", + "polygon": "#\/components\/schemas\/columnPolygon", + "varchar": "#\/components\/schemas\/columnVarchar", + "text": "#\/components\/schemas\/columnText", + "mediumtext": "#\/components\/schemas\/columnMediumtext", + "longtext": "#\/components\/schemas\/columnLongtext" + }, + "x-mapping": { + "#\/components\/schemas\/columnBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/columnBigint": { + "type": "bigint" + }, + "#\/components\/schemas\/columnInteger": { + "type": "integer" + }, + "#\/components\/schemas\/columnFloat": { + "type": "double" + }, + "#\/components\/schemas\/columnEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/columnEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/columnUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/columnIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/columnDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/columnRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/columnPoint": { + "type": "point" + }, + "#\/components\/schemas\/columnLine": { + "type": "linestring" + }, + "#\/components\/schemas\/columnPolygon": { + "type": "polygon" + }, + "#\/components\/schemas\/columnVarchar": { + "type": "varchar" + }, + "#\/components\/schemas\/columnText": { + "type": "text" + }, + "#\/components\/schemas\/columnMediumtext": { + "type": "mediumtext" + }, + "#\/components\/schemas\/columnLongtext": { + "type": "longtext" + }, + "#\/components\/schemas\/columnString": { + "type": "string" + } + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "format": "int32", + "example": 128 + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "integer" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "format": "int64", + "example": 1, + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "format": "int64", + "example": 10, + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "format": "int32", + "example": 10, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnBigint": { + "description": "ColumnBigInt", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "bigint" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "format": "int64", + "example": 1, + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "format": "int64", + "example": 10, + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "format": "int64", + "example": 10, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "bigint", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "double" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "format": "double", + "example": 1.5, + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "format": "double", + "example": 10.5, + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "format": "double", + "example": 2.5, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "boolean" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "example": [ + "element" + ] + }, + "format": { + "type": "string", + "description": "String format.", + "example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "https:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "datetime" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": [ + 0, + 0 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "columnVarchar": { + "description": "ColumnVarchar", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "format": "int32", + "example": 128 + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnText": { + "description": "ColumnText", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "columnMediumtext": { + "description": "ColumnMediumtext", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "columnLongtext": { + "description": "ColumnLongtext", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index key.", + "example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "example": "primary" + }, + "status": { + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "example": [], + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "example": [], + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "string", + "description": "Row sequence ID.", + "readOnly": true, + "example": "1" + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": "1", + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "string", + "description": "Document sequence ID.", + "readOnly": true, + "example": "1" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": "1", + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "presence": { + "description": "Presence", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Presence ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Presence creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Presence update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Presence permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "674af8f3e12a5f9ac0be" + }, + "status": { + "type": "string", + "description": "Presence status.", + "example": "online", + "nullable": true + }, + "source": { + "type": "string", + "description": "Presence source.", + "example": "HTTP" + }, + "expiresAt": { + "type": "string", + "description": "Presence expiry date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": true, + "description": "Presence metadata.", + "example": { + "key": "value" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "userId", + "source" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "userId": "674af8f3e12a5f9ac0be", + "status": "online", + "source": "HTTP", + "expiresAt": "2020-10-15T06:38:00.000+00:00", + "metadata": { + "key": "value" + } + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "example": {}, + "allOf": [ + { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "argon2": "#\/components\/schemas\/algoArgon2", + "scrypt": "#\/components\/schemas\/algoScrypt", + "scryptMod": "#\/components\/schemas\/algoScryptModified", + "bcrypt": "#\/components\/schemas\/algoBcrypt", + "phpass": "#\/components\/schemas\/algoPhpass", + "sha": "#\/components\/schemas\/algoSha", + "md5": "#\/components\/schemas\/algoMd5" + } + } + } + ], + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "example": true + }, + "emailCanonical": { + "type": "string", + "description": "Canonical form of the user email address.", + "example": "john@appwrite.io", + "nullable": true + }, + "emailIsFree": { + "type": "boolean", + "description": "Whether the user email is from a free email provider.", + "example": true, + "nullable": true + }, + "emailIsDisposable": { + "type": "boolean", + "description": "Whether the user email is from a disposable email provider.", + "example": false, + "nullable": true + }, + "emailIsCorporate": { + "type": "boolean", + "description": "Whether the user email is from a corporate domain.", + "example": true, + "nullable": true + }, + "emailIsCanonical": { + "type": "boolean", + "description": "Whether the user email is in its canonical form.", + "example": true, + "nullable": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "example": { + "theme": "pink", + "timezone": "UTC" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/preferences" + } + ] + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "impersonator": { + "type": "boolean", + "description": "Whether the user can impersonate other users.", + "example": false, + "nullable": true + }, + "impersonatorUserId": { + "type": "string", + "description": "ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data.", + "example": "5e5ea5c16897e", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "emailCanonical": "john@appwrite.io", + "emailIsFree": true, + "emailIsDisposable": false, + "emailIsCorporate": true, + "emailIsCanonical": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "impersonator": false, + "impersonatorUserId": "5e5ea5c16897e" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "format": "int32", + "example": 8 + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "format": "int32", + "example": 14 + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "format": "int32", + "example": 1 + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "format": "int32", + "example": 64 + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "format": "int32", + "example": 65536 + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "format": "int32", + "example": 4 + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "format": "int32", + "example": 3 + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "notification": { + "description": "Notification", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Notification ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Notification creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Notification update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "messageId": { + "type": "string", + "description": "Stable message ID used for dedup.", + "example": "session.create", + "nullable": true + }, + "type": { + "type": "string", + "description": "Notification type: info, warning, error.", + "example": "info" + }, + "channel": { + "type": "string", + "description": "Channel: email, sms, push, console, webhook.", + "example": "email" + }, + "resourceType": { + "type": "string", + "description": "Resource type this notification is addressed to.", + "example": "users" + }, + "resourceId": { + "type": "string", + "description": "Resource ID this notification is addressed to.", + "example": "5e5bb8c16897e" + }, + "parentResourceType": { + "type": "string", + "description": "Parent resource type for the notification.", + "example": "projects" + }, + "parentResourceId": { + "type": "string", + "description": "Parent resource ID for the notification.", + "example": "5e5bb8c16897e" + }, + "projectId": { + "type": "string", + "description": "Project the notification pertains to.", + "example": "5e5bb8c16897e", + "nullable": true + }, + "title": { + "type": "string", + "description": "Notification title.", + "example": "New sign-in detected" + }, + "body": { + "type": "string", + "description": "Notification body.", + "example": "A new device signed in to your account." + }, + "read": { + "type": "boolean", + "description": "Whether the notification has been read.", + "example": false, + "nullable": true + }, + "firstSeen": { + "type": "string", + "description": "First time the notification was viewed from a notification logo.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "lastSeen": { + "type": "string", + "description": "Most recent time the notification was viewed from a notification logo.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "channel", + "resourceType", + "resourceId", + "parentResourceType", + "parentResourceId", + "title", + "body" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "messageId": "session.create", + "type": "info", + "channel": "email", + "resourceType": "users", + "resourceId": "5e5bb8c16897e", + "parentResourceType": "projects", + "parentResourceId": "5e5bb8c16897e", + "projectId": "5e5bb8c16897e", + "title": "New sign-in detected", + "body": "A new device signed in to your account.", + "read": false, + "firstSeen": "2020-10-15T06:38:00.000+00:00", + "lastSeen": "2020-10-15T06:38:00.000+00:00" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "example": "Pink.png" + }, + "folder": { + "type": "string", + "description": "Virtual folder containing the file, with a trailing slash. Empty for the bucket root.", + "example": "photos\/2026\/" + }, + "key": { + "type": "string", + "description": "Full virtual path of the file: the folder followed by the file name.", + "example": "photos\/2026\/Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "format": "int32", + "example": 17890 + }, + "sizeActual": { + "type": "integer", + "description": "File actual stored size in bytes after compression and\/or encryption.", + "format": "int32", + "example": 12345 + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "format": "int32", + "example": 17890 + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "format": "int32", + "example": 17890 + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "example": "gzip" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "folder", + "key", + "signature", + "mimeType", + "sizeOriginal", + "sizeActual", + "chunksTotal", + "chunksUploaded", + "encryption", + "compression" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "folder": "photos\/2026\/", + "key": "photos\/2026\/Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "sizeActual": 12345, + "chunksTotal": 17890, + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" + } + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "format": "int32", + "example": 100 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm chosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "example": false + }, + "transformations": { + "type": "boolean", + "description": "Image transformations are enabled.", + "example": false + }, + "totalSize": { + "type": "integer", + "description": "Total size of this bucket in bytes.", + "format": "int32", + "example": 128 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus", + "transformations", + "totalSize" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false, + "transformations": false, + "totalSize": 128 + } + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "format": "int32", + "example": 7 + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "example": { + "theme": "pink", + "timezone": "UTC" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/preferences" + } + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "example": "john@appwrite.io" + }, + "userPhone": { + "type": "string", + "description": "User phone number. Hide this attribute by toggling membership privacy in the Console.", + "example": "+1 555 555 5555" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "example": false + }, + "userAccessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "userPhone", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "userAccessedAt", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "userPhone": "+1 555 555 5555", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "userAccessedAt": "2020-10-15T06:38:00.000+00:00", + "roles": [ + "owner" + ] + } + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "example": "react" + }, + "deploymentRetention": { + "type": "integer", + "description": "How many days to keep the non-active deployments before they will be automatically deleted.", + "format": "int32", + "example": 7 + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "format": "int32", + "example": 300 + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "example": "npm run build" + }, + "startCommand": { + "type": "string", + "description": "Custom command to use when starting site runtime.", + "example": "node custom-server.mjs" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "example": false + }, + "providerBranches": { + "type": "array", + "description": "List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.", + "items": { + "type": "string" + }, + "example": [ + "main", + "feat\/*" + ] + }, + "providerPaths": { + "type": "array", + "description": "List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes.", + "items": { + "type": "string" + }, + "example": [ + "src\/**", + "!docs\/**" + ] + }, + "buildSpecification": { + "type": "string", + "description": "Machine specification for deployment builds.", + "example": "s-1vcpu-512mb" + }, + "runtimeSpecification": { + "type": "string", + "description": "Machine specification for SSR executions.", + "example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentRetention", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "timeout", + "installCommand", + "buildCommand", + "startCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "providerBranches", + "providerPaths", + "buildSpecification", + "runtimeSpecification", + "buildRuntime", + "adapter", + "fallbackFile" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentRetention": 7, + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "startCommand": "node custom-server.mjs", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "providerBranches": [ + "main", + "feat\/*" + ], + "providerPaths": [ + "src\/**", + "!docs\/**" + ], + "buildSpecification": "s-1vcpu-512mb", + "runtimeSpecification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } + }, + "templateSite": { + "description": "Template Site", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Site Template ID.", + "example": "starter" + }, + "name": { + "type": "string", + "description": "Site Template Name.", + "example": "Starter site" + }, + "tagline": { + "type": "string", + "description": "Short description of template", + "example": "Minimal web app integrating with Appwrite." + }, + "demoUrl": { + "type": "string", + "description": "URL hosting a template demo.", + "example": "https:\/\/nextjs-starter.appwrite.network\/", + "nullable": true + }, + "screenshotDark": { + "type": "string", + "description": "File URL with preview screenshot in dark theme preference.", + "example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png" + }, + "screenshotLight": { + "type": "string", + "description": "File URL with preview screenshot in light theme preference.", + "example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png" + }, + "useCases": { + "type": "array", + "description": "Site use cases.", + "items": { + "type": "string" + }, + "example": [ + "Starter" + ] + }, + "frameworks": { + "type": "array", + "description": "List of frameworks that can be used with this template.", + "items": { + "$ref": "#\/components\/schemas\/templateFramework" + }, + "example": [] + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "example": "main" + }, + "variables": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/templateVariable" + }, + "example": [] + } + }, + "required": [ + "key", + "name", + "tagline", + "screenshotDark", + "screenshotLight", + "useCases", + "frameworks", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables" + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } + }, + "templateFramework": { + "description": "Template Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Parent framework key.", + "example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "example": "SvelteKit" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the dependencies.", + "example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the deployment.", + "example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The output directory to store the build output.", + "example": ".\/build" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "example": ".\/svelte-kit\/starter" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime used during build step of template.", + "example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework runtime", + "example": "ssr" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for SPA. Only relevant for static serve runtime.", + "example": "index.html", + "nullable": true + } + }, + "required": [ + "key", + "name", + "installCommand", + "buildCommand", + "outputDirectory", + "providerRootDirectory", + "buildRuntime", + "adapter" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "example": [ + "users" + ] + }, + "name": { + "type": "string", + "description": "Function name.", + "example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "example": "python-3.8" + }, + "deploymentRetention": { + "type": "integer", + "description": "How many days to keep the non-active deployments before they will be automatically deleted.", + "format": "int32", + "example": 7 + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "example": [ + "account.create" + ] + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "format": "int32", + "example": 300 + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "example": false + }, + "providerBranches": { + "type": "array", + "description": "List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.", + "items": { + "type": "string" + }, + "example": [ + "main", + "feat\/*" + ] + }, + "providerPaths": { + "type": "array", + "description": "List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes.", + "items": { + "type": "string" + }, + "example": [ + "src\/**", + "!docs\/**" + ] + }, + "buildSpecification": { + "type": "string", + "description": "Machine specification for deployment builds.", + "example": "s-1vcpu-512mb" + }, + "runtimeSpecification": { + "type": "string", + "description": "Machine specification for executions.", + "example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentRetention", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "providerBranches", + "providerPaths", + "buildSpecification", + "runtimeSpecification" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentRetention": 7, + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "providerBranches": [ + "main", + "feat\/*" + ], + "providerPaths": [ + "src\/**", + "!docs\/**" + ], + "buildSpecification": "s-1vcpu-512mb", + "runtimeSpecification": "s-1vcpu-512mb" + } + }, + "templateFunction": { + "description": "Template Function", + "type": "object", + "properties": { + "icon": { + "type": "string", + "description": "Function Template Icon.", + "example": "icon-lightning-bolt" + }, + "id": { + "type": "string", + "description": "Function Template ID.", + "example": "starter" + }, + "name": { + "type": "string", + "description": "Function Template Name.", + "example": "Starter function" + }, + "tagline": { + "type": "string", + "description": "Function Template Tagline.", + "example": "A simple function to get started." + }, + "permissions": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "example": [ + "any" + ] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "example": [ + "account.create" + ] + }, + "cron": { + "type": "string", + "description": "Function execution schedult in CRON format.", + "example": "0 0 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "format": "int32", + "example": 300 + }, + "useCases": { + "type": "array", + "description": "Function use cases.", + "items": { + "type": "string" + }, + "example": [ + "Starter" + ] + }, + "runtimes": { + "type": "array", + "description": "List of runtimes that can be used with this template.", + "items": { + "$ref": "#\/components\/schemas\/templateRuntime" + }, + "example": [] + }, + "instructions": { + "type": "string", + "description": "Function Template Instructions.", + "example": "For documentation and instructions check out <link>." + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "example": "main" + }, + "variables": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/templateVariable" + }, + "example": [] + }, + "scopes": { + "type": "array", + "description": "Function scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + } + }, + "required": [ + "icon", + "id", + "name", + "tagline", + "permissions", + "events", + "cron", + "timeout", + "useCases", + "runtimes", + "instructions", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables", + "scopes" + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out <link>.", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } + }, + "templateRuntime": { + "description": "Template Runtime", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Runtime Name.", + "example": "node-19.0" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "example": "npm install" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "example": "index.js" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "example": "node\/starter" + } + }, + "required": [ + "name", + "commands", + "entrypoint", + "providerRootDirectory" + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } + }, + "templateVariable": { + "description": "Template Variable", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Variable Name.", + "example": "APPWRITE_DATABASE_ID" + }, + "description": { + "type": "string", + "description": "Variable Description.", + "example": "The ID of the Appwrite database that contains the collection to sync." + }, + "value": { + "type": "string", + "description": "Variable Value.", + "example": "512" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "example": false + }, + "placeholder": { + "type": "string", + "description": "Variable Placeholder.", + "example": "64a55...7b912" + }, + "required": { + "type": "boolean", + "description": "Is the variable required?", + "example": false + }, + "type": { + "type": "string", + "description": "Variable Type.", + "example": "password" + } + }, + "required": [ + "name", + "description", + "value", + "secret", + "placeholder", + "required", + "type" + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } + }, + "installation": { + "description": "Installation", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "example": "github" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name.", + "example": "appwrite" + }, + "providerInstallationId": { + "type": "string", + "description": "VCS (Version Control System) installation ID.", + "example": "5322" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "provider", + "organization", + "providerInstallationId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } + }, + "providerRepository": { + "description": "ProviderRepository", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "example": "main" + }, + "providerInstallationId": { + "type": "string", + "description": "VCS (Version Control System) installation ID.", + "example": "108104697" + }, + "authorized": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository authorized for the installation?", + "example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "example": "datetime" + }, + "variables": { + "type": "array", + "description": "Environment variables found in .env files", + "items": { + "type": "string" + }, + "example": [ + "PORT", + "NODE_ENV" + ] + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "providerInstallationId", + "authorized", + "pushedAt", + "variables" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "providerInstallationId": "108104697", + "authorized": true, + "pushedAt": "datetime", + "variables": [ + "PORT", + "NODE_ENV" + ] + } + }, + "providerRepositoryFramework": { + "description": "ProviderRepositoryFramework", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "example": "main" + }, + "providerInstallationId": { + "type": "string", + "description": "VCS (Version Control System) installation ID.", + "example": "108104697" + }, + "authorized": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository authorized for the installation?", + "example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "example": "datetime" + }, + "variables": { + "type": "array", + "description": "Environment variables found in .env files", + "items": { + "type": "string" + }, + "example": [ + "PORT", + "NODE_ENV" + ] + }, + "framework": { + "type": "string", + "description": "Auto-detected framework. Empty if type is not \"framework\".", + "example": "nextjs" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "providerInstallationId", + "authorized", + "pushedAt", + "variables", + "framework" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "providerInstallationId": "108104697", + "authorized": true, + "pushedAt": "datetime", + "variables": [ + "PORT", + "NODE_ENV" + ], + "framework": "nextjs" + } + }, + "providerRepositoryRuntime": { + "description": "ProviderRepositoryRuntime", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "example": "main" + }, + "providerInstallationId": { + "type": "string", + "description": "VCS (Version Control System) installation ID.", + "example": "108104697" + }, + "authorized": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository authorized for the installation?", + "example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "example": "datetime" + }, + "variables": { + "type": "array", + "description": "Environment variables found in .env files", + "items": { + "type": "string" + }, + "example": [ + "PORT", + "NODE_ENV" + ] + }, + "runtime": { + "type": "string", + "description": "Auto-detected runtime. Empty if type is not \"runtime\".", + "example": "node-22" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "providerInstallationId", + "authorized", + "pushedAt", + "variables", + "runtime" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "providerInstallationId": "108104697", + "authorized": true, + "pushedAt": "datetime", + "variables": [ + "PORT", + "NODE_ENV" + ], + "runtime": "node-22" + } + }, + "detectionFramework": { + "description": "DetectionFramework", + "type": "object", + "properties": { + "type": { + "description": "Repository detection type.", + "example": "framework", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "framework" + ], + "title": "framework" + } + ] + }, + "variables": { + "type": "array", + "description": "Environment variables found in .env files", + "items": { + "$ref": "#\/components\/schemas\/detectionVariable" + }, + "example": [], + "nullable": true + }, + "framework": { + "type": "string", + "description": "Framework", + "example": "nuxt" + }, + "installCommand": { + "type": "string", + "description": "Site Install Command", + "example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Site Build Command", + "example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Site Output Directory", + "example": "dist" + } + }, + "required": [ + "type", + "framework", + "installCommand", + "buildCommand", + "outputDirectory" + ], + "example": { + "type": "framework", + "variables": {}, + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } + }, + "detectionRuntime": { + "description": "DetectionRuntime", + "type": "object", + "properties": { + "type": { + "description": "Repository detection type.", + "example": "runtime", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "runtime" + ], + "title": "runtime" + } + ] + }, + "variables": { + "type": "array", + "description": "Environment variables found in .env files", + "items": { + "$ref": "#\/components\/schemas\/detectionVariable" + }, + "example": [], + "nullable": true + }, + "runtime": { + "type": "string", + "description": "Runtime", + "example": "node" + }, + "entrypoint": { + "type": "string", + "description": "Function Entrypoint", + "example": "index.js" + }, + "commands": { + "type": "string", + "description": "Function install and build commands", + "example": "npm install && npm run build" + } + }, + "required": [ + "type", + "runtime", + "entrypoint", + "commands" + ], + "example": { + "type": "runtime", + "variables": {}, + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } + }, + "detectionVariable": { + "description": "DetectionVariable", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of environment variable", + "example": "NODE_ENV" + }, + "value": { + "type": "string", + "description": "Value of environment variable", + "example": "production" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "NODE_ENV", + "value": "production" + } + }, + "vcsContent": { + "description": "VcsContents", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Content size in bytes. Only files have size, and for directories, 0 is returned.", + "format": "int32", + "example": 1523, + "nullable": true + }, + "isDirectory": { + "type": "boolean", + "description": "If a content is a directory. Directories can be used to check nested contents.", + "example": true, + "nullable": true + }, + "name": { + "type": "string", + "description": "Name of directory or file.", + "example": "Main.java" + } + }, + "required": [ + "name" + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } + }, + "branch": { + "description": "Branch", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Branch Name.", + "example": "main" + } + }, + "required": [ + "name" + ], + "example": { + "name": "main" + } + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "example": [ + "amd64" + ] + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "$ref": "#\/components\/schemas\/frameworkAdapter" + }, + "example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "example": "index.html", + "nullable": true + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory" + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "format": "int32", + "example": 128 + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "format": "int32", + "example": 128 + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "format": "int32", + "example": 128 + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "example": "5e5ea5c16897e" + }, + "status": { + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", \"canceled\" and \"failed\".", + "example": "ready", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "waiting" + ], + "title": "waiting" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "building" + ], + "title": "building" + }, + { + "type": "string", + "enum": [ + "ready" + ], + "title": "ready" + }, + { + "type": "string", + "enum": [ + "canceled" + ], + "title": "canceled" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "format": "int32", + "example": 128 + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "example": "0.7.x" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranch", + "providerBranchUrl" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "example": [ + "any" + ] + }, + "resourceId": { + "type": "string", + "description": "Function or site ID.", + "example": "5e5ea6g16897e" + }, + "resourceType": { + "description": "Execution resource type.", + "example": "functions", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "functions" + ], + "title": "functions" + }, + { + "type": "string", + "enum": [ + "sites" + ], + "title": "sites" + } + ] + }, + "deploymentId": { + "type": "string", + "description": "Deployment ID used to create the execution.", + "example": "5e5ea5c16897e" + }, + "trigger": { + "description": "The trigger that caused the resource to execute. Possible values can be: `http`, `schedule`, or `event`.", + "example": "http", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "http" + ], + "title": "http" + }, + { + "type": "string", + "enum": [ + "schedule" + ], + "title": "schedule" + }, + { + "type": "string", + "enum": [ + "event" + ], + "title": "event" + } + ] + }, + "status": { + "description": "The status of the resource execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`.", + "example": "processing", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "waiting" + ], + "title": "waiting" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "completed" + ], + "title": "completed" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + }, + { + "type": "string", + "enum": [ + "scheduled" + ], + "title": "scheduled" + } + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "format": "int32", + "example": 200 + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Resource logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "errors": { + "type": "string", + "description": "Resource errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "format": "double", + "example": 0.4 + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "resourceId", + "resourceType", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "project": { + "description": "Project", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Project ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Project creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Project update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Project name.", + "example": "New Project" + }, + "teamId": { + "type": "string", + "description": "Project team ID.", + "example": "1592981250" + }, + "region": { + "type": "string", + "description": "Project region.", + "example": "fra" + }, + "devKeys": { + "type": "array", + "description": "Deprecated since 1.9.5: List of dev keys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "example": [] + }, + "smtpEnabled": { + "type": "boolean", + "description": "Status for custom SMTP", + "example": false + }, + "smtpSenderName": { + "type": "string", + "description": "SMTP sender name", + "example": "John Appwrite" + }, + "smtpSenderEmail": { + "type": "string", + "description": "SMTP sender email", + "example": "john@appwrite.io" + }, + "smtpReplyToName": { + "type": "string", + "description": "SMTP reply to name", + "example": "Support Team" + }, + "smtpReplyToEmail": { + "type": "string", + "description": "SMTP reply to email", + "example": "support@appwrite.io" + }, + "smtpHost": { + "type": "string", + "description": "SMTP server host name", + "example": "mail.appwrite.io" + }, + "smtpPort": { + "type": "integer", + "description": "SMTP server port", + "format": "int32", + "example": 25 + }, + "smtpUsername": { + "type": "string", + "description": "SMTP server username", + "example": "emailuser" + }, + "smtpPassword": { + "type": "string", + "description": "SMTP server password. This property is write-only and always returned empty.", + "format": "password", + "example": "smtp-password" + }, + "smtpSecure": { + "type": "string", + "description": "SMTP server secure protocol", + "example": "tls" + }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "format": "int32", + "example": 1 + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "labels": { + "type": "array", + "description": "Labels for the project.", + "items": { + "type": "string" + }, + "example": [ + "vip" + ] + }, + "status": { + "type": "string", + "description": "Project status.", + "example": "active" + }, + "onboarding": { + "type": "object", + "additionalProperties": true, + "description": "Stage progress (completed or skipped) with timestamps and actor types, keyed by stage id.", + "example": {} + }, + "authMethods": { + "type": "array", + "description": "List of auth methods.", + "items": { + "$ref": "#\/components\/schemas\/projectAuthMethod" + }, + "example": [] + }, + "services": { + "type": "array", + "description": "List of services.", + "items": { + "$ref": "#\/components\/schemas\/projectService" + }, + "example": [] + }, + "protocols": { + "type": "array", + "description": "List of protocols.", + "items": { + "$ref": "#\/components\/schemas\/projectProtocol" + }, + "example": [] + }, + "blocks": { + "type": "array", + "description": "Project blocks information.", + "items": { + "type": "string" + }, + "example": [] + }, + "consoleAccessedAt": { + "type": "string", + "description": "Last time the project was accessed via console.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "wafEnabled": { + "type": "boolean", + "description": "Whether WAF enforcement is enabled for the project.", + "example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "teamId", + "region", + "devKeys", + "smtpEnabled", + "smtpSenderName", + "smtpSenderEmail", + "smtpReplyToName", + "smtpReplyToEmail", + "smtpHost", + "smtpPort", + "smtpUsername", + "smtpPassword", + "smtpSecure", + "pingCount", + "pingedAt", + "labels", + "status", + "onboarding", + "authMethods", + "services", + "protocols", + "blocks", + "consoleAccessedAt", + "wafEnabled" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "teamId": "1592981250", + "region": "fra", + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyToName": "Support Team", + "smtpReplyToEmail": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "smtp-password", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "labels": [ + "vip" + ], + "status": "active", + "onboarding": {}, + "authMethods": {}, + "services": {}, + "protocols": {}, + "blocks": [], + "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00", + "wafEnabled": false + } + }, + "projectAuthMethod": { + "description": "ProjectAuthMethod", + "type": "object", + "properties": { + "$id": { + "description": "Auth method ID.", + "example": "email-password", + "title": "ProjectAuthMethodId", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "email-password" + ], + "title": "email-password" + }, + { + "type": "string", + "enum": [ + "magic-url" + ], + "title": "magic-url" + }, + { + "type": "string", + "enum": [ + "email-otp" + ], + "title": "email-otp" + }, + { + "type": "string", + "enum": [ + "anonymous" + ], + "title": "anonymous" + }, + { + "type": "string", + "enum": [ + "invites" + ], + "title": "invites" + }, + { + "type": "string", + "enum": [ + "jwt" + ], + "title": "jwt" + }, + { + "type": "string", + "enum": [ + "phone" + ], + "title": "phone" + } + ] + }, + "enabled": { + "type": "boolean", + "description": "Auth method status.", + "example": false + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "email-password", + "enabled": false + } + }, + "projectService": { + "description": "ProjectService", + "type": "object", + "properties": { + "$id": { + "description": "Service ID.", + "example": "sites", + "title": "ProjectServiceId", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "account" + ], + "title": "account" + }, + { + "type": "string", + "enum": [ + "avatars" + ], + "title": "avatars" + }, + { + "type": "string", + "enum": [ + "databases" + ], + "title": "databases" + }, + { + "type": "string", + "enum": [ + "tablesdb" + ], + "title": "tablesdb" + }, + { + "type": "string", + "enum": [ + "locale" + ], + "title": "locale" + }, + { + "type": "string", + "enum": [ + "health" + ], + "title": "health" + }, + { + "type": "string", + "enum": [ + "project" + ], + "title": "project" + }, + { + "type": "string", + "enum": [ + "storage" + ], + "title": "storage" + }, + { + "type": "string", + "enum": [ + "teams" + ], + "title": "teams" + }, + { + "type": "string", + "enum": [ + "users" + ], + "title": "users" + }, + { + "type": "string", + "enum": [ + "vcs" + ], + "title": "vcs" + }, + { + "type": "string", + "enum": [ + "sites" + ], + "title": "sites" + }, + { + "type": "string", + "enum": [ + "functions" + ], + "title": "functions" + }, + { + "type": "string", + "enum": [ + "proxy" + ], + "title": "proxy" + }, + { + "type": "string", + "enum": [ + "graphql" + ], + "title": "graphql" + }, + { + "type": "string", + "enum": [ + "migrations" + ], + "title": "migrations" + }, + { + "type": "string", + "enum": [ + "messaging" + ], + "title": "messaging" + }, + { + "type": "string", + "enum": [ + "advisor" + ], + "title": "advisor" + } + ] + }, + "enabled": { + "type": "boolean", + "description": "Service status.", + "example": false + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "sites", + "enabled": false + } + }, + "projectProtocol": { + "description": "ProjectProtocol", + "type": "object", + "properties": { + "$id": { + "description": "Protocol ID.", + "example": "graphql", + "title": "ProjectProtocolId", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "rest" + ], + "title": "rest" + }, + { + "type": "string", + "enum": [ + "graphql" + ], + "title": "graphql" + }, + { + "type": "string", + "enum": [ + "websocket" + ], + "title": "websocket" + } + ] + }, + "enabled": { + "type": "boolean", + "description": "Protocol status.", + "example": false + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "graphql", + "enabled": false + } + }, + "webhook": { + "description": "Webhook", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Webhook ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Webhook creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Webhook update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Webhook name.", + "example": "My Webhook" + }, + "url": { + "type": "string", + "description": "Webhook URL endpoint.", + "example": "https:\/\/example.com\/webhook" + }, + "events": { + "type": "array", + "description": "Webhook trigger events.", + "items": { + "type": "string" + }, + "example": [ + "databases.tables.update", + "databases.collections.update" + ] + }, + "tls": { + "type": "boolean", + "description": "Indicates if SSL \/ TLS certificate verification is enabled.", + "example": true + }, + "authUsername": { + "type": "string", + "description": "HTTP basic authentication username.", + "example": "username" + }, + "authPassword": { + "type": "string", + "description": "HTTP basic authentication password.", + "format": "password", + "example": "webhook-password" + }, + "secret": { + "type": "string", + "description": "Signature key which can be used to validate incoming webhook payloads. Only returned on creation and secret rotation.", + "example": "ad3d581ca230e2b7059c545e5a" + }, + "enabled": { + "type": "boolean", + "description": "Indicates if this webhook is enabled.", + "example": true + }, + "logs": { + "type": "string", + "description": "Webhook error logs from the most recent failure.", + "example": "Failed to connect to remote server." + }, + "attempts": { + "type": "integer", + "description": "Number of consecutive failed webhook attempts.", + "format": "int32", + "example": 10 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "url", + "events", + "tls", + "authUsername", + "authPassword", + "secret", + "enabled", + "logs", + "attempts" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": [ + "databases.tables.update", + "databases.collections.update" + ], + "tls": true, + "authUsername": "username", + "authPassword": "webhook-password", + "secret": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } + }, + "key": { + "description": "Key", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + }, + "secret": { + "type": "string", + "description": "Secret key.", + "example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "example": [ + "appwrite:flutter" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "scopes", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "ephemeralKey": { + "description": "Ephemeral Key", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + }, + "secret": { + "type": "string", + "description": "Secret key.", + "example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "example": [ + "appwrite:flutter" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "scopes", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "example": "Dev API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "example": [ + "appwrite:flutter" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "mockNumber": { + "description": "Mock Number", + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS.", + "example": "+1612842323" + }, + "otp": { + "type": "string", + "description": "Mock OTP for the number. ", + "example": "123456" + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "number", + "otp", + "$createdAt", + "$updatedAt" + ], + "example": { + "number": "+1612842323", + "otp": "123456", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "oAuth2Github": { + "description": "OAuth2GitHub", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "GitHub OAuth2 client ID. For GitHub Apps, use the \"App ID\" when both an App ID and client ID are available.", + "example": "e4d87900000000540733" + }, + "clientSecret": { + "type": "string", + "description": "GitHub OAuth2 client secret.", + "example": "5e07c00000000000000000000000000000198bcc" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "e4d87900000000540733", + "clientSecret": "5e07c00000000000000000000000000000198bcc" + } + }, + "oAuth2Discord": { + "description": "OAuth2Discord", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Discord OAuth2 client ID.", + "example": "950722000000343754" + }, + "clientSecret": { + "type": "string", + "description": "Discord OAuth2 client secret.", + "example": "YmPXnM000000000000000000002zFg5D" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "950722000000343754", + "clientSecret": "YmPXnM000000000000000000002zFg5D" + } + }, + "oAuth2Figma": { + "description": "OAuth2Figma", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Figma OAuth2 client ID.", + "example": "byay5H0000000000VtiI40" + }, + "clientSecret": { + "type": "string", + "description": "Figma OAuth2 client secret.", + "example": "yEpOYn0000000000000000004iIsU5" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "byay5H0000000000VtiI40", + "clientSecret": "yEpOYn0000000000000000004iIsU5" + } + }, + "oAuth2Dropbox": { + "description": "OAuth2Dropbox", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "appKey": { + "type": "string", + "description": "Dropbox OAuth2 app key.", + "example": "jl000000000009t" + }, + "appSecret": { + "type": "string", + "description": "Dropbox OAuth2 app secret.", + "example": "g200000000000vw" + } + }, + "required": [ + "$id", + "enabled", + "appKey", + "appSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "appKey": "jl000000000009t", + "appSecret": "g200000000000vw" + } + }, + "oAuth2Dailymotion": { + "description": "OAuth2Dailymotion", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "apiKey": { + "type": "string", + "description": "Dailymotion OAuth2 API key.", + "example": "07a9000000000000067f" + }, + "apiSecret": { + "type": "string", + "description": "Dailymotion OAuth2 API secret.", + "example": "a399a90000000000000000000000000000d90639" + } + }, + "required": [ + "$id", + "enabled", + "apiKey", + "apiSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "apiKey": "07a9000000000000067f", + "apiSecret": "a399a90000000000000000000000000000d90639" + } + }, + "oAuth2Bitbucket": { + "description": "OAuth2Bitbucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "key": { + "type": "string", + "description": "Bitbucket OAuth2 key.", + "example": "Knt70000000000ByRc" + }, + "secret": { + "type": "string", + "description": "Bitbucket OAuth2 secret.", + "example": "NMfLZJ00000000000000000000TLQdDx" + } + }, + "required": [ + "$id", + "enabled", + "key", + "secret" + ], + "example": { + "$id": "github", + "enabled": false, + "key": "Knt70000000000ByRc", + "secret": "NMfLZJ00000000000000000000TLQdDx" + } + }, + "oAuth2Bitly": { + "description": "OAuth2Bitly", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Bitly OAuth2 client ID.", + "example": "d95151000000000000000000000000000067af9b" + }, + "clientSecret": { + "type": "string", + "description": "Bitly OAuth2 client secret.", + "example": "a13e250000000000000000000000000000d73095" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "d95151000000000000000000000000000067af9b", + "clientSecret": "a13e250000000000000000000000000000d73095" + } + }, + "oAuth2Box": { + "description": "OAuth2Box", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Box OAuth2 client ID.", + "example": "deglcs00000000000000000000x2og6y" + }, + "clientSecret": { + "type": "string", + "description": "Box OAuth2 client secret.", + "example": "OKM1f100000000000000000000eshEif" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "deglcs00000000000000000000x2og6y", + "clientSecret": "OKM1f100000000000000000000eshEif" + } + }, + "oAuth2Autodesk": { + "description": "OAuth2Autodesk", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Autodesk OAuth2 client ID.", + "example": "5zw90v00000000000000000000kVYXN7" + }, + "clientSecret": { + "type": "string", + "description": "Autodesk OAuth2 client secret.", + "example": "7I000000000000MW" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "5zw90v00000000000000000000kVYXN7", + "clientSecret": "7I000000000000MW" + } + }, + "oAuth2Google": { + "description": "OAuth2Google", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Google OAuth2 client ID.", + "example": "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com" + }, + "clientSecret": { + "type": "string", + "description": "Google OAuth2 client secret.", + "example": "GOCSPX-2k8gsR0000000000000000VNahJj" + }, + "prompt": { + "type": "array", + "description": "Google OAuth2 prompt values.", + "items": { + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "consent" + ], + "title": "consent" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "example": [ + "consent" + ] + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "prompt" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", + "clientSecret": "GOCSPX-2k8gsR0000000000000000VNahJj", + "prompt": [ + "consent" + ] + } + }, + "oAuth2Zoom": { + "description": "OAuth2Zoom", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Zoom OAuth2 client ID.", + "example": "QMAC00000000000000w0AQ" + }, + "clientSecret": { + "type": "string", + "description": "Zoom OAuth2 client secret.", + "example": "GAWsG4000000000000000000007U01ON" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "QMAC00000000000000w0AQ", + "clientSecret": "GAWsG4000000000000000000007U01ON" + } + }, + "oAuth2Zoho": { + "description": "OAuth2Zoho", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Zoho OAuth2 client ID.", + "example": "1000.83C178000000000000000000RPNX0B" + }, + "clientSecret": { + "type": "string", + "description": "Zoho OAuth2 client secret.", + "example": "fb5cac000000000000000000000000000000a68f6e" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "1000.83C178000000000000000000RPNX0B", + "clientSecret": "fb5cac000000000000000000000000000000a68f6e" + } + }, + "oAuth2Yandex": { + "description": "OAuth2Yandex", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Yandex OAuth2 client ID.", + "example": "6a8a6a0000000000000000000091483c" + }, + "clientSecret": { + "type": "string", + "description": "Yandex OAuth2 client secret.", + "example": "bbf98500000000000000000000c75a63" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "6a8a6a0000000000000000000091483c", + "clientSecret": "bbf98500000000000000000000c75a63" + } + }, + "oAuth2X": { + "description": "OAuth2X", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "customerKey": { + "type": "string", + "description": "X OAuth2 customer key.", + "example": "slzZV0000000000000NFLaWT" + }, + "secretKey": { + "type": "string", + "description": "X OAuth2 secret key.", + "example": "tkEPkp00000000000000000000000000000000000000FTxbI9" + } + }, + "required": [ + "$id", + "enabled", + "customerKey", + "secretKey" + ], + "example": { + "$id": "github", + "enabled": false, + "customerKey": "slzZV0000000000000NFLaWT", + "secretKey": "tkEPkp00000000000000000000000000000000000000FTxbI9" + } + }, + "oAuth2WordPress": { + "description": "OAuth2WordPress", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "WordPress OAuth2 client ID.", + "example": "130005" + }, + "clientSecret": { + "type": "string", + "description": "WordPress OAuth2 client secret.", + "example": "PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "130005", + "clientSecret": "PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk" + } + }, + "oAuth2Twitch": { + "description": "OAuth2Twitch", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Twitch OAuth2 client ID.", + "example": "vvi0in000000000000000000ikmt9p" + }, + "clientSecret": { + "type": "string", + "description": "Twitch OAuth2 client secret.", + "example": "pmapue000000000000000000zylw3v" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "vvi0in000000000000000000ikmt9p", + "clientSecret": "pmapue000000000000000000zylw3v" + } + }, + "oAuth2Stripe": { + "description": "OAuth2Stripe", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Stripe OAuth2 client ID.", + "example": "ca_UKibXX0000000000000000000006byvR" + }, + "apiSecretKey": { + "type": "string", + "description": "Stripe OAuth2 API secret key.", + "example": "sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "apiSecretKey" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "ca_UKibXX0000000000000000000006byvR", + "apiSecretKey": "sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp" + } + }, + "oAuth2Spotify": { + "description": "OAuth2Spotify", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Spotify OAuth2 client ID.", + "example": "6ec271000000000000000000009beace" + }, + "clientSecret": { + "type": "string", + "description": "Spotify OAuth2 client secret.", + "example": "db068a000000000000000000008b5b9f" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "6ec271000000000000000000009beace", + "clientSecret": "db068a000000000000000000008b5b9f" + } + }, + "oAuth2Slack": { + "description": "OAuth2Slack", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Slack OAuth2 client ID.", + "example": "23000000089.15000000000023" + }, + "clientSecret": { + "type": "string", + "description": "Slack OAuth2 client secret.", + "example": "81656000000000000000000000f3d2fd" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "23000000089.15000000000023", + "clientSecret": "81656000000000000000000000f3d2fd" + } + }, + "oAuth2Podio": { + "description": "OAuth2Podio", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Podio OAuth2 client ID.", + "example": "appwrite-oauth-test-app" + }, + "clientSecret": { + "type": "string", + "description": "Podio OAuth2 client secret.", + "example": "Rn247T0000000000000000000000000000000000000000000000000000W2zWTN" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "appwrite-oauth-test-app", + "clientSecret": "Rn247T0000000000000000000000000000000000000000000000000000W2zWTN" + } + }, + "oAuth2Notion": { + "description": "OAuth2Notion", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "oauthClientId": { + "type": "string", + "description": "Notion OAuth2 client ID.", + "example": "341d8700-0000-0000-0000-000000446ee3" + }, + "oauthClientSecret": { + "type": "string", + "description": "Notion OAuth2 client secret.", + "example": "secret_dLUr4b000000000000000000000000000000lFHAa9" + } + }, + "required": [ + "$id", + "enabled", + "oauthClientId", + "oauthClientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "oauthClientId": "341d8700-0000-0000-0000-000000446ee3", + "oauthClientSecret": "secret_dLUr4b000000000000000000000000000000lFHAa9" + } + }, + "oAuth2Salesforce": { + "description": "OAuth2Salesforce", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "customerKey": { + "type": "string", + "description": "Salesforce OAuth2 consumer key.", + "example": "3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq" + }, + "customerSecret": { + "type": "string", + "description": "Salesforce OAuth2 consumer secret.", + "example": "3w000000000000e2" + } + }, + "required": [ + "$id", + "enabled", + "customerKey", + "customerSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "customerKey": "3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq", + "customerSecret": "3w000000000000e2" + } + }, + "oAuth2Yahoo": { + "description": "OAuth2Yahoo", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Yahoo OAuth2 client ID.", + "example": "dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm" + }, + "clientSecret": { + "type": "string", + "description": "Yahoo OAuth2 client secret.", + "example": "cf978f0000000000000000000000000000c5e2e9" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm", + "clientSecret": "cf978f0000000000000000000000000000c5e2e9" + } + }, + "oAuth2Cloudflare": { + "description": "OAuth2Cloudflare", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Cloudflare OAuth2 client ID.", + "example": "4b866000000000000000000000c9e4e2" + }, + "clientSecret": { + "type": "string", + "description": "Cloudflare OAuth2 client secret.", + "example": "cfoc_5Q6YRl0000000000000000000000000000000000003d214f" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "4b866000000000000000000000c9e4e2", + "clientSecret": "cfoc_5Q6YRl0000000000000000000000000000000000003d214f" + } + }, + "oAuth2HuggingFace": { + "description": "OAuth2HuggingFace", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Hugging Face OAuth2 client ID.", + "example": "2ab9cff9-d711-40ad-a91e-b08a49c42d24" + }, + "clientSecret": { + "type": "string", + "description": "Hugging Face OAuth2 client secret.", + "example": "oauth_app_secret_wcLhRtl000000000000000000000xbNdLt" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "2ab9cff9-d711-40ad-a91e-b08a49c42d24", + "clientSecret": "oauth_app_secret_wcLhRtl000000000000000000000xbNdLt" + } + }, + "oAuth2Linkedin": { + "description": "OAuth2Linkedin", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "LinkedIn OAuth2 client ID.", + "example": "770000000000dv" + }, + "primaryClientSecret": { + "type": "string", + "description": "LinkedIn OAuth2 primary client secret.", + "example": "WPL_AP1.2Bf0000000000000.\/HtlYw==" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "primaryClientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "770000000000dv", + "primaryClientSecret": "WPL_AP1.2Bf0000000000000.\/HtlYw==" + } + }, + "oAuth2Disqus": { + "description": "OAuth2Disqus", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "publicKey": { + "type": "string", + "description": "Disqus OAuth2 public key.", + "example": "cgegH70000000000000000000000000000000000000000000000000000Hr1nYX" + }, + "secretKey": { + "type": "string", + "description": "Disqus OAuth2 secret key.", + "example": "W7Bykj00000000000000000000000000000000000000000000000000003o43w9" + } + }, + "required": [ + "$id", + "enabled", + "publicKey", + "secretKey" + ], + "example": { + "$id": "github", + "enabled": false, + "publicKey": "cgegH70000000000000000000000000000000000000000000000000000Hr1nYX", + "secretKey": "W7Bykj00000000000000000000000000000000000000000000000000003o43w9" + } + }, + "oAuth2Amazon": { + "description": "OAuth2Amazon", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Amazon OAuth2 client ID.", + "example": "amzn1.application-oa2-client.87400c00000000000000000000063d5b2" + }, + "clientSecret": { + "type": "string", + "description": "Amazon OAuth2 client secret.", + "example": "79ffe4000000000000000000000000000000000000000000000000000002de55" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "amzn1.application-oa2-client.87400c00000000000000000000063d5b2", + "clientSecret": "79ffe4000000000000000000000000000000000000000000000000000002de55" + } + }, + "oAuth2Etsy": { + "description": "OAuth2Etsy", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "keyString": { + "type": "string", + "description": "Etsy OAuth2 keystring.", + "example": "nsgzxh0000000000008j85a2" + }, + "sharedSecret": { + "type": "string", + "description": "Etsy OAuth2 shared secret.", + "example": "tp000000ru" + } + }, + "required": [ + "$id", + "enabled", + "keyString", + "sharedSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "keyString": "nsgzxh0000000000008j85a2", + "sharedSecret": "tp000000ru" + } + }, + "oAuth2Facebook": { + "description": "OAuth2Facebook", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "appId": { + "type": "string", + "description": "Facebook OAuth2 app ID.", + "example": "260600000007694" + }, + "appSecret": { + "type": "string", + "description": "Facebook OAuth2 app secret.", + "example": "2d0b2800000000000000000000d38af4" + } + }, + "required": [ + "$id", + "enabled", + "appId", + "appSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "appId": "260600000007694", + "appSecret": "2d0b2800000000000000000000d38af4" + } + }, + "oAuth2Tradeshift": { + "description": "OAuth2Tradeshift", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "oauth2ClientId": { + "type": "string", + "description": "Tradeshift OAuth2 client ID.", + "example": "appwrite-test-org.appwrite-test-app" + }, + "oauth2ClientSecret": { + "type": "string", + "description": "Tradeshift OAuth2 client secret.", + "example": "7cb52700-0000-0000-0000-000000ca5b83" + } + }, + "required": [ + "$id", + "enabled", + "oauth2ClientId", + "oauth2ClientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "oauth2ClientId": "appwrite-test-org.appwrite-test-app", + "oauth2ClientSecret": "7cb52700-0000-0000-0000-000000ca5b83" + } + }, + "oAuth2Paypal": { + "description": "OAuth2Paypal", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "PayPal OAuth2 client ID.", + "example": "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB" + }, + "secretKey": { + "type": "string", + "description": "PayPal OAuth2 secret key.", + "example": "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "secretKey" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", + "secretKey": "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" + } + }, + "oAuth2Gitlab": { + "description": "OAuth2Gitlab", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "applicationId": { + "type": "string", + "description": "GitLab OAuth2 application ID.", + "example": "d41ffe0000000000000000000000000000000000000000000000000000d5e252" + }, + "secret": { + "type": "string", + "description": "GitLab OAuth2 secret.", + "example": "gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38" + }, + "endpoint": { + "type": "string", + "description": "GitLab OAuth2 endpoint URL. Defaults to https:\/\/gitlab.com for self-hosted instances.", + "example": "https:\/\/gitlab.com" + } + }, + "required": [ + "$id", + "enabled", + "applicationId", + "secret", + "endpoint" + ], + "example": { + "$id": "github", + "enabled": false, + "applicationId": "d41ffe0000000000000000000000000000000000000000000000000000d5e252", + "secret": "gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38", + "endpoint": "https:\/\/gitlab.com" + } + }, + "oAuth2Appwrite": { + "description": "OAuth2Appwrite", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Appwrite OAuth2 client ID.", + "example": "6a42000000000000b5a0" + }, + "clientSecret": { + "type": "string", + "description": "Appwrite OAuth2 client secret.", + "example": "b86afd000000000000000000000000000000000000000000000000000ced5f93" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "6a42000000000000b5a0", + "clientSecret": "b86afd000000000000000000000000000000000000000000000000000ced5f93" + } + }, + "oAuth2Authentik": { + "description": "OAuth2Authentik", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Authentik OAuth2 client ID.", + "example": "dTKOPa0000000000000000000000000000e7G8hv" + }, + "clientSecret": { + "type": "string", + "description": "Authentik OAuth2 client secret.", + "example": "ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK" + }, + "endpoint": { + "type": "string", + "description": "Authentik OAuth2 endpoint domain.", + "example": "example.authentik.com" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "endpoint" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "dTKOPa0000000000000000000000000000e7G8hv", + "clientSecret": "ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK", + "endpoint": "example.authentik.com" + } + }, + "oAuth2Auth0": { + "description": "OAuth2Auth0", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Auth0 OAuth2 client ID.", + "example": "OaOkIA000000000000000000005KLSYq" + }, + "clientSecret": { + "type": "string", + "description": "Auth0 OAuth2 client secret.", + "example": "zXz0000-00000000000000000000000000000-00000000000000000000PJafnF" + }, + "endpoint": { + "type": "string", + "description": "Auth0 OAuth2 endpoint domain.", + "example": "example.us.auth0.com" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "endpoint" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "OaOkIA000000000000000000005KLSYq", + "clientSecret": "zXz0000-00000000000000000000000000000-00000000000000000000PJafnF", + "endpoint": "example.us.auth0.com" + } + }, + "oAuth2FusionAuth": { + "description": "OAuth2FusionAuth", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "FusionAuth OAuth2 client ID.", + "example": "b2222c00-0000-0000-0000-000000862097" + }, + "clientSecret": { + "type": "string", + "description": "FusionAuth OAuth2 client secret.", + "example": "Jx4s0C0000000000000000000000000000000wGqLsc" + }, + "endpoint": { + "type": "string", + "description": "FusionAuth OAuth2 endpoint domain.", + "example": "example.fusionauth.io" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "endpoint" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "b2222c00-0000-0000-0000-000000862097", + "clientSecret": "Jx4s0C0000000000000000000000000000000wGqLsc", + "endpoint": "example.fusionauth.io" + } + }, + "oAuth2Keycloak": { + "description": "OAuth2Keycloak", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Keycloak OAuth2 client ID.", + "example": "appwrite-o0000000st-app" + }, + "clientSecret": { + "type": "string", + "description": "Keycloak OAuth2 client secret.", + "example": "jdjrJd00000000000000000000HUsaZO" + }, + "endpoint": { + "type": "string", + "description": "Keycloak OAuth2 endpoint domain.", + "example": "keycloak.example.com" + }, + "realmName": { + "type": "string", + "description": "Keycloak OAuth2 realm name.", + "example": "appwrite-realm" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "endpoint", + "realmName" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "appwrite-o0000000st-app", + "clientSecret": "jdjrJd00000000000000000000HUsaZO", + "endpoint": "keycloak.example.com", + "realmName": "appwrite-realm" + } + }, + "oAuth2Oidc": { + "description": "OAuth2Oidc", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "OpenID Connect OAuth2 client ID.", + "example": "qibI2x0000000000000000000000000006L2YFoG" + }, + "clientSecret": { + "type": "string", + "description": "OpenID Connect OAuth2 client secret.", + "example": "Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV" + }, + "wellKnownURL": { + "type": "string", + "description": "OpenID Connect well-known configuration URL. When set, authorization, token, and user info endpoints can be discovered automatically.", + "example": "https:\/\/myoauth.com\/.well-known\/openid-configuration" + }, + "authorizationURL": { + "type": "string", + "description": "OpenID Connect authorization endpoint URL.", + "example": "https:\/\/myoauth.com\/oauth2\/authorize" + }, + "tokenURL": { + "type": "string", + "description": "OpenID Connect token endpoint URL.", + "example": "https:\/\/myoauth.com\/oauth2\/token" + }, + "userInfoURL": { + "type": "string", + "description": "OpenID Connect user info endpoint URL.", + "example": "https:\/\/myoauth.com\/oauth2\/userinfo" + }, + "prompt": { + "type": "array", + "description": "OpenID Connect prompt values controlling the authentication and consent screens.", + "items": { + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "login" + ], + "title": "login" + }, + { + "type": "string", + "enum": [ + "consent" + ], + "title": "consent" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "example": [ + "consent" + ] + }, + "maxAge": { + "type": "integer", + "description": "Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds.", + "format": "int32", + "example": 3600, + "nullable": true + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "wellKnownURL", + "authorizationURL", + "tokenURL", + "userInfoURL", + "prompt" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "qibI2x0000000000000000000000000006L2YFoG", + "clientSecret": "Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV", + "wellKnownURL": "https:\/\/myoauth.com\/.well-known\/openid-configuration", + "authorizationURL": "https:\/\/myoauth.com\/oauth2\/authorize", + "tokenURL": "https:\/\/myoauth.com\/oauth2\/token", + "userInfoURL": "https:\/\/myoauth.com\/oauth2\/userinfo", + "prompt": [ + "consent" + ], + "maxAge": 3600 + } + }, + "oAuth2Okta": { + "description": "OAuth2Okta", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Okta OAuth2 client ID.", + "example": "0oa00000000000000698" + }, + "clientSecret": { + "type": "string", + "description": "Okta OAuth2 client secret.", + "example": "Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV" + }, + "domain": { + "type": "string", + "description": "Okta OAuth2 domain.", + "example": "trial-6400025.okta.com" + }, + "authorizationServerId": { + "type": "string", + "description": "Okta OAuth2 authorization server ID.", + "example": "aus000000000000000h7z" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "domain", + "authorizationServerId" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "0oa00000000000000698", + "clientSecret": "Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV", + "domain": "trial-6400025.okta.com", + "authorizationServerId": "aus000000000000000h7z" + } + }, + "oAuth2Kick": { + "description": "OAuth2Kick", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Kick OAuth2 client ID.", + "example": "01KQ7C00000000000001MFHS32" + }, + "clientSecret": { + "type": "string", + "description": "Kick OAuth2 client secret.", + "example": "34ac5600000000000000000000000000000000000000000000000000e830c8b" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "01KQ7C00000000000001MFHS32", + "clientSecret": "34ac5600000000000000000000000000000000000000000000000000e830c8b" + } + }, + "oAuth2Apple": { + "description": "OAuth2Apple", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "apple" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "serviceId": { + "type": "string", + "description": "Apple OAuth2 service ID.", + "example": "ip.appwrite.app.web" + }, + "keyId": { + "type": "string", + "description": "Apple OAuth2 key ID.", + "example": "P4000000N8" + }, + "teamId": { + "type": "string", + "description": "Apple OAuth2 team ID.", + "example": "D4000000R6" + }, + "p8File": { + "type": "string", + "description": "Apple OAuth2 .p8 private key file contents. The secret key wrapped by the PEM markers is 200 characters long.", + "example": "-----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----" + } + }, + "required": [ + "$id", + "enabled", + "serviceId", + "keyId", + "teamId", + "p8File" + ], + "example": { + "$id": "apple", + "enabled": false, + "serviceId": "ip.appwrite.app.web", + "keyId": "P4000000N8", + "teamId": "D4000000R6", + "p8File": "-----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----" + } + }, + "oAuth2Microsoft": { + "description": "OAuth2Microsoft", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "applicationId": { + "type": "string", + "description": "Microsoft OAuth2 application ID.", + "example": "00001111-aaaa-2222-bbbb-3333cccc4444" + }, + "applicationSecret": { + "type": "string", + "description": "Microsoft OAuth2 application secret.", + "example": "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u" + }, + "tenant": { + "type": "string", + "description": "Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID.", + "example": "common" + } + }, + "required": [ + "$id", + "enabled", + "applicationId", + "applicationSecret", + "tenant" + ], + "example": { + "$id": "github", + "enabled": false, + "applicationId": "00001111-aaaa-2222-bbbb-3333cccc4444", + "applicationSecret": "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", + "tenant": "common" + } + }, + "oAuth2Resend": { + "description": "OAuth2Resend", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Resend OAuth2 client ID.", + "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479" + }, + "clientSecret": { + "type": "string", + "description": "Resend OAuth2 client secret.", + "example": "9c1e4b00000000000000000000000000000000000000000000000000a72d5f4" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", + "clientSecret": "9c1e4b00000000000000000000000000000000000000000000000000a72d5f4" + } + }, + "oAuth2ProviderList": { + "description": "OAuth2 Providers List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of OAuth2 providers in the given project.", + "format": "int32", + "example": 5 + }, + "providers": { + "type": "array", + "description": "List of OAuth2 providers.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/oAuth2Github" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Discord" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Figma" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Dropbox" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Dailymotion" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Bitbucket" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Bitly" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Box" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Autodesk" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Google" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Zoom" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Zoho" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Yandex" + }, + { + "$ref": "#\/components\/schemas\/oAuth2X" + }, + { + "$ref": "#\/components\/schemas\/oAuth2WordPress" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Twitch" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Stripe" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Spotify" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Slack" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Podio" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Notion" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Salesforce" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Yahoo" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Linkedin" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Disqus" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Amazon" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Etsy" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Facebook" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Tradeshift" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Paypal" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Gitlab" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Appwrite" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Authentik" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Auth0" + }, + { + "$ref": "#\/components\/schemas\/oAuth2FusionAuth" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Keycloak" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Oidc" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Apple" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Okta" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Kick" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Microsoft" + }, + { + "$ref": "#\/components\/schemas\/oAuth2HuggingFace" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Resend" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Cloudflare" + } + ], + "discriminator": { + "propertyName": "$id", + "mapping": { + "github": "#\/components\/schemas\/oAuth2Github", + "discord": "#\/components\/schemas\/oAuth2Discord", + "figma": "#\/components\/schemas\/oAuth2Figma", + "dropbox": "#\/components\/schemas\/oAuth2Dropbox", + "dailymotion": "#\/components\/schemas\/oAuth2Dailymotion", + "bitbucket": "#\/components\/schemas\/oAuth2Bitbucket", + "bitly": "#\/components\/schemas\/oAuth2Bitly", + "box": "#\/components\/schemas\/oAuth2Box", + "autodesk": "#\/components\/schemas\/oAuth2Autodesk", + "google": "#\/components\/schemas\/oAuth2Google", + "zoom": "#\/components\/schemas\/oAuth2Zoom", + "zoho": "#\/components\/schemas\/oAuth2Zoho", + "yandex": "#\/components\/schemas\/oAuth2Yandex", + "x": "#\/components\/schemas\/oAuth2X", + "wordpress": "#\/components\/schemas\/oAuth2WordPress", + "twitch": "#\/components\/schemas\/oAuth2Twitch", + "stripe": "#\/components\/schemas\/oAuth2Stripe", + "spotify": "#\/components\/schemas\/oAuth2Spotify", + "slack": "#\/components\/schemas\/oAuth2Slack", + "podio": "#\/components\/schemas\/oAuth2Podio", + "notion": "#\/components\/schemas\/oAuth2Notion", + "salesforce": "#\/components\/schemas\/oAuth2Salesforce", + "yahoo": "#\/components\/schemas\/oAuth2Yahoo", + "linkedin": "#\/components\/schemas\/oAuth2Linkedin", + "disqus": "#\/components\/schemas\/oAuth2Disqus", + "amazon": "#\/components\/schemas\/oAuth2Amazon", + "etsy": "#\/components\/schemas\/oAuth2Etsy", + "facebook": "#\/components\/schemas\/oAuth2Facebook", + "tradeshift": "#\/components\/schemas\/oAuth2Tradeshift", + "tradeshiftBox": "#\/components\/schemas\/oAuth2Tradeshift", + "paypal": "#\/components\/schemas\/oAuth2Paypal", + "paypalSandbox": "#\/components\/schemas\/oAuth2Paypal", + "gitlab": "#\/components\/schemas\/oAuth2Gitlab", + "appwrite": "#\/components\/schemas\/oAuth2Appwrite", + "authentik": "#\/components\/schemas\/oAuth2Authentik", + "auth0": "#\/components\/schemas\/oAuth2Auth0", + "fusionauth": "#\/components\/schemas\/oAuth2FusionAuth", + "keycloak": "#\/components\/schemas\/oAuth2Keycloak", + "oidc": "#\/components\/schemas\/oAuth2Oidc", + "apple": "#\/components\/schemas\/oAuth2Apple", + "okta": "#\/components\/schemas\/oAuth2Okta", + "kick": "#\/components\/schemas\/oAuth2Kick", + "microsoft": "#\/components\/schemas\/oAuth2Microsoft", + "huggingface": "#\/components\/schemas\/oAuth2HuggingFace", + "resend": "#\/components\/schemas\/oAuth2Resend", + "cloudflare": "#\/components\/schemas\/oAuth2Cloudflare" + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "providers" + ], + "example": { + "total": 5, + "providers": "" + } + }, + "policyPasswordDictionary": { + "description": "Policy Password Dictionary", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "enabled": { + "type": "boolean", + "description": "Whether password dictionary policy is enabled.", + "example": true + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "password-dictionary", + "enabled": true + } + }, + "policyPasswordHistory": { + "description": "Policy Password History", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "total": { + "type": "integer", + "description": "Password history length. A value of 0 means the policy is disabled.", + "format": "int32", + "example": 5 + } + }, + "required": [ + "$id", + "total" + ], + "example": { + "$id": "password-dictionary", + "total": 5 + } + }, + "policyPasswordStrength": { + "description": "Policy Password Strength", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "min": { + "type": "integer", + "description": "Minimum password length required for user passwords.", + "format": "int32", + "example": 12 + }, + "uppercase": { + "type": "boolean", + "description": "Whether passwords must include at least one uppercase letter.", + "example": true + }, + "lowercase": { + "type": "boolean", + "description": "Whether passwords must include at least one lowercase letter.", + "example": true + }, + "number": { + "type": "boolean", + "description": "Whether passwords must include at least one number.", + "example": true + }, + "symbols": { + "type": "boolean", + "description": "Whether passwords must include at least one symbol.", + "example": true + } + }, + "required": [ + "$id", + "min", + "uppercase", + "lowercase", + "number", + "symbols" + ], + "example": { + "$id": "password-dictionary", + "min": 12, + "uppercase": true, + "lowercase": true, + "number": true, + "symbols": true + } + }, + "policyPasswordPersonalData": { + "description": "Policy Password Personal Data", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "enabled": { + "type": "boolean", + "description": "Whether password personal data policy is enabled.", + "example": true + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "password-dictionary", + "enabled": true + } + }, + "policySessionAlert": { + "description": "Policy Session Alert", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "enabled": { + "type": "boolean", + "description": "Whether session alert policy is enabled.", + "example": true + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "password-dictionary", + "enabled": true + } + }, + "policySessionDuration": { + "description": "Policy Session Duration", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "duration": { + "type": "integer", + "description": "Session duration in seconds.", + "format": "int32", + "example": 3600 + } + }, + "required": [ + "$id", + "duration" + ], + "example": { + "$id": "password-dictionary", + "duration": 3600 + } + }, + "policySessionInvalidation": { + "description": "Policy Session Invalidation", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "enabled": { + "type": "boolean", + "description": "Whether session invalidation policy is enabled.", + "example": true + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "password-dictionary", + "enabled": true + } + }, + "policySessionLimit": { + "description": "Policy Session Limit", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "total": { + "type": "integer", + "description": "Maximum number of sessions allowed per user. A value of 0 means the policy is disabled.", + "format": "int32", + "example": 10 + } + }, + "required": [ + "$id", + "total" + ], + "example": { + "$id": "password-dictionary", + "total": 10 + } + }, + "policyUserLimit": { + "description": "Policy User Limit", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "total": { + "type": "integer", + "description": "Maximum number of users allowed in the project. A value of 0 means the policy is disabled.", + "format": "int32", + "example": 100 + } + }, + "required": [ + "$id", + "total" + ], + "example": { + "$id": "password-dictionary", + "total": 100 + } + }, + "policyMembershipPrivacy": { + "description": "Policy Membership Privacy", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "userId": { + "type": "boolean", + "description": "Whether user ID is visible in memberships.", + "example": true + }, + "userEmail": { + "type": "boolean", + "description": "Whether user email is visible in memberships.", + "example": true + }, + "userPhone": { + "type": "boolean", + "description": "Whether user phone is visible in memberships.", + "example": true + }, + "userName": { + "type": "boolean", + "description": "Whether user name is visible in memberships.", + "example": true + }, + "userMFA": { + "type": "boolean", + "description": "Whether user MFA status is visible in memberships.", + "example": true + }, + "userAccessedAt": { + "type": "boolean", + "description": "Whether user last access time is visible in memberships.", + "example": true + } + }, + "required": [ + "$id", + "userId", + "userEmail", + "userPhone", + "userName", + "userMFA", + "userAccessedAt" + ], + "example": { + "$id": "password-dictionary", + "userId": true, + "userEmail": true, + "userPhone": true, + "userName": true, + "userMFA": true, + "userAccessedAt": true + } + }, + "policyMfaFactors": { + "description": "Policy MFA Factors", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "totp": { + "type": "boolean", + "description": "Whether TOTP can be used to complete an MFA challenge.", + "example": true + }, + "email": { + "type": "boolean", + "description": "Whether email can be used to complete an MFA challenge.", + "example": true + }, + "phone": { + "type": "boolean", + "description": "Whether phone (SMS) can be used to complete an MFA challenge.", + "example": true + }, + "custom": { + "type": "boolean", + "description": "Whether the custom factor can be used to complete an MFA challenge.", + "example": true + } + }, + "required": [ + "$id", + "totp", + "email", + "phone", + "custom" + ], + "example": { + "$id": "password-dictionary", + "totp": true, + "email": true, + "phone": true, + "custom": true + } + }, + "platformWeb": { + "description": "Platform Web", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "hostname": { + "type": "string", + "description": "Web app hostname. Empty string for other platforms.", + "example": "app.example.com" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "hostname", + "key" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "hostname": "app.example.com" + } + }, + "platformApple": { + "description": "Platform Apple", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "bundleIdentifier": { + "type": "string", + "description": "Apple bundle identifier.", + "example": "com.company.appname" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "bundleIdentifier" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "bundleIdentifier": "com.company.appname" + } + }, + "platformAndroid": { + "description": "Platform Android", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "applicationId": { + "type": "string", + "description": "Android application ID.", + "example": "com.company.appname" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "applicationId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "applicationId": "com.company.appname" + } + }, + "platformWindows": { + "description": "Platform Windows", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "packageIdentifierName": { + "type": "string", + "description": "Windows package identifier name.", + "example": "com.company.appname" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "packageIdentifierName" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "packageIdentifierName": "com.company.appname" + } + }, + "platformLinux": { + "description": "Platform Linux", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "packageName": { + "type": "string", + "description": "Linux package name.", + "example": "com.company.appname" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "packageName" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "packageName": "com.company.appname" + } + }, + "platformList": { + "description": "Platforms List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of platforms in the given project.", + "format": "int32", + "example": 5 + }, + "platforms": { + "type": "array", + "description": "List of platforms.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/platformWeb" + }, + { + "$ref": "#\/components\/schemas\/platformApple" + }, + { + "$ref": "#\/components\/schemas\/platformAndroid" + }, + { + "$ref": "#\/components\/schemas\/platformWindows" + }, + { + "$ref": "#\/components\/schemas\/platformLinux" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "web": "#\/components\/schemas\/platformWeb", + "apple": "#\/components\/schemas\/platformApple", + "android": "#\/components\/schemas\/platformAndroid", + "windows": "#\/components\/schemas\/platformWindows", + "linux": "#\/components\/schemas\/platformLinux" + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "platforms" + ], + "example": { + "total": 5, + "platforms": "" + } + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "format": "int32", + "example": 2 + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "format": "double", + "example": 0 + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "usageDataPoint": { + "description": "usageDataPoint", + "type": "object", + "properties": { + "time": { + "type": "string", + "description": "Bucket start timestamp in ISO 8601. Omitted for flat dimension aggregates.", + "example": "2026-04-09T12:00:00.000+00:00", + "nullable": true + }, + "value": { + "type": "number", + "description": "Aggregated value for the point.", + "format": "double", + "example": 5000 + }, + "path": { + "type": "string", + "description": "Value when broken down by `path`.", + "example": "\/v1\/storage\/files", + "nullable": true + }, + "method": { + "type": "string", + "description": "Value when broken down by `method`.", + "example": "POST", + "nullable": true + }, + "status": { + "type": "string", + "description": "Value when broken down by `status`.", + "example": "201", + "nullable": true + }, + "service": { + "type": "string", + "description": "Value when broken down by `service`.", + "example": "storage", + "nullable": true + }, + "country": { + "type": "string", + "description": "Value when broken down by `country`.", + "example": "us", + "nullable": true + }, + "region": { + "type": "string", + "description": "Value when broken down by `region`.", + "example": "default", + "nullable": true + }, + "hostname": { + "type": "string", + "description": "Value when broken down by `hostname`.", + "example": "app.example.com", + "nullable": true + }, + "ip": { + "type": "string", + "description": "Value when broken down by `ip`.", + "example": "192.0.2.44", + "nullable": true + }, + "osName": { + "type": "string", + "description": "Value when broken down by `osName`.", + "example": "iOS", + "nullable": true + }, + "clientType": { + "type": "string", + "description": "Value when broken down by `clientType`.", + "example": "browser", + "nullable": true + }, + "clientName": { + "type": "string", + "description": "Value when broken down by `clientName`.", + "example": "Chrome", + "nullable": true + }, + "sdk": { + "type": "string", + "description": "Value when broken down by `sdk`.", + "example": "web", + "nullable": true + }, + "sdkVersion": { + "type": "string", + "description": "Value when broken down by `sdkVersion`.", + "example": "14.0.0", + "nullable": true + }, + "deviceName": { + "type": "string", + "description": "Value when broken down by `deviceName`.", + "example": "smartphone", + "nullable": true + }, + "resourceId": { + "type": "string", + "description": "Value when broken down by `resourceId`.", + "example": "abc123", + "nullable": true + }, + "resourceType": { + "type": "string", + "description": "Value when broken down by `resourceType`.", + "example": "bucket", + "nullable": true + }, + "ordinal": { + "type": "string", + "description": "Value when broken down by `ordinal`.", + "example": "0", + "nullable": true + } + }, + "required": [ + "value" + ], + "example": { + "time": "2026-04-09T12:00:00.000+00:00", + "value": 5000, + "path": "\/v1\/storage\/files", + "method": "POST", + "status": "201", + "service": "storage", + "country": "us", + "region": "default", + "hostname": "app.example.com", + "ip": "192.0.2.44", + "osName": "iOS", + "clientType": "browser", + "clientName": "Chrome", + "sdk": "web", + "sdkVersion": "14.0.0", + "deviceName": "smartphone", + "resourceId": "abc123", + "resourceType": "bucket", + "ordinal": "0" + } + }, + "usageMetric": { + "description": "usageMetric", + "type": "object", + "properties": { + "metric": { + "type": "string", + "description": "Metric key this series describes.", + "example": "files.storage" + }, + "points": { + "type": "array", + "description": "Data points in the requested order.", + "items": { + "$ref": "#\/components\/schemas\/usageDataPoint" + }, + "example": [] + } + }, + "required": [ + "metric", + "points" + ], + "example": { + "metric": "files.storage", + "points": "" + } + }, + "usageEventList": { + "description": "usageEventList", + "type": "object", + "properties": { + "interval": { + "type": "string", + "description": "Requested interval, or an empty string for a flat aggregate.", + "example": "1h" + }, + "metrics": { + "type": "array", + "description": "One series per requested event metric.", + "items": { + "$ref": "#\/components\/schemas\/usageMetric" + }, + "example": [] + } + }, + "required": [ + "interval", + "metrics" + ], + "example": { + "interval": "1h", + "metrics": "" + } + }, + "usageGaugeList": { + "description": "usageGaugeList", + "type": "object", + "properties": { + "interval": { + "type": "string", + "description": "Requested interval, or an empty string for a flat aggregate.", + "example": "1h" + }, + "metrics": { + "type": "array", + "description": "One series per requested gauge metric.", + "items": { + "$ref": "#\/components\/schemas\/usageMetric" + }, + "example": [] + } + }, + "required": [ + "interval", + "metrics" + ], + "example": { + "interval": "1h", + "metrics": "" + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "format": "int32", + "example": 512 + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "format": "double", + "example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } + }, + "proxyRule": { + "description": "Rule", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Rule ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Rule creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Rule update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "domain": { + "type": "string", + "description": "Domain name.", + "example": "appwrite.company.com" + }, + "type": { + "type": "string", + "description": "Action definition for the rule. Possible values are \"api\", \"deployment\", or \"redirect\"", + "example": "deployment" + }, + "trigger": { + "type": "string", + "description": "Defines how the rule was created. Possible values are \"manual\" or \"deployment\"", + "example": "manual" + }, + "redirectUrl": { + "type": "string", + "description": "URL to redirect to. Used if type is \"redirect\"", + "example": "https:\/\/appwrite.io\/docs" + }, + "redirectStatusCode": { + "type": "integer", + "description": "Status code to apply during redirect. Used if type is \"redirect\"", + "format": "int32", + "example": 301 + }, + "deploymentId": { + "type": "string", + "description": "ID of deployment. Used if type is \"deployment\"", + "example": "n3u9feiwmf" + }, + "deploymentResourceType": { + "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", + "example": "function", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "function" + ], + "title": "function" + }, + { + "type": "string", + "enum": [ + "site" + ], + "title": "site" + } + ], + "nullable": true + }, + "deploymentResourceId": { + "type": "string", + "description": "ID of deployment's resource (site or function ID). Used if type is \"deployment\"", + "example": "n3u9feiwmf" + }, + "deploymentVcsProviderBranch": { + "type": "string", + "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", + "example": "main" + }, + "status": { + "description": "Domain verification status. Possible values are \"unverified\", \"verifying\", \"verified\"", + "example": "verified", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "unverified" + ], + "title": "unverified" + }, + { + "type": "string", + "enum": [ + "verifying" + ], + "title": "verifying" + }, + { + "type": "string", + "enum": [ + "verified" + ], + "title": "verified" + } + ] + }, + "logs": { + "type": "string", + "description": "Logs from rule verification or certificate generation. Certificate generation logs are prioritized if both are available.", + "example": "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record." + }, + "renewAt": { + "type": "string", + "description": "Certificate auto-renewal date in ISO 8601 format.", + "example": "datetime" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "domain", + "type", + "trigger", + "redirectUrl", + "redirectStatusCode", + "deploymentId", + "deploymentResourceId", + "deploymentVcsProviderBranch", + "status", + "logs", + "renewAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "main", + "status": "verified", + "logs": "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", + "renewAt": "datetime" + } + }, + "schedule": { + "description": "Schedule", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Schedule ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Schedule creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Schedule update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceType": { + "type": "string", + "description": "The resource type associated with this schedule.", + "example": "function" + }, + "resourceId": { + "type": "string", + "description": "The resource ID associated with this schedule.", + "example": "5e5ea5c16897e" + }, + "resourceUpdatedAt": { + "type": "string", + "description": "Change-tracking timestamp used by the scheduler to detect resource changes in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "projectId": { + "type": "string", + "description": "The project ID associated with this schedule.", + "example": "5e5ea5c16897e" + }, + "schedule": { + "type": "string", + "description": "The CRON schedule expression.", + "example": "5 4 * * *" + }, + "data": { + "type": "object", + "additionalProperties": true, + "description": "Schedule data used to store resource-specific context needed for execution.", + "example": {} + }, + "active": { + "type": "boolean", + "description": "Whether the schedule is active.", + "example": true + }, + "region": { + "type": "string", + "description": "The region where the schedule is deployed.", + "example": "fra" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "resourceType", + "resourceId", + "resourceUpdatedAt", + "projectId", + "schedule", + "data", + "active", + "region" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "resourceType": "function", + "resourceId": "5e5ea5c16897e", + "resourceUpdatedAt": "2020-10-15T06:38:00.000+00:00", + "projectId": "5e5ea5c16897e", + "schedule": "5 4 * * *", + "data": [], + "active": true, + "region": "fra" + } + }, + "stage": { + "description": "Stage", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stage ID.", + "example": "tablesDB.create" + }, + "sdk": { + "type": "string", + "description": "SDK method key (namespace.name) for this stage.", + "example": "tablesDB.create" + }, + "status": { + "type": "string", + "description": "Stage status.", + "example": "completed" + }, + "at": { + "type": "string", + "description": "When the stage was completed or skipped, in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "actorType": { + "type": "string", + "description": "Actor type when the stage was recorded.", + "example": "user" + } + }, + "required": [ + "id", + "sdk", + "status", + "at", + "actorType" + ], + "example": { + "id": "tablesDB.create", + "sdk": "tablesDB.create", + "status": "completed", + "at": "2020-10-15T06:38:00.000+00:00", + "actorType": "user" + } + }, + "emailTemplate": { + "description": "EmailTemplate", + "type": "object", + "properties": { + "templateId": { + "type": "string", + "description": "Template type", + "example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "example": "Click on the link to verify your account." + }, + "senderName": { + "type": "string", + "description": "Name of the sender", + "example": "My User" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "example": "mail@appwrite.io" + }, + "replyToEmail": { + "type": "string", + "description": "Reply to email address", + "example": "emails@appwrite.io" + }, + "replyToName": { + "type": "string", + "description": "Reply to name", + "example": "Support Team" + }, + "subject": { + "type": "string", + "description": "Email subject", + "example": "Please verify your email address" + } + }, + "required": [ + "templateId", + "locale", + "message", + "senderName", + "senderEmail", + "replyToEmail", + "replyToName", + "subject" + ], + "example": { + "templateId": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyToEmail": "emails@appwrite.io", + "replyToName": "Support Team", + "subject": "Please verify your email address" + } + }, + "consoleVariables": { + "description": "Console Variables", + "type": "object", + "properties": { + "_APP_DOMAIN_TARGET_CNAME": { + "type": "string", + "description": "CNAME target for your Appwrite custom domains.", + "example": "appwrite.io" + }, + "_APP_DOMAIN_TARGET_A": { + "type": "string", + "description": "A target for your Appwrite custom domains.", + "example": "127.0.0.1" + }, + "_APP_COMPUTE_BUILD_TIMEOUT": { + "type": "integer", + "description": "Maximum build timeout in seconds.", + "format": "int32", + "example": 900 + }, + "_APP_DOMAIN_TARGET_AAAA": { + "type": "string", + "description": "AAAA target for your Appwrite custom domains.", + "example": "::1" + }, + "_APP_DOMAIN_TARGET_CAA": { + "type": "string", + "description": "CAA target for your Appwrite custom domains.", + "example": "digicert.com" + }, + "_APP_STORAGE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for file upload in bytes.", + "format": "int32", + "example": 30000000 + }, + "_APP_COMPUTE_SIZE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for deployment in bytes.", + "format": "int32", + "example": 30000000 + }, + "_APP_USAGE_STATS": { + "type": "string", + "description": "Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'.", + "example": "enabled" + }, + "_APP_VCS_ENABLED": { + "type": "boolean", + "description": "Defines if VCS (Version Control System) is enabled.", + "example": true + }, + "_APP_VCS_PROVIDERS": { + "type": "array", + "description": "List of configured VCS providers.", + "items": { + "type": "string" + }, + "example": [ + "github" + ] + }, + "_APP_VCS_PROVIDERS_WITH_REPOSITORY_CREATION": { + "type": "array", + "description": "List of configured VCS providers that support repository creation.", + "items": { + "type": "string" + }, + "example": [ + "github" + ] + }, + "_APP_VCS_PROVIDERS_WITH_PUBLIC_REPOSITORIES": { + "type": "array", + "description": "List of configured VCS providers that can host public repositories.", + "items": { + "type": "string" + }, + "example": [ + "github" + ] + }, + "_APP_DOMAIN_ENABLED": { + "type": "boolean", + "description": "Defines if main domain is configured. If so, custom domains can be created.", + "example": true + }, + "_APP_ASSISTANT_ENABLED": { + "type": "boolean", + "description": "Defines if AI assistant is enabled.", + "example": true + }, + "_APP_DOMAIN_SITES": { + "type": "string", + "description": "A comma separated list of domains to use for site URLs.", + "example": "sites.localhost,sites.example.com" + }, + "_APP_DOMAIN_FUNCTIONS": { + "type": "string", + "description": "A domain to use for function URLs.", + "example": "functions.localhost" + }, + "_APP_OPTIONS_FORCE_HTTPS": { + "type": "string", + "description": "Defines if HTTPS is enforced for all requests.", + "example": "enabled" + }, + "_APP_DOMAINS_NAMESERVERS": { + "type": "string", + "description": "Comma-separated list of nameservers.", + "example": "ns1.example.com,ns2.example.com" + }, + "_APP_DB_ADAPTER": { + "type": "string", + "description": "Database adapter in use.", + "example": "mysql" + }, + "supportForRelationships": { + "type": "boolean", + "description": "Whether the database adapter supports relationships.", + "example": true + }, + "supportForOperators": { + "type": "boolean", + "description": "Whether the database adapter supports operators.", + "example": true + }, + "supportForSpatials": { + "type": "boolean", + "description": "Whether the database adapter supports spatial attributes.", + "example": true + }, + "supportForSpatialIndexNull": { + "type": "boolean", + "description": "Whether the database adapter supports spatial indexes on nullable columns.", + "example": false + }, + "supportForFulltextWildcard": { + "type": "boolean", + "description": "Whether the database adapter supports fulltext wildcard search.", + "example": true + }, + "supportForMultipleFulltextIndexes": { + "type": "boolean", + "description": "Whether the database adapter supports multiple fulltext indexes per collection.", + "example": true + }, + "supportForAttributeResizing": { + "type": "boolean", + "description": "Whether the database adapter supports resizing attributes.", + "example": true + }, + "supportForSchemas": { + "type": "boolean", + "description": "Whether the database adapter supports fixed schemas with row width limits.", + "example": true + }, + "maxIndexLength": { + "type": "integer", + "description": "Maximum index length supported by the database adapter.", + "format": "int32", + "example": 768 + }, + "supportForIntegerIds": { + "type": "boolean", + "description": "Whether the database adapter uses integer sequence IDs.", + "example": true + } + }, + "required": [ + "_APP_DOMAIN_TARGET_CNAME", + "_APP_DOMAIN_TARGET_A", + "_APP_COMPUTE_BUILD_TIMEOUT", + "_APP_DOMAIN_TARGET_AAAA", + "_APP_DOMAIN_TARGET_CAA", + "_APP_STORAGE_LIMIT", + "_APP_COMPUTE_SIZE_LIMIT", + "_APP_USAGE_STATS", + "_APP_VCS_ENABLED", + "_APP_VCS_PROVIDERS", + "_APP_VCS_PROVIDERS_WITH_REPOSITORY_CREATION", + "_APP_VCS_PROVIDERS_WITH_PUBLIC_REPOSITORIES", + "_APP_DOMAIN_ENABLED", + "_APP_ASSISTANT_ENABLED", + "_APP_DOMAIN_SITES", + "_APP_DOMAIN_FUNCTIONS", + "_APP_OPTIONS_FORCE_HTTPS", + "_APP_DOMAINS_NAMESERVERS", + "_APP_DB_ADAPTER", + "supportForRelationships", + "supportForOperators", + "supportForSpatials", + "supportForSpatialIndexNull", + "supportForFulltextWildcard", + "supportForMultipleFulltextIndexes", + "supportForAttributeResizing", + "supportForSchemas", + "maxIndexLength", + "supportForIntegerIds" + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_COMPUTE_BUILD_TIMEOUT": 900, + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_DOMAIN_TARGET_CAA": "digicert.com", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_VCS_PROVIDERS": [ + "github" + ], + "_APP_VCS_PROVIDERS_WITH_REPOSITORY_CREATION": [ + "github" + ], + "_APP_VCS_PROVIDERS_WITH_PUBLIC_REPOSITORIES": [ + "github" + ], + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost,sites.example.com", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com", + "_APP_DB_ADAPTER": "mysql", + "supportForRelationships": true, + "supportForOperators": true, + "supportForSpatials": true, + "supportForSpatialIndexNull": false, + "supportForFulltextWildcard": true, + "supportForMultipleFulltextIndexes": true, + "supportForAttributeResizing": true, + "supportForSchemas": true, + "maxIndexLength": 768, + "supportForIntegerIds": true + } + }, + "consoleOAuth2ProviderParameter": { + "description": "Console OAuth2 Provider Parameter", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Parameter ID. Maps to the request body field used by the project OAuth2 update endpoint (e.g. `clientId`, `appKey`, `tenant`).", + "example": "clientId" + }, + "name": { + "type": "string", + "description": "Verbose, user-facing parameter name as shown in the provider's own dashboard. Includes alternate names when the provider exposes more than one.", + "example": "Client ID or App ID" + }, + "example": { + "type": "string", + "description": "Example value for this parameter.", + "example": "e4d87900000000540733" + }, + "hint": { + "type": "string", + "description": "Optional hint for this parameter, typically calling out a common wrong value. Empty string when no hint is set.", + "example": "Example of wrong value: 370006" + } + }, + "required": [ + "$id", + "name", + "example", + "hint" + ], + "example": { + "$id": "clientId", + "name": "Client ID or App ID", + "example": "e4d87900000000540733", + "hint": "Example of wrong value: 370006" + } + }, + "consoleOAuth2Provider": { + "description": "Console OAuth2 Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "parameters": { + "type": "array", + "description": "List of parameters required to configure this OAuth2 provider.", + "items": { + "$ref": "#\/components\/schemas\/consoleOAuth2ProviderParameter" + }, + "example": [] + } + }, + "required": [ + "$id", + "parameters" + ], + "example": { + "$id": "github", + "parameters": "" + } + }, + "consoleOAuth2ProviderList": { + "description": "Console OAuth2 Providers List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of OAuth2 providers exposed by the server.", + "format": "int32", + "example": 5 + }, + "oAuth2Providers": { + "type": "array", + "description": "List of OAuth2 providers, each with the parameters required to configure it.", + "items": { + "$ref": "#\/components\/schemas\/consoleOAuth2Provider" + }, + "example": [] + } + }, + "required": [ + "total", + "oAuth2Providers" + ], + "example": { + "total": 5, + "oAuth2Providers": "" + } + }, + "consoleKeyScope": { + "description": "Console Key Scope", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Scope ID.", + "example": "users.read" + }, + "description": { + "type": "string", + "description": "Scope description.", + "example": "Access to read your project's users" + }, + "category": { + "type": "string", + "description": "Scope category.", + "example": "Auth" + }, + "deprecated": { + "type": "boolean", + "description": "Scope is deprecated.", + "example": true + } + }, + "required": [ + "$id", + "description", + "category", + "deprecated" + ], + "example": { + "$id": "users.read", + "description": "Access to read your project's users", + "category": "Auth", + "deprecated": true + } + }, + "consoleKeyScopeList": { + "description": "Console Key Scopes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of key scopes exposed by the server.", + "format": "int32", + "example": 5 + }, + "scopes": { + "type": "array", + "description": "List of key scopes, each with its ID and description.", + "items": { + "$ref": "#\/components\/schemas\/consoleKeyScope" + }, + "example": [] + } + }, + "required": [ + "total", + "scopes" + ], + "example": { + "total": 5, + "scopes": "" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaChallengeSecret": { + "description": "MFA Challenge Secret", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "code": { + "type": "string", + "description": "Challenge code to be delivered to the end user through a custom channel.", + "example": "446372" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire", + "code" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00", + "code": "446372" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "example": "[SHARED_SECRET]" + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "example": "otpauth:\/\/totp\/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite" + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": "[SHARED_SECRET]", + "uri": "otpauth:\/\/totp\/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite" + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "example": true + }, + "custom": { + "type": "boolean", + "description": "Can custom factor be used for MFA challenge for this account.", + "example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode", + "custom" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true, + "custom": true + } + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "example": "sms" + }, + "credentials": { + "type": "object", + "additionalProperties": true, + "description": "Provider credentials.", + "example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "additionalProperties": true, + "description": "Provider options.", + "example": { + "from": "sender-email@mydomain" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "format": "int32", + "example": 1 + }, + "data": { + "type": "object", + "additionalProperties": true, + "description": "Data of the message.", + "example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "description": "Status of delivery.", + "example": "processing", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "draft" + ], + "title": "draft" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "scheduled" + ], + "title": "scheduled" + }, + { + "type": "string", + "enum": [ + "sent" + ], + "title": "sent" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "processing" + } + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "format": "int32", + "example": 100 + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "format": "int32", + "example": 100 + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "format": "int32", + "example": 100 + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "example": [ + "users" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } + }, + "transaction": { + "description": "Transaction", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Transaction ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Transaction creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Transaction update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Current status of the transaction. One of: pending, committing, committed, rolled_back, failed.", + "example": "pending" + }, + "operations": { + "type": "integer", + "description": "Number of operations in the transaction.", + "format": "int32", + "example": 5 + }, + "expiresAt": { + "type": "string", + "description": "Expiration time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "operations", + "expiresAt" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "operations": 5, + "expiresAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/target" + } + ] + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + }, + "migration": { + "description": "Migration", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Migration ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Migration creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Migration status ( pending, processing, failed, completed ) ", + "example": "pending" + }, + "stage": { + "type": "string", + "description": "Migration stage ( init, processing, source-check, destination-check, migrating, finished )", + "example": "init" + }, + "source": { + "type": "string", + "description": "A string containing the type of source of the migration.", + "example": "Appwrite" + }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "example": "Appwrite" + }, + "resources": { + "type": "array", + "description": "Resources to migrate.", + "items": { + "type": "string" + }, + "example": [ + "user" + ] + }, + "resourceId": { + "type": "string", + "description": "ID of the resource being migrated.", + "example": "collectionId" + }, + "resourceInternalId": { + "type": "string", + "description": "Internal ID of the resource being migrated.", + "example": "1" + }, + "resourceType": { + "type": "string", + "description": "Type of the resource being migrated.", + "example": "collection" + }, + "parentResourceId": { + "type": "string", + "description": "ID of the parent resource that contains the migrated resource.", + "example": "databaseId" + }, + "parentResourceInternalId": { + "type": "string", + "description": "Internal ID of the parent resource that contains the migrated resource.", + "example": "1" + }, + "parentResourceType": { + "type": "string", + "description": "Type of the parent resource that contains the migrated resource.", + "example": "database" + }, + "destinationResourceId": { + "type": "string", + "description": "ID of the destination resource created or overwritten by the migration.", + "example": "databaseId" + }, + "destinationResourceInternalId": { + "type": "string", + "description": "Internal ID of the destination resource created or overwritten by the migration.", + "example": "1" + }, + "destinationResourceType": { + "type": "string", + "description": "Type of the destination resource created or overwritten by the migration.", + "example": "database" + }, + "statusCounters": { + "type": "object", + "additionalProperties": true, + "description": "A group of counters that represent the total progress of the migration.", + "example": { + "Database": { + "PENDING": 0, + "SUCCESS": 1, + "ERROR": 0, + "SKIP": 0, + "PROCESSING": 0, + "WARNING": 0 + } + } + }, + "resourceData": { + "type": "array", + "description": "An array of objects containing the report data of the resources that were migrated.", + "items": { + "type": "object" + }, + "example": [ + { + "resource": "Database", + "id": "public", + "status": "SUCCESS", + "message": "" + } + ] + }, + "errors": { + "type": "array", + "description": "All errors that occurred during the migration process.", + "items": { + "type": "string" + }, + "example": [] + }, + "options": { + "type": "object", + "additionalProperties": true, + "description": "Migration options used during the migration process.", + "example": { + "bucketId": "exports", + "notify": false + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "stage", + "source", + "destination", + "resources", + "resourceId", + "resourceInternalId", + "resourceType", + "parentResourceId", + "parentResourceInternalId", + "parentResourceType", + "destinationResourceId", + "destinationResourceInternalId", + "destinationResourceType", + "statusCounters", + "resourceData", + "errors", + "options" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "collectionId", + "resourceInternalId": "1", + "resourceType": "collection", + "parentResourceId": "databaseId", + "parentResourceInternalId": "1", + "parentResourceType": "database", + "destinationResourceId": "databaseId", + "destinationResourceInternalId": "1", + "destinationResourceType": "database", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [], + "options": "{\"bucketId\": \"exports\", \"notify\": false}" + } + }, + "migrationReport": { + "description": "Migration Report", + "type": "object", + "properties": { + "user": { + "type": "integer", + "description": "Number of users to be migrated.", + "format": "int32", + "example": 20 + }, + "team": { + "type": "integer", + "description": "Number of teams to be migrated.", + "format": "int32", + "example": 20 + }, + "database": { + "type": "integer", + "description": "Number of databases to be migrated.", + "format": "int32", + "example": 20 + }, + "row": { + "type": "integer", + "description": "Number of rows to be migrated.", + "format": "int32", + "example": 20 + }, + "file": { + "type": "integer", + "description": "Number of files to be migrated.", + "format": "int32", + "example": 20 + }, + "bucket": { + "type": "integer", + "description": "Number of buckets to be migrated.", + "format": "int32", + "example": 20 + }, + "function": { + "type": "integer", + "description": "Number of functions to be migrated.", + "format": "int32", + "example": 20 + }, + "platform": { + "type": "integer", + "description": "Number of platforms to be migrated.", + "format": "int32", + "example": 5 + }, + "api-key": { + "type": "integer", + "description": "Number of API keys to be migrated.", + "format": "int32", + "example": 5 + }, + "project-variable": { + "type": "integer", + "description": "Number of project variables to be migrated.", + "format": "int32", + "example": 5 + }, + "webhook": { + "type": "integer", + "description": "Number of webhooks to be migrated.", + "format": "int32", + "example": 5 + }, + "auth-methods": { + "type": "integer", + "description": "Number of auth-method configs to be migrated (always 0 or 1 \u2014 the project-level flag bundle).", + "format": "int32", + "example": 1 + }, + "project-protocols": { + "type": "integer", + "description": "Number of protocol configs to be migrated (always 0 or 1 \u2014 the project-level REST\/GraphQL\/WebSocket flags).", + "format": "int32", + "example": 1 + }, + "project-labels": { + "type": "integer", + "description": "Number of label sets to be migrated (always 0 or 1 \u2014 the project-level RBAC label array).", + "format": "int32", + "example": 1 + }, + "project-services": { + "type": "integer", + "description": "Number of service configs to be migrated (always 0 or 1 \u2014 the project-level enable\/disable flags for all 17 services).", + "format": "int32", + "example": 1 + }, + "policies": { + "type": "integer", + "description": "Number of policy bundles to be migrated (always 0 or 1 \u2014 the project-level security policies covering password rules, session behavior, user limits, and membership privacy).", + "format": "int32", + "example": 1 + }, + "smtp": { + "type": "integer", + "description": "Number of SMTP configurations to be migrated (always 0 or 1 \u2014 the project-level custom SMTP settings; password is not exposed by the source API).", + "format": "int32", + "example": 1 + }, + "rule": { + "type": "integer", + "description": "Number of custom-domain proxy rules to be migrated. Auto-generated `.appwrite.network` rules are skipped \u2014 they are recreated by parent Function\/Site migration.", + "format": "int32", + "example": 5 + }, + "project-email-template": { + "type": "integer", + "description": "Number of custom email templates to be migrated (one per templateId \u00d7 locale pair).", + "format": "int32", + "example": 7 + }, + "site": { + "type": "integer", + "description": "Number of sites to be migrated.", + "format": "int32", + "example": 5 + }, + "provider": { + "type": "integer", + "description": "Number of providers to be migrated.", + "format": "int32", + "example": 5 + }, + "topic": { + "type": "integer", + "description": "Number of topics to be migrated.", + "format": "int32", + "example": 10 + }, + "subscriber": { + "type": "integer", + "description": "Number of subscribers to be migrated.", + "format": "int32", + "example": 100 + }, + "message": { + "type": "integer", + "description": "Number of messages to be migrated.", + "format": "int32", + "example": 50 + }, + "size": { + "type": "integer", + "description": "Size of files to be migrated in mb.", + "format": "int32", + "example": 30000 + }, + "version": { + "type": "string", + "description": "Version of the Appwrite instance to be migrated.", + "example": "1.4.0" + }, + "oauth2-provider": { + "type": "integer", + "description": "Number of OAuth2 provider configurations to be migrated. Secrets (clientSecret, p8File) are never migrated \u2014 destination admin must re-enter them per provider.", + "format": "int32", + "example": 5 + } + }, + "required": [ + "user", + "team", + "database", + "row", + "file", + "bucket", + "function", + "platform", + "api-key", + "project-variable", + "webhook", + "auth-methods", + "project-protocols", + "project-labels", + "project-services", + "policies", + "smtp", + "rule", + "project-email-template", + "site", + "provider", + "topic", + "subscriber", + "message", + "size", + "version", + "oauth2-provider" + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "row": 20, + "file": 20, + "bucket": 20, + "function": 20, + "platform": 5, + "api-key": 5, + "project-variable": 5, + "webhook": 5, + "auth-methods": 1, + "project-protocols": 1, + "project-labels": 1, + "project-services": 1, + "policies": 1, + "smtp": 1, + "rule": 5, + "project-email-template": 7, + "site": 5, + "provider": 5, + "topic": 10, + "subscriber": 100, + "message": 50, + "size": 30000, + "version": "1.4.0", + "oauth2-provider": 5 + } + }, + "insight": { + "description": "Insight", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Insight ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Insight creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Insight update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "reportId": { + "type": "string", + "description": "Parent report ID. Insights always belong to a report.", + "example": "5e5ea5c16897e" + }, + "type": { + "type": "string", + "description": "Insight type. One of databaseIndex (legacy), tablesDBIndex, documentsDBIndex, vectorsDBIndex, databasePerformance, sitePerformance, siteAccessibility, siteSeo, functionPerformance. The index types are engine-specific so each CTA can pair the right service+method (databases.createIndex, tablesDB.createIndex, documentsDB.createIndex, or vectorsDB.createIndex).", + "example": "tablesDBIndex" + }, + "severity": { + "type": "string", + "description": "Insight severity. One of info, warning, critical.", + "example": "warning" + }, + "status": { + "type": "string", + "description": "Insight status. One of active, dismissed.", + "example": "active" + }, + "resourceType": { + "type": "string", + "description": "Type of the resource the insight is about. Plural noun, e.g. databases, sites, functions.", + "example": "databases" + }, + "resourceId": { + "type": "string", + "description": "ID of the resource the insight is about.", + "example": "main" + }, + "parentResourceType": { + "type": "string", + "description": "Plural noun for the parent resource that contains the insight's resource, e.g. an insight about a column index on a table \u2192 resourceType=indexes, parentResourceType=tables. Empty when the resource has no parent.", + "example": "tables" + }, + "parentResourceId": { + "type": "string", + "description": "ID of the parent resource. Empty when the resource has no parent.", + "example": "orders" + }, + "title": { + "type": "string", + "description": "Insight title.", + "example": "Missing index on collection orders" + }, + "summary": { + "type": "string", + "description": "Short markdown summary describing the insight.", + "example": "Queries against `orders.status` are scanning the full collection." + }, + "ctas": { + "type": "array", + "description": "List of call-to-action buttons attached to this insight.", + "items": { + "$ref": "#\/components\/schemas\/insightCTA" + }, + "example": [] + }, + "analyzedAt": { + "type": "string", + "description": "Time the insight was analyzed in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "dismissedAt": { + "type": "string", + "description": "Time the insight was dismissed in ISO 8601 format. Empty when not dismissed.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "dismissedBy": { + "type": "string", + "description": "User ID that dismissed the insight. Empty when not dismissed.", + "example": "5e5ea5c16897e", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "reportId", + "type", + "severity", + "status", + "resourceType", + "resourceId", + "parentResourceType", + "parentResourceId", + "title", + "summary", + "ctas" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "reportId": "5e5ea5c16897e", + "type": "tablesDBIndex", + "severity": "warning", + "status": "active", + "resourceType": "databases", + "resourceId": "main", + "parentResourceType": "tables", + "parentResourceId": "orders", + "title": "Missing index on collection orders", + "summary": "Queries against `orders.status` are scanning the full collection.", + "ctas": [], + "analyzedAt": "2020-10-15T06:38:00.000+00:00", + "dismissedAt": "2020-10-15T06:38:00.000+00:00", + "dismissedBy": "5e5ea5c16897e" + } + }, + "insightCTA": { + "description": "InsightCTA", + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "Human-readable label for the CTA, used in UI.", + "example": "Create missing index" + }, + "service": { + "type": "string", + "description": "Public API service (SDK namespace) the client should invoke. Must match the engine that owns the resource \u2014 for index suggestions: databases (legacy), tablesDB, documentsDB, or vectorsDB.", + "example": "tablesDB" + }, + "method": { + "type": "string", + "description": "Public API method on the chosen service the client should invoke when this CTA is triggered.", + "example": "createIndex" + }, + "params": { + "type": "object", + "additionalProperties": true, + "description": "Parameter map the client should pass to the service method when this CTA is triggered. Keys match the target API's parameter names (e.g. databaseId\/tableId\/columns for tablesDB, databaseId\/collectionId\/attributes for the legacy Databases API).", + "example": { + "databaseId": "main", + "tableId": "orders", + "key": "_idx_status", + "type": "key", + "columns": [ + "status" + ] + } + } + }, + "required": [ + "label", + "service", + "method", + "params" + ], + "example": { + "label": "Create missing index", + "service": "tablesDB", + "method": "createIndex", + "params": { + "databaseId": "main", + "tableId": "orders", + "key": "_idx_status", + "type": "key", + "columns": [ + "status" + ] + } + } + }, + "report": { + "description": "Report", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Report ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Report creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Report update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "appId": { + "type": "string", + "description": "ID of the third-party app that submitted the report.", + "example": "5e5ea5c16897e" + }, + "type": { + "type": "string", + "description": "Analyzer that produced this report. e.g. lighthouse, audit, databaseAnalyzer.", + "example": "lighthouse" + }, + "title": { + "type": "string", + "description": "Short, human-readable title for the report.", + "example": "Lighthouse audit for https:\/\/appwrite.io\/" + }, + "summary": { + "type": "string", + "description": "Markdown summary describing the report.", + "example": "Performance score 78. 4 opportunities found." + }, + "targetType": { + "type": "string", + "description": "Plural noun describing what the report analyzes, e.g. databases, sites, urls.", + "example": "urls" + }, + "target": { + "type": "string", + "description": "Free-form target identifier (URL for lighthouse, resource ID for db).", + "example": "https:\/\/appwrite.io\/" + }, + "categories": { + "type": "array", + "description": "Categories covered by the report, e.g. performance, accessibility.", + "items": { + "type": "string" + }, + "example": [ + "performance", + "accessibility" + ] + }, + "insights": { + "type": "array", + "description": "Insights nested under this report.", + "items": { + "$ref": "#\/components\/schemas\/insight" + }, + "example": [] + }, + "analyzedAt": { + "type": "string", + "description": "Time the report was analyzed in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "appId", + "type", + "title", + "summary", + "targetType", + "target", + "categories", + "insights" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "appId": "5e5ea5c16897e", + "type": "lighthouse", + "title": "Lighthouse audit for https:\/\/appwrite.io\/", + "summary": "Performance score 78. 4 opportunities found.", + "targetType": "urls", + "target": "https:\/\/appwrite.io\/", + "categories": [ + "performance", + "accessibility" + ], + "insights": [], + "analyzedAt": "2020-10-15T06:38:00.000+00:00" + } + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "ProjectPath": { + "type": "apiKey", + "name": "project", + "description": "Your project ID", + "in": "query", + "x-appwrite": { + "location": "path", + "param": "project_id", + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "Organization": { + "type": "apiKey", + "name": "X-Appwrite-Organization", + "description": "Your organization ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_ORGANIZATION_ID>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "The OAuth access token to authenticate with" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Mode": { + "type": "apiKey", + "name": "X-Appwrite-Mode", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "" + } + }, + "Cookie": { + "type": "apiKey", + "name": "Cookie", + "description": "The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes.", + "in": "header" + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "DevKey": { + "type": "apiKey", + "name": "X-Appwrite-Dev-Key", + "description": "Your secret dev API key", + "in": "header" + }, + "ImpersonateUserId": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Id", + "description": "Impersonate a user by ID", + "in": "header", + "x-appwrite": { + "optional": true + } + }, + "ImpersonateUserEmail": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Email", + "description": "Impersonate a user by email", + "in": "header", + "x-appwrite": { + "optional": true + } + }, + "ImpersonateUserPhone": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Phone", + "description": "Impersonate a user by phone", + "in": "header", + "x-appwrite": { + "optional": true + } + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/specs/2.0.x/open-api3-2.0.x-server.json b/specs/2.0.x/open-api3-2.0.x-server.json new file mode 100644 index 000000000..b976ed428 --- /dev/null +++ b/specs/2.0.x/open-api3-2.0.x-server.json @@ -0,0 +1,84628 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "2.0.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1", + "description": "Appwrite Cloud endpoint." + }, + { + "url": "https:\/\/{region}.cloud.appwrite.io\/v1", + "description": "Appwrite Cloud regional endpoint. Replace `{region}` with your project region.", + "variables": { + "region": { + "default": "fra", + "description": "Appwrite Cloud region." + } + } + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "New user password. Must be between 8 and 256 chars.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "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.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "description": "Enable or disable MFA.", + "type": "boolean", + "example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "description": "Valid verification token.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenges": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.", + "type": "string", + "example": "email", + "title": "AuthenticationFactor", + "oneOf": [ + { + "type": "string", + "enum": [ + "email" + ], + "title": "email" + }, + { + "type": "string", + "enum": [ + "phone" + ], + "title": "phone" + }, + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + }, + { + "type": "string", + "enum": [ + "recoverycode" + ], + "title": "recoverycode" + }, + { + "type": "string", + "enum": [ + "custom" + ], + "title": "custom" + } + ] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "description": "ID of the challenge.", + "type": "string", + "example": "<CHALLENGE_ID>" + }, + "otp": { + "description": "Valid verification token.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "description": "New user password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + }, + "oldPassword": { + "description": "Current user password. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "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.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "example": "+12065550100", + "format": "phone" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "description": "Prefs key-value JSON object.", + "type": "object", + "default": {}, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "url": { + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project 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.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid reset token.", + "type": "string", + "example": "<SECRET>" + }, + "password": { + "description": "New user password. Must be between 8 and 256 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-anonymous-session.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-email-password-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-magic-url-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-phone-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "secret": { + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>", + "default": "current" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "account", + "demo": "account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-email-token.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-magic-url-token.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "url": { + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project 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.", + "type": "string", + "default": "", + "example": "https:\/\/example.com", + "format": "url" + }, + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content", + "content": { + "text\/html": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-o-auth-2-token.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "example": "amazon", + "title": "OAuthProvider", + "oneOf": [ + { + "type": "string", + "enum": [ + "amazon" + ], + "title": "amazon" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "appwrite" + ], + "title": "appwrite" + }, + { + "type": "string", + "enum": [ + "auth0" + ], + "title": "auth0" + }, + { + "type": "string", + "enum": [ + "authentik" + ], + "title": "authentik" + }, + { + "type": "string", + "enum": [ + "autodesk" + ], + "title": "autodesk" + }, + { + "type": "string", + "enum": [ + "bitbucket" + ], + "title": "bitbucket" + }, + { + "type": "string", + "enum": [ + "bitly" + ], + "title": "bitly" + }, + { + "type": "string", + "enum": [ + "box" + ], + "title": "box" + }, + { + "type": "string", + "enum": [ + "cloudflare" + ], + "title": "cloudflare" + }, + { + "type": "string", + "enum": [ + "dailymotion" + ], + "title": "dailymotion" + }, + { + "type": "string", + "enum": [ + "discord" + ], + "title": "discord" + }, + { + "type": "string", + "enum": [ + "disqus" + ], + "title": "disqus" + }, + { + "type": "string", + "enum": [ + "dropbox" + ], + "title": "dropbox" + }, + { + "type": "string", + "enum": [ + "etsy" + ], + "title": "etsy" + }, + { + "type": "string", + "enum": [ + "facebook" + ], + "title": "facebook" + }, + { + "type": "string", + "enum": [ + "figma" + ], + "title": "figma" + }, + { + "type": "string", + "enum": [ + "fusionauth" + ], + "title": "fusionauth" + }, + { + "type": "string", + "enum": [ + "github" + ], + "title": "github" + }, + { + "type": "string", + "enum": [ + "gitlab" + ], + "title": "gitlab" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + }, + { + "type": "string", + "enum": [ + "huggingface" + ], + "title": "huggingface" + }, + { + "type": "string", + "enum": [ + "keycloak" + ], + "title": "keycloak" + }, + { + "type": "string", + "enum": [ + "kick" + ], + "title": "kick" + }, + { + "type": "string", + "enum": [ + "linkedin" + ], + "title": "linkedin" + }, + { + "type": "string", + "enum": [ + "microsoft" + ], + "title": "microsoft" + }, + { + "type": "string", + "enum": [ + "notion" + ], + "title": "notion" + }, + { + "type": "string", + "enum": [ + "oidc" + ], + "title": "oidc" + }, + { + "type": "string", + "enum": [ + "okta" + ], + "title": "okta" + }, + { + "type": "string", + "enum": [ + "paypal" + ], + "title": "paypal" + }, + { + "type": "string", + "enum": [ + "paypalSandbox" + ], + "title": "paypalSandbox" + }, + { + "type": "string", + "enum": [ + "podio" + ], + "title": "podio" + }, + { + "type": "string", + "enum": [ + "resend" + ], + "title": "resend" + }, + { + "type": "string", + "enum": [ + "salesforce" + ], + "title": "salesforce" + }, + { + "type": "string", + "enum": [ + "slack" + ], + "title": "slack" + }, + { + "type": "string", + "enum": [ + "spotify" + ], + "title": "spotify" + }, + { + "type": "string", + "enum": [ + "stripe" + ], + "title": "stripe" + }, + { + "type": "string", + "enum": [ + "tradeshift" + ], + "title": "tradeshift" + }, + { + "type": "string", + "enum": [ + "tradeshiftBox" + ], + "title": "tradeshiftBox" + }, + { + "type": "string", + "enum": [ + "twitch" + ], + "title": "twitch" + }, + { + "type": "string", + "enum": [ + "wordpress" + ], + "title": "wordpress" + }, + { + "type": "string", + "enum": [ + "x" + ], + "title": "x" + }, + { + "type": "string", + "enum": [ + "yahoo" + ], + "title": "yahoo" + }, + { + "type": "string", + "enum": [ + "yammer" + ], + "title": "yammer" + }, + { + "type": "string", + "enum": [ + "yandex" + ], + "title": "yandex" + }, + { + "type": "string", + "enum": [ + "zoho" + ], + "title": "zoho" + }, + { + "type": "string", + "enum": [ + "zoom" + ], + "title": "zoom" + } + ] + }, + "in": "path" + }, + { + "name": "success", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "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.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "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.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "account\/create-phone-token.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "example": "+12065550100", + "format": "phone" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verifications\/email": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateEmailVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createEmailVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "url" + ], + "required": [ + "url" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "demo": "account\/create-email-verification.md", + "public": true + }, + { + "name": "createVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "url" + ], + "required": [ + "url" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "demo": "account\/create-verification.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createEmailVerification" + } + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateEmailVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "updateEmailVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "userId", + "secret" + ], + "required": [ + "userId", + "secret" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "demo": "account\/update-email-verification.md", + "public": true + }, + { + "name": "updateVerification", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "userId", + "secret" + ], + "required": [ + "userId", + "secret" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/token" + } + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "demo": "account\/update-verification.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateEmailVerification" + } + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verifications\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Valid verification token.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "example": "aa", + "title": "Browser", + "oneOf": [ + { + "type": "string", + "enum": [ + "aa" + ], + "title": "Avant Browser" + }, + { + "type": "string", + "enum": [ + "an" + ], + "title": "Android WebView Beta" + }, + { + "type": "string", + "enum": [ + "ch" + ], + "title": "Google Chrome" + }, + { + "type": "string", + "enum": [ + "ci" + ], + "title": "Google Chrome (iOS)" + }, + { + "type": "string", + "enum": [ + "cm" + ], + "title": "Google Chrome (Mobile)" + }, + { + "type": "string", + "enum": [ + "cr" + ], + "title": "Chromium" + }, + { + "type": "string", + "enum": [ + "ff" + ], + "title": "Mozilla Firefox" + }, + { + "type": "string", + "enum": [ + "sf" + ], + "title": "Safari" + }, + { + "type": "string", + "enum": [ + "mf" + ], + "title": "Mobile Safari" + }, + { + "type": "string", + "enum": [ + "ps" + ], + "title": "Microsoft Edge" + }, + { + "type": "string", + "enum": [ + "oi" + ], + "title": "Microsoft Edge (iOS)" + }, + { + "type": "string", + "enum": [ + "om" + ], + "title": "Opera Mini" + }, + { + "type": "string", + "enum": [ + "op" + ], + "title": "Opera" + }, + { + "type": "string", + "enum": [ + "on" + ], + "title": "Opera (Next)" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "example": "amex", + "title": "CreditCard", + "oneOf": [ + { + "type": "string", + "enum": [ + "amex" + ], + "title": "American Express" + }, + { + "type": "string", + "enum": [ + "argencard" + ], + "title": "Argencard" + }, + { + "type": "string", + "enum": [ + "cabal" + ], + "title": "Cabal" + }, + { + "type": "string", + "enum": [ + "cencosud" + ], + "title": "Cencosud" + }, + { + "type": "string", + "enum": [ + "diners" + ], + "title": "Diners Club" + }, + { + "type": "string", + "enum": [ + "discover" + ], + "title": "Discover" + }, + { + "type": "string", + "enum": [ + "elo" + ], + "title": "Elo" + }, + { + "type": "string", + "enum": [ + "hipercard" + ], + "title": "Hipercard" + }, + { + "type": "string", + "enum": [ + "jcb" + ], + "title": "JCB" + }, + { + "type": "string", + "enum": [ + "mastercard" + ], + "title": "Mastercard" + }, + { + "type": "string", + "enum": [ + "naranja" + ], + "title": "Naranja" + }, + { + "type": "string", + "enum": [ + "targeta-shopping" + ], + "title": "Tarjeta Shopping" + }, + { + "type": "string", + "enum": [ + "unionpay" + ], + "title": "Union Pay" + }, + { + "type": "string", + "enum": [ + "visa" + ], + "title": "Visa" + }, + { + "type": "string", + "enum": [ + "mir" + ], + "title": "MIR" + }, + { + "type": "string", + "enum": [ + "maestro" + ], + "title": "Maestro" + }, + { + "type": "string", + "enum": [ + "rupay" + ], + "title": "Rupay" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "example": "af", + "title": "Flag", + "oneOf": [ + { + "type": "string", + "enum": [ + "af" + ], + "title": "Afghanistan" + }, + { + "type": "string", + "enum": [ + "ao" + ], + "title": "Angola" + }, + { + "type": "string", + "enum": [ + "al" + ], + "title": "Albania" + }, + { + "type": "string", + "enum": [ + "ad" + ], + "title": "Andorra" + }, + { + "type": "string", + "enum": [ + "ae" + ], + "title": "United Arab Emirates" + }, + { + "type": "string", + "enum": [ + "ar" + ], + "title": "Argentina" + }, + { + "type": "string", + "enum": [ + "am" + ], + "title": "Armenia" + }, + { + "type": "string", + "enum": [ + "ag" + ], + "title": "Antigua and Barbuda" + }, + { + "type": "string", + "enum": [ + "au" + ], + "title": "Australia" + }, + { + "type": "string", + "enum": [ + "at" + ], + "title": "Austria" + }, + { + "type": "string", + "enum": [ + "az" + ], + "title": "Azerbaijan" + }, + { + "type": "string", + "enum": [ + "bi" + ], + "title": "Burundi" + }, + { + "type": "string", + "enum": [ + "be" + ], + "title": "Belgium" + }, + { + "type": "string", + "enum": [ + "bj" + ], + "title": "Benin" + }, + { + "type": "string", + "enum": [ + "bf" + ], + "title": "Burkina Faso" + }, + { + "type": "string", + "enum": [ + "bd" + ], + "title": "Bangladesh" + }, + { + "type": "string", + "enum": [ + "bg" + ], + "title": "Bulgaria" + }, + { + "type": "string", + "enum": [ + "bh" + ], + "title": "Bahrain" + }, + { + "type": "string", + "enum": [ + "bs" + ], + "title": "Bahamas" + }, + { + "type": "string", + "enum": [ + "ba" + ], + "title": "Bosnia and Herzegovina" + }, + { + "type": "string", + "enum": [ + "by" + ], + "title": "Belarus" + }, + { + "type": "string", + "enum": [ + "bz" + ], + "title": "Belize" + }, + { + "type": "string", + "enum": [ + "bo" + ], + "title": "Bolivia" + }, + { + "type": "string", + "enum": [ + "br" + ], + "title": "Brazil" + }, + { + "type": "string", + "enum": [ + "bb" + ], + "title": "Barbados" + }, + { + "type": "string", + "enum": [ + "bn" + ], + "title": "Brunei Darussalam" + }, + { + "type": "string", + "enum": [ + "bt" + ], + "title": "Bhutan" + }, + { + "type": "string", + "enum": [ + "bw" + ], + "title": "Botswana" + }, + { + "type": "string", + "enum": [ + "cf" + ], + "title": "Central African Republic" + }, + { + "type": "string", + "enum": [ + "ca" + ], + "title": "Canada" + }, + { + "type": "string", + "enum": [ + "ch" + ], + "title": "Switzerland" + }, + { + "type": "string", + "enum": [ + "cl" + ], + "title": "Chile" + }, + { + "type": "string", + "enum": [ + "cn" + ], + "title": "China" + }, + { + "type": "string", + "enum": [ + "ci" + ], + "title": "C\u00f4te d'Ivoire" + }, + { + "type": "string", + "enum": [ + "cm" + ], + "title": "Cameroon" + }, + { + "type": "string", + "enum": [ + "cd" + ], + "title": "Democratic Republic of the Congo" + }, + { + "type": "string", + "enum": [ + "cg" + ], + "title": "Republic of the Congo" + }, + { + "type": "string", + "enum": [ + "co" + ], + "title": "Colombia" + }, + { + "type": "string", + "enum": [ + "km" + ], + "title": "Comoros" + }, + { + "type": "string", + "enum": [ + "cv" + ], + "title": "Cape Verde" + }, + { + "type": "string", + "enum": [ + "cr" + ], + "title": "Costa Rica" + }, + { + "type": "string", + "enum": [ + "cu" + ], + "title": "Cuba" + }, + { + "type": "string", + "enum": [ + "cy" + ], + "title": "Cyprus" + }, + { + "type": "string", + "enum": [ + "cz" + ], + "title": "Czech Republic" + }, + { + "type": "string", + "enum": [ + "de" + ], + "title": "Germany" + }, + { + "type": "string", + "enum": [ + "dj" + ], + "title": "Djibouti" + }, + { + "type": "string", + "enum": [ + "dm" + ], + "title": "Dominica" + }, + { + "type": "string", + "enum": [ + "dk" + ], + "title": "Denmark" + }, + { + "type": "string", + "enum": [ + "do" + ], + "title": "Dominican Republic" + }, + { + "type": "string", + "enum": [ + "dz" + ], + "title": "Algeria" + }, + { + "type": "string", + "enum": [ + "ec" + ], + "title": "Ecuador" + }, + { + "type": "string", + "enum": [ + "eg" + ], + "title": "Egypt" + }, + { + "type": "string", + "enum": [ + "er" + ], + "title": "Eritrea" + }, + { + "type": "string", + "enum": [ + "es" + ], + "title": "Spain" + }, + { + "type": "string", + "enum": [ + "ee" + ], + "title": "Estonia" + }, + { + "type": "string", + "enum": [ + "et" + ], + "title": "Ethiopia" + }, + { + "type": "string", + "enum": [ + "fi" + ], + "title": "Finland" + }, + { + "type": "string", + "enum": [ + "fj" + ], + "title": "Fiji" + }, + { + "type": "string", + "enum": [ + "fr" + ], + "title": "France" + }, + { + "type": "string", + "enum": [ + "fm" + ], + "title": "Micronesia (Federated States of)" + }, + { + "type": "string", + "enum": [ + "ga" + ], + "title": "Gabon" + }, + { + "type": "string", + "enum": [ + "gb" + ], + "title": "United Kingdom" + }, + { + "type": "string", + "enum": [ + "ge" + ], + "title": "Georgia" + }, + { + "type": "string", + "enum": [ + "gh" + ], + "title": "Ghana" + }, + { + "type": "string", + "enum": [ + "gn" + ], + "title": "Guinea" + }, + { + "type": "string", + "enum": [ + "gm" + ], + "title": "Gambia" + }, + { + "type": "string", + "enum": [ + "gw" + ], + "title": "Guinea-Bissau" + }, + { + "type": "string", + "enum": [ + "gq" + ], + "title": "Equatorial Guinea" + }, + { + "type": "string", + "enum": [ + "gr" + ], + "title": "Greece" + }, + { + "type": "string", + "enum": [ + "gd" + ], + "title": "Grenada" + }, + { + "type": "string", + "enum": [ + "gt" + ], + "title": "Guatemala" + }, + { + "type": "string", + "enum": [ + "gy" + ], + "title": "Guyana" + }, + { + "type": "string", + "enum": [ + "hn" + ], + "title": "Honduras" + }, + { + "type": "string", + "enum": [ + "hr" + ], + "title": "Croatia" + }, + { + "type": "string", + "enum": [ + "ht" + ], + "title": "Haiti" + }, + { + "type": "string", + "enum": [ + "hu" + ], + "title": "Hungary" + }, + { + "type": "string", + "enum": [ + "id" + ], + "title": "Indonesia" + }, + { + "type": "string", + "enum": [ + "in" + ], + "title": "India" + }, + { + "type": "string", + "enum": [ + "ie" + ], + "title": "Ireland" + }, + { + "type": "string", + "enum": [ + "ir" + ], + "title": "Iran (Islamic Republic of)" + }, + { + "type": "string", + "enum": [ + "iq" + ], + "title": "Iraq" + }, + { + "type": "string", + "enum": [ + "is" + ], + "title": "Iceland" + }, + { + "type": "string", + "enum": [ + "il" + ], + "title": "Israel" + }, + { + "type": "string", + "enum": [ + "it" + ], + "title": "Italy" + }, + { + "type": "string", + "enum": [ + "jm" + ], + "title": "Jamaica" + }, + { + "type": "string", + "enum": [ + "jo" + ], + "title": "Jordan" + }, + { + "type": "string", + "enum": [ + "jp" + ], + "title": "Japan" + }, + { + "type": "string", + "enum": [ + "kz" + ], + "title": "Kazakhstan" + }, + { + "type": "string", + "enum": [ + "ke" + ], + "title": "Kenya" + }, + { + "type": "string", + "enum": [ + "kg" + ], + "title": "Kyrgyzstan" + }, + { + "type": "string", + "enum": [ + "kh" + ], + "title": "Cambodia" + }, + { + "type": "string", + "enum": [ + "ki" + ], + "title": "Kiribati" + }, + { + "type": "string", + "enum": [ + "kn" + ], + "title": "Saint Kitts and Nevis" + }, + { + "type": "string", + "enum": [ + "kr" + ], + "title": "South Korea" + }, + { + "type": "string", + "enum": [ + "kw" + ], + "title": "Kuwait" + }, + { + "type": "string", + "enum": [ + "la" + ], + "title": "Lao People's Democratic Republic" + }, + { + "type": "string", + "enum": [ + "lb" + ], + "title": "Lebanon" + }, + { + "type": "string", + "enum": [ + "lr" + ], + "title": "Liberia" + }, + { + "type": "string", + "enum": [ + "ly" + ], + "title": "Libya" + }, + { + "type": "string", + "enum": [ + "lc" + ], + "title": "Saint Lucia" + }, + { + "type": "string", + "enum": [ + "li" + ], + "title": "Liechtenstein" + }, + { + "type": "string", + "enum": [ + "lk" + ], + "title": "Sri Lanka" + }, + { + "type": "string", + "enum": [ + "ls" + ], + "title": "Lesotho" + }, + { + "type": "string", + "enum": [ + "lt" + ], + "title": "Lithuania" + }, + { + "type": "string", + "enum": [ + "lu" + ], + "title": "Luxembourg" + }, + { + "type": "string", + "enum": [ + "lv" + ], + "title": "Latvia" + }, + { + "type": "string", + "enum": [ + "ma" + ], + "title": "Morocco" + }, + { + "type": "string", + "enum": [ + "mc" + ], + "title": "Monaco" + }, + { + "type": "string", + "enum": [ + "md" + ], + "title": "Moldova" + }, + { + "type": "string", + "enum": [ + "mg" + ], + "title": "Madagascar" + }, + { + "type": "string", + "enum": [ + "mv" + ], + "title": "Maldives" + }, + { + "type": "string", + "enum": [ + "mx" + ], + "title": "Mexico" + }, + { + "type": "string", + "enum": [ + "mh" + ], + "title": "Marshall Islands" + }, + { + "type": "string", + "enum": [ + "mk" + ], + "title": "North Macedonia" + }, + { + "type": "string", + "enum": [ + "ml" + ], + "title": "Mali" + }, + { + "type": "string", + "enum": [ + "mt" + ], + "title": "Malta" + }, + { + "type": "string", + "enum": [ + "mm" + ], + "title": "Myanmar" + }, + { + "type": "string", + "enum": [ + "me" + ], + "title": "Montenegro" + }, + { + "type": "string", + "enum": [ + "mn" + ], + "title": "Mongolia" + }, + { + "type": "string", + "enum": [ + "mz" + ], + "title": "Mozambique" + }, + { + "type": "string", + "enum": [ + "mr" + ], + "title": "Mauritania" + }, + { + "type": "string", + "enum": [ + "mu" + ], + "title": "Mauritius" + }, + { + "type": "string", + "enum": [ + "mw" + ], + "title": "Malawi" + }, + { + "type": "string", + "enum": [ + "my" + ], + "title": "Malaysia" + }, + { + "type": "string", + "enum": [ + "na" + ], + "title": "Namibia" + }, + { + "type": "string", + "enum": [ + "ne" + ], + "title": "Niger" + }, + { + "type": "string", + "enum": [ + "ng" + ], + "title": "Nigeria" + }, + { + "type": "string", + "enum": [ + "ni" + ], + "title": "Nicaragua" + }, + { + "type": "string", + "enum": [ + "nl" + ], + "title": "Netherlands" + }, + { + "type": "string", + "enum": [ + "no" + ], + "title": "Norway" + }, + { + "type": "string", + "enum": [ + "np" + ], + "title": "Nepal" + }, + { + "type": "string", + "enum": [ + "nr" + ], + "title": "Nauru" + }, + { + "type": "string", + "enum": [ + "nz" + ], + "title": "New Zealand" + }, + { + "type": "string", + "enum": [ + "om" + ], + "title": "Oman" + }, + { + "type": "string", + "enum": [ + "pk" + ], + "title": "Pakistan" + }, + { + "type": "string", + "enum": [ + "pa" + ], + "title": "Panama" + }, + { + "type": "string", + "enum": [ + "pe" + ], + "title": "Peru" + }, + { + "type": "string", + "enum": [ + "ph" + ], + "title": "Philippines" + }, + { + "type": "string", + "enum": [ + "pw" + ], + "title": "Palau" + }, + { + "type": "string", + "enum": [ + "pg" + ], + "title": "Papua New Guinea" + }, + { + "type": "string", + "enum": [ + "pl" + ], + "title": "Poland" + }, + { + "type": "string", + "enum": [ + "pf" + ], + "title": "French Polynesia" + }, + { + "type": "string", + "enum": [ + "kp" + ], + "title": "North Korea" + }, + { + "type": "string", + "enum": [ + "pt" + ], + "title": "Portugal" + }, + { + "type": "string", + "enum": [ + "py" + ], + "title": "Paraguay" + }, + { + "type": "string", + "enum": [ + "qa" + ], + "title": "Qatar" + }, + { + "type": "string", + "enum": [ + "ro" + ], + "title": "Romania" + }, + { + "type": "string", + "enum": [ + "ru" + ], + "title": "Russia" + }, + { + "type": "string", + "enum": [ + "rw" + ], + "title": "Rwanda" + }, + { + "type": "string", + "enum": [ + "sa" + ], + "title": "Saudi Arabia" + }, + { + "type": "string", + "enum": [ + "sd" + ], + "title": "Sudan" + }, + { + "type": "string", + "enum": [ + "sn" + ], + "title": "Senegal" + }, + { + "type": "string", + "enum": [ + "sg" + ], + "title": "Singapore" + }, + { + "type": "string", + "enum": [ + "sb" + ], + "title": "Solomon Islands" + }, + { + "type": "string", + "enum": [ + "sl" + ], + "title": "Sierra Leone" + }, + { + "type": "string", + "enum": [ + "sv" + ], + "title": "El Salvador" + }, + { + "type": "string", + "enum": [ + "sm" + ], + "title": "San Marino" + }, + { + "type": "string", + "enum": [ + "so" + ], + "title": "Somalia" + }, + { + "type": "string", + "enum": [ + "rs" + ], + "title": "Serbia" + }, + { + "type": "string", + "enum": [ + "ss" + ], + "title": "South Sudan" + }, + { + "type": "string", + "enum": [ + "st" + ], + "title": "Sao Tome and Principe" + }, + { + "type": "string", + "enum": [ + "sr" + ], + "title": "Suriname" + }, + { + "type": "string", + "enum": [ + "sk" + ], + "title": "Slovakia" + }, + { + "type": "string", + "enum": [ + "si" + ], + "title": "Slovenia" + }, + { + "type": "string", + "enum": [ + "se" + ], + "title": "Sweden" + }, + { + "type": "string", + "enum": [ + "sz" + ], + "title": "Eswatini" + }, + { + "type": "string", + "enum": [ + "sc" + ], + "title": "Seychelles" + }, + { + "type": "string", + "enum": [ + "sy" + ], + "title": "Syria" + }, + { + "type": "string", + "enum": [ + "td" + ], + "title": "Chad" + }, + { + "type": "string", + "enum": [ + "tg" + ], + "title": "Togo" + }, + { + "type": "string", + "enum": [ + "th" + ], + "title": "Thailand" + }, + { + "type": "string", + "enum": [ + "tj" + ], + "title": "Tajikistan" + }, + { + "type": "string", + "enum": [ + "tm" + ], + "title": "Turkmenistan" + }, + { + "type": "string", + "enum": [ + "tl" + ], + "title": "Timor-Leste" + }, + { + "type": "string", + "enum": [ + "to" + ], + "title": "Tonga" + }, + { + "type": "string", + "enum": [ + "tt" + ], + "title": "Trinidad and Tobago" + }, + { + "type": "string", + "enum": [ + "tn" + ], + "title": "Tunisia" + }, + { + "type": "string", + "enum": [ + "tr" + ], + "title": "Turkey" + }, + { + "type": "string", + "enum": [ + "tv" + ], + "title": "Tuvalu" + }, + { + "type": "string", + "enum": [ + "tz" + ], + "title": "Tanzania" + }, + { + "type": "string", + "enum": [ + "ug" + ], + "title": "Uganda" + }, + { + "type": "string", + "enum": [ + "ua" + ], + "title": "Ukraine" + }, + { + "type": "string", + "enum": [ + "uy" + ], + "title": "Uruguay" + }, + { + "type": "string", + "enum": [ + "us" + ], + "title": "United States" + }, + { + "type": "string", + "enum": [ + "uz" + ], + "title": "Uzbekistan" + }, + { + "type": "string", + "enum": [ + "va" + ], + "title": "Vatican City" + }, + { + "type": "string", + "enum": [ + "vc" + ], + "title": "Saint Vincent and the Grenadines" + }, + { + "type": "string", + "enum": [ + "ve" + ], + "title": "Venezuela" + }, + { + "type": "string", + "enum": [ + "vn" + ], + "title": "Vietnam" + }, + { + "type": "string", + "enum": [ + "vu" + ], + "title": "Vanuatu" + }, + { + "type": "string", + "enum": [ + "ws" + ], + "title": "Samoa" + }, + { + "type": "string", + "enum": [ + "ye" + ], + "title": "Yemen" + }, + { + "type": "string", + "enum": [ + "za" + ], + "title": "South Africa" + }, + { + "type": "string", + "enum": [ + "zm" + ], + "title": "Zambia" + }, + { + "type": "string", + "enum": [ + "zw" + ], + "title": "Zimbabwe" + } + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 400 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<NAME>", + "default": "" + }, + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/photo": { + "get": { + "summary": "Get user photo", + "operationId": "avatarsGetPhoto", + "tags": [ + "avatars" + ], + "description": "Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.\n\nPassing `userId` \u2014 `current()` for the authenticated user \u2014 resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and\/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-photo.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "width", + "description": "Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "height", + "description": "Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Output image quality between 0 and 100. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "output", + "description": "Output image format. Defaults to 'png'.", + "required": false, + "schema": { + "type": "string", + "example": "png", + "default": "png" + }, + "in": "query" + }, + { + "name": "rating", + "description": "Maximum image rating to fetch from Gravatar\/Libravatar. Defaults to 'g'.", + "required": false, + "schema": { + "type": "string", + "example": "g", + "default": "g" + }, + "in": "query" + }, + { + "name": "userId", + "description": "User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed.", + "required": false, + "schema": { + "type": "string", + "example": "current()", + "default": "" + }, + "in": "query" + }, + { + "name": "emailHash", + "description": "SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself.", + "required": false, + "schema": { + "type": "string", + "example": "<EMAIL_HASH>", + "default": "" + }, + "in": "query" + }, + { + "name": "name", + "description": "Name to render initials from instead of the user's own name. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<NAME>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "example": "<TEXT>" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/avatars\/screenshots": { + "get": { + "summary": "Get webpage screenshot", + "operationId": "avatarsGetScreenshot", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.\n\nYou can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.\n\nWhen width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-screenshot.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to capture.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "headers", + "description": "HTTP headers to send with the browser request. Defaults to empty.", + "required": false, + "schema": { + "type": "object", + "default": [], + "example": { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + } + }, + "in": "query" + }, + { + "name": "viewportWidth", + "description": "Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1920, + "default": 1280 + }, + "in": "query" + }, + { + "name": "viewportHeight", + "description": "Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 1080, + "default": 720 + }, + "in": "query" + }, + { + "name": "scale", + "description": "Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 2, + "default": 1 + }, + "in": "query" + }, + { + "name": "theme", + "description": "Browser theme. Pass \"light\" or \"dark\". Defaults to \"light\".", + "required": false, + "schema": { + "type": "string", + "example": "dark", + "title": "BrowserTheme", + "oneOf": [ + { + "type": "string", + "enum": [ + "light" + ], + "title": "light" + }, + { + "type": "string", + "enum": [ + "dark" + ], + "title": "dark" + } + ], + "default": "light" + }, + "in": "query" + }, + { + "name": "userAgent", + "description": "Custom user agent string. Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "Mozilla\/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit\/605.1.15", + "default": "" + }, + "in": "query" + }, + { + "name": "fullpage", + "description": "Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": true, + "default": false + }, + "in": "query" + }, + { + "name": "locale", + "description": "Browser locale (e.g., \"en-US\", \"fr-FR\"). Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "en-US", + "default": "" + }, + "in": "query" + }, + { + "name": "timezone", + "description": "IANA timezone identifier (e.g., \"America\/New_York\", \"Europe\/London\"). Defaults to browser default.", + "required": false, + "schema": { + "type": "string", + "example": "America\/New_York", + "title": "Timezone", + "oneOf": [ + { + "type": "string", + "enum": [ + "africa\/abidjan" + ], + "title": "africa\/abidjan" + }, + { + "type": "string", + "enum": [ + "africa\/accra" + ], + "title": "africa\/accra" + }, + { + "type": "string", + "enum": [ + "africa\/addis_ababa" + ], + "title": "africa\/addis_ababa" + }, + { + "type": "string", + "enum": [ + "africa\/algiers" + ], + "title": "africa\/algiers" + }, + { + "type": "string", + "enum": [ + "africa\/asmara" + ], + "title": "africa\/asmara" + }, + { + "type": "string", + "enum": [ + "africa\/bamako" + ], + "title": "africa\/bamako" + }, + { + "type": "string", + "enum": [ + "africa\/bangui" + ], + "title": "africa\/bangui" + }, + { + "type": "string", + "enum": [ + "africa\/banjul" + ], + "title": "africa\/banjul" + }, + { + "type": "string", + "enum": [ + "africa\/bissau" + ], + "title": "africa\/bissau" + }, + { + "type": "string", + "enum": [ + "africa\/blantyre" + ], + "title": "africa\/blantyre" + }, + { + "type": "string", + "enum": [ + "africa\/brazzaville" + ], + "title": "africa\/brazzaville" + }, + { + "type": "string", + "enum": [ + "africa\/bujumbura" + ], + "title": "africa\/bujumbura" + }, + { + "type": "string", + "enum": [ + "africa\/cairo" + ], + "title": "africa\/cairo" + }, + { + "type": "string", + "enum": [ + "africa\/casablanca" + ], + "title": "africa\/casablanca" + }, + { + "type": "string", + "enum": [ + "africa\/ceuta" + ], + "title": "africa\/ceuta" + }, + { + "type": "string", + "enum": [ + "africa\/conakry" + ], + "title": "africa\/conakry" + }, + { + "type": "string", + "enum": [ + "africa\/dakar" + ], + "title": "africa\/dakar" + }, + { + "type": "string", + "enum": [ + "africa\/dar_es_salaam" + ], + "title": "africa\/dar_es_salaam" + }, + { + "type": "string", + "enum": [ + "africa\/djibouti" + ], + "title": "africa\/djibouti" + }, + { + "type": "string", + "enum": [ + "africa\/douala" + ], + "title": "africa\/douala" + }, + { + "type": "string", + "enum": [ + "africa\/el_aaiun" + ], + "title": "africa\/el_aaiun" + }, + { + "type": "string", + "enum": [ + "africa\/freetown" + ], + "title": "africa\/freetown" + }, + { + "type": "string", + "enum": [ + "africa\/gaborone" + ], + "title": "africa\/gaborone" + }, + { + "type": "string", + "enum": [ + "africa\/harare" + ], + "title": "africa\/harare" + }, + { + "type": "string", + "enum": [ + "africa\/johannesburg" + ], + "title": "africa\/johannesburg" + }, + { + "type": "string", + "enum": [ + "africa\/juba" + ], + "title": "africa\/juba" + }, + { + "type": "string", + "enum": [ + "africa\/kampala" + ], + "title": "africa\/kampala" + }, + { + "type": "string", + "enum": [ + "africa\/khartoum" + ], + "title": "africa\/khartoum" + }, + { + "type": "string", + "enum": [ + "africa\/kigali" + ], + "title": "africa\/kigali" + }, + { + "type": "string", + "enum": [ + "africa\/kinshasa" + ], + "title": "africa\/kinshasa" + }, + { + "type": "string", + "enum": [ + "africa\/lagos" + ], + "title": "africa\/lagos" + }, + { + "type": "string", + "enum": [ + "africa\/libreville" + ], + "title": "africa\/libreville" + }, + { + "type": "string", + "enum": [ + "africa\/lome" + ], + "title": "africa\/lome" + }, + { + "type": "string", + "enum": [ + "africa\/luanda" + ], + "title": "africa\/luanda" + }, + { + "type": "string", + "enum": [ + "africa\/lubumbashi" + ], + "title": "africa\/lubumbashi" + }, + { + "type": "string", + "enum": [ + "africa\/lusaka" + ], + "title": "africa\/lusaka" + }, + { + "type": "string", + "enum": [ + "africa\/malabo" + ], + "title": "africa\/malabo" + }, + { + "type": "string", + "enum": [ + "africa\/maputo" + ], + "title": "africa\/maputo" + }, + { + "type": "string", + "enum": [ + "africa\/maseru" + ], + "title": "africa\/maseru" + }, + { + "type": "string", + "enum": [ + "africa\/mbabane" + ], + "title": "africa\/mbabane" + }, + { + "type": "string", + "enum": [ + "africa\/mogadishu" + ], + "title": "africa\/mogadishu" + }, + { + "type": "string", + "enum": [ + "africa\/monrovia" + ], + "title": "africa\/monrovia" + }, + { + "type": "string", + "enum": [ + "africa\/nairobi" + ], + "title": "africa\/nairobi" + }, + { + "type": "string", + "enum": [ + "africa\/ndjamena" + ], + "title": "africa\/ndjamena" + }, + { + "type": "string", + "enum": [ + "africa\/niamey" + ], + "title": "africa\/niamey" + }, + { + "type": "string", + "enum": [ + "africa\/nouakchott" + ], + "title": "africa\/nouakchott" + }, + { + "type": "string", + "enum": [ + "africa\/ouagadougou" + ], + "title": "africa\/ouagadougou" + }, + { + "type": "string", + "enum": [ + "africa\/porto-novo" + ], + "title": "africa\/porto-novo" + }, + { + "type": "string", + "enum": [ + "africa\/sao_tome" + ], + "title": "africa\/sao_tome" + }, + { + "type": "string", + "enum": [ + "africa\/tripoli" + ], + "title": "africa\/tripoli" + }, + { + "type": "string", + "enum": [ + "africa\/tunis" + ], + "title": "africa\/tunis" + }, + { + "type": "string", + "enum": [ + "africa\/windhoek" + ], + "title": "africa\/windhoek" + }, + { + "type": "string", + "enum": [ + "america\/adak" + ], + "title": "america\/adak" + }, + { + "type": "string", + "enum": [ + "america\/anchorage" + ], + "title": "america\/anchorage" + }, + { + "type": "string", + "enum": [ + "america\/anguilla" + ], + "title": "america\/anguilla" + }, + { + "type": "string", + "enum": [ + "america\/antigua" + ], + "title": "america\/antigua" + }, + { + "type": "string", + "enum": [ + "america\/araguaina" + ], + "title": "america\/araguaina" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/buenos_aires" + ], + "title": "america\/argentina\/buenos_aires" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/catamarca" + ], + "title": "america\/argentina\/catamarca" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/cordoba" + ], + "title": "america\/argentina\/cordoba" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/jujuy" + ], + "title": "america\/argentina\/jujuy" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/la_rioja" + ], + "title": "america\/argentina\/la_rioja" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/mendoza" + ], + "title": "america\/argentina\/mendoza" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/rio_gallegos" + ], + "title": "america\/argentina\/rio_gallegos" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/salta" + ], + "title": "america\/argentina\/salta" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/san_juan" + ], + "title": "america\/argentina\/san_juan" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/san_luis" + ], + "title": "america\/argentina\/san_luis" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/tucuman" + ], + "title": "america\/argentina\/tucuman" + }, + { + "type": "string", + "enum": [ + "america\/argentina\/ushuaia" + ], + "title": "america\/argentina\/ushuaia" + }, + { + "type": "string", + "enum": [ + "america\/aruba" + ], + "title": "america\/aruba" + }, + { + "type": "string", + "enum": [ + "america\/asuncion" + ], + "title": "america\/asuncion" + }, + { + "type": "string", + "enum": [ + "america\/atikokan" + ], + "title": "america\/atikokan" + }, + { + "type": "string", + "enum": [ + "america\/bahia" + ], + "title": "america\/bahia" + }, + { + "type": "string", + "enum": [ + "america\/bahia_banderas" + ], + "title": "america\/bahia_banderas" + }, + { + "type": "string", + "enum": [ + "america\/barbados" + ], + "title": "america\/barbados" + }, + { + "type": "string", + "enum": [ + "america\/belem" + ], + "title": "america\/belem" + }, + { + "type": "string", + "enum": [ + "america\/belize" + ], + "title": "america\/belize" + }, + { + "type": "string", + "enum": [ + "america\/blanc-sablon" + ], + "title": "america\/blanc-sablon" + }, + { + "type": "string", + "enum": [ + "america\/boa_vista" + ], + "title": "america\/boa_vista" + }, + { + "type": "string", + "enum": [ + "america\/bogota" + ], + "title": "america\/bogota" + }, + { + "type": "string", + "enum": [ + "america\/boise" + ], + "title": "america\/boise" + }, + { + "type": "string", + "enum": [ + "america\/cambridge_bay" + ], + "title": "america\/cambridge_bay" + }, + { + "type": "string", + "enum": [ + "america\/campo_grande" + ], + "title": "america\/campo_grande" + }, + { + "type": "string", + "enum": [ + "america\/cancun" + ], + "title": "america\/cancun" + }, + { + "type": "string", + "enum": [ + "america\/caracas" + ], + "title": "america\/caracas" + }, + { + "type": "string", + "enum": [ + "america\/cayenne" + ], + "title": "america\/cayenne" + }, + { + "type": "string", + "enum": [ + "america\/cayman" + ], + "title": "america\/cayman" + }, + { + "type": "string", + "enum": [ + "america\/chicago" + ], + "title": "america\/chicago" + }, + { + "type": "string", + "enum": [ + "america\/chihuahua" + ], + "title": "america\/chihuahua" + }, + { + "type": "string", + "enum": [ + "america\/ciudad_juarez" + ], + "title": "america\/ciudad_juarez" + }, + { + "type": "string", + "enum": [ + "america\/costa_rica" + ], + "title": "america\/costa_rica" + }, + { + "type": "string", + "enum": [ + "america\/coyhaique" + ], + "title": "america\/coyhaique" + }, + { + "type": "string", + "enum": [ + "america\/creston" + ], + "title": "america\/creston" + }, + { + "type": "string", + "enum": [ + "america\/cuiaba" + ], + "title": "america\/cuiaba" + }, + { + "type": "string", + "enum": [ + "america\/curacao" + ], + "title": "america\/curacao" + }, + { + "type": "string", + "enum": [ + "america\/danmarkshavn" + ], + "title": "america\/danmarkshavn" + }, + { + "type": "string", + "enum": [ + "america\/dawson" + ], + "title": "america\/dawson" + }, + { + "type": "string", + "enum": [ + "america\/dawson_creek" + ], + "title": "america\/dawson_creek" + }, + { + "type": "string", + "enum": [ + "america\/denver" + ], + "title": "america\/denver" + }, + { + "type": "string", + "enum": [ + "america\/detroit" + ], + "title": "america\/detroit" + }, + { + "type": "string", + "enum": [ + "america\/dominica" + ], + "title": "america\/dominica" + }, + { + "type": "string", + "enum": [ + "america\/edmonton" + ], + "title": "america\/edmonton" + }, + { + "type": "string", + "enum": [ + "america\/eirunepe" + ], + "title": "america\/eirunepe" + }, + { + "type": "string", + "enum": [ + "america\/el_salvador" + ], + "title": "america\/el_salvador" + }, + { + "type": "string", + "enum": [ + "america\/fort_nelson" + ], + "title": "america\/fort_nelson" + }, + { + "type": "string", + "enum": [ + "america\/fortaleza" + ], + "title": "america\/fortaleza" + }, + { + "type": "string", + "enum": [ + "america\/glace_bay" + ], + "title": "america\/glace_bay" + }, + { + "type": "string", + "enum": [ + "america\/goose_bay" + ], + "title": "america\/goose_bay" + }, + { + "type": "string", + "enum": [ + "america\/grand_turk" + ], + "title": "america\/grand_turk" + }, + { + "type": "string", + "enum": [ + "america\/grenada" + ], + "title": "america\/grenada" + }, + { + "type": "string", + "enum": [ + "america\/guadeloupe" + ], + "title": "america\/guadeloupe" + }, + { + "type": "string", + "enum": [ + "america\/guatemala" + ], + "title": "america\/guatemala" + }, + { + "type": "string", + "enum": [ + "america\/guayaquil" + ], + "title": "america\/guayaquil" + }, + { + "type": "string", + "enum": [ + "america\/guyana" + ], + "title": "america\/guyana" + }, + { + "type": "string", + "enum": [ + "america\/halifax" + ], + "title": "america\/halifax" + }, + { + "type": "string", + "enum": [ + "america\/havana" + ], + "title": "america\/havana" + }, + { + "type": "string", + "enum": [ + "america\/hermosillo" + ], + "title": "america\/hermosillo" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/indianapolis" + ], + "title": "america\/indiana\/indianapolis" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/knox" + ], + "title": "america\/indiana\/knox" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/marengo" + ], + "title": "america\/indiana\/marengo" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/petersburg" + ], + "title": "america\/indiana\/petersburg" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/tell_city" + ], + "title": "america\/indiana\/tell_city" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/vevay" + ], + "title": "america\/indiana\/vevay" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/vincennes" + ], + "title": "america\/indiana\/vincennes" + }, + { + "type": "string", + "enum": [ + "america\/indiana\/winamac" + ], + "title": "america\/indiana\/winamac" + }, + { + "type": "string", + "enum": [ + "america\/inuvik" + ], + "title": "america\/inuvik" + }, + { + "type": "string", + "enum": [ + "america\/iqaluit" + ], + "title": "america\/iqaluit" + }, + { + "type": "string", + "enum": [ + "america\/jamaica" + ], + "title": "america\/jamaica" + }, + { + "type": "string", + "enum": [ + "america\/juneau" + ], + "title": "america\/juneau" + }, + { + "type": "string", + "enum": [ + "america\/kentucky\/louisville" + ], + "title": "america\/kentucky\/louisville" + }, + { + "type": "string", + "enum": [ + "america\/kentucky\/monticello" + ], + "title": "america\/kentucky\/monticello" + }, + { + "type": "string", + "enum": [ + "america\/kralendijk" + ], + "title": "america\/kralendijk" + }, + { + "type": "string", + "enum": [ + "america\/la_paz" + ], + "title": "america\/la_paz" + }, + { + "type": "string", + "enum": [ + "america\/lima" + ], + "title": "america\/lima" + }, + { + "type": "string", + "enum": [ + "america\/los_angeles" + ], + "title": "america\/los_angeles" + }, + { + "type": "string", + "enum": [ + "america\/lower_princes" + ], + "title": "america\/lower_princes" + }, + { + "type": "string", + "enum": [ + "america\/maceio" + ], + "title": "america\/maceio" + }, + { + "type": "string", + "enum": [ + "america\/managua" + ], + "title": "america\/managua" + }, + { + "type": "string", + "enum": [ + "america\/manaus" + ], + "title": "america\/manaus" + }, + { + "type": "string", + "enum": [ + "america\/marigot" + ], + "title": "america\/marigot" + }, + { + "type": "string", + "enum": [ + "america\/martinique" + ], + "title": "america\/martinique" + }, + { + "type": "string", + "enum": [ + "america\/matamoros" + ], + "title": "america\/matamoros" + }, + { + "type": "string", + "enum": [ + "america\/mazatlan" + ], + "title": "america\/mazatlan" + }, + { + "type": "string", + "enum": [ + "america\/menominee" + ], + "title": "america\/menominee" + }, + { + "type": "string", + "enum": [ + "america\/merida" + ], + "title": "america\/merida" + }, + { + "type": "string", + "enum": [ + "america\/metlakatla" + ], + "title": "america\/metlakatla" + }, + { + "type": "string", + "enum": [ + "america\/mexico_city" + ], + "title": "america\/mexico_city" + }, + { + "type": "string", + "enum": [ + "america\/miquelon" + ], + "title": "america\/miquelon" + }, + { + "type": "string", + "enum": [ + "america\/moncton" + ], + "title": "america\/moncton" + }, + { + "type": "string", + "enum": [ + "america\/monterrey" + ], + "title": "america\/monterrey" + }, + { + "type": "string", + "enum": [ + "america\/montevideo" + ], + "title": "america\/montevideo" + }, + { + "type": "string", + "enum": [ + "america\/montserrat" + ], + "title": "america\/montserrat" + }, + { + "type": "string", + "enum": [ + "america\/nassau" + ], + "title": "america\/nassau" + }, + { + "type": "string", + "enum": [ + "america\/new_york" + ], + "title": "america\/new_york" + }, + { + "type": "string", + "enum": [ + "america\/nome" + ], + "title": "america\/nome" + }, + { + "type": "string", + "enum": [ + "america\/noronha" + ], + "title": "america\/noronha" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/beulah" + ], + "title": "america\/north_dakota\/beulah" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/center" + ], + "title": "america\/north_dakota\/center" + }, + { + "type": "string", + "enum": [ + "america\/north_dakota\/new_salem" + ], + "title": "america\/north_dakota\/new_salem" + }, + { + "type": "string", + "enum": [ + "america\/nuuk" + ], + "title": "america\/nuuk" + }, + { + "type": "string", + "enum": [ + "america\/ojinaga" + ], + "title": "america\/ojinaga" + }, + { + "type": "string", + "enum": [ + "america\/panama" + ], + "title": "america\/panama" + }, + { + "type": "string", + "enum": [ + "america\/paramaribo" + ], + "title": "america\/paramaribo" + }, + { + "type": "string", + "enum": [ + "america\/phoenix" + ], + "title": "america\/phoenix" + }, + { + "type": "string", + "enum": [ + "america\/port-au-prince" + ], + "title": "america\/port-au-prince" + }, + { + "type": "string", + "enum": [ + "america\/port_of_spain" + ], + "title": "america\/port_of_spain" + }, + { + "type": "string", + "enum": [ + "america\/porto_velho" + ], + "title": "america\/porto_velho" + }, + { + "type": "string", + "enum": [ + "america\/puerto_rico" + ], + "title": "america\/puerto_rico" + }, + { + "type": "string", + "enum": [ + "america\/punta_arenas" + ], + "title": "america\/punta_arenas" + }, + { + "type": "string", + "enum": [ + "america\/rankin_inlet" + ], + "title": "america\/rankin_inlet" + }, + { + "type": "string", + "enum": [ + "america\/recife" + ], + "title": "america\/recife" + }, + { + "type": "string", + "enum": [ + "america\/regina" + ], + "title": "america\/regina" + }, + { + "type": "string", + "enum": [ + "america\/resolute" + ], + "title": "america\/resolute" + }, + { + "type": "string", + "enum": [ + "america\/rio_branco" + ], + "title": "america\/rio_branco" + }, + { + "type": "string", + "enum": [ + "america\/santarem" + ], + "title": "america\/santarem" + }, + { + "type": "string", + "enum": [ + "america\/santiago" + ], + "title": "america\/santiago" + }, + { + "type": "string", + "enum": [ + "america\/santo_domingo" + ], + "title": "america\/santo_domingo" + }, + { + "type": "string", + "enum": [ + "america\/sao_paulo" + ], + "title": "america\/sao_paulo" + }, + { + "type": "string", + "enum": [ + "america\/scoresbysund" + ], + "title": "america\/scoresbysund" + }, + { + "type": "string", + "enum": [ + "america\/sitka" + ], + "title": "america\/sitka" + }, + { + "type": "string", + "enum": [ + "america\/st_barthelemy" + ], + "title": "america\/st_barthelemy" + }, + { + "type": "string", + "enum": [ + "america\/st_johns" + ], + "title": "america\/st_johns" + }, + { + "type": "string", + "enum": [ + "america\/st_kitts" + ], + "title": "america\/st_kitts" + }, + { + "type": "string", + "enum": [ + "america\/st_lucia" + ], + "title": "america\/st_lucia" + }, + { + "type": "string", + "enum": [ + "america\/st_thomas" + ], + "title": "america\/st_thomas" + }, + { + "type": "string", + "enum": [ + "america\/st_vincent" + ], + "title": "america\/st_vincent" + }, + { + "type": "string", + "enum": [ + "america\/swift_current" + ], + "title": "america\/swift_current" + }, + { + "type": "string", + "enum": [ + "america\/tegucigalpa" + ], + "title": "america\/tegucigalpa" + }, + { + "type": "string", + "enum": [ + "america\/thule" + ], + "title": "america\/thule" + }, + { + "type": "string", + "enum": [ + "america\/tijuana" + ], + "title": "america\/tijuana" + }, + { + "type": "string", + "enum": [ + "america\/toronto" + ], + "title": "america\/toronto" + }, + { + "type": "string", + "enum": [ + "america\/tortola" + ], + "title": "america\/tortola" + }, + { + "type": "string", + "enum": [ + "america\/vancouver" + ], + "title": "america\/vancouver" + }, + { + "type": "string", + "enum": [ + "america\/whitehorse" + ], + "title": "america\/whitehorse" + }, + { + "type": "string", + "enum": [ + "america\/winnipeg" + ], + "title": "america\/winnipeg" + }, + { + "type": "string", + "enum": [ + "america\/yakutat" + ], + "title": "america\/yakutat" + }, + { + "type": "string", + "enum": [ + "antarctica\/casey" + ], + "title": "antarctica\/casey" + }, + { + "type": "string", + "enum": [ + "antarctica\/davis" + ], + "title": "antarctica\/davis" + }, + { + "type": "string", + "enum": [ + "antarctica\/dumontdurville" + ], + "title": "antarctica\/dumontdurville" + }, + { + "type": "string", + "enum": [ + "antarctica\/macquarie" + ], + "title": "antarctica\/macquarie" + }, + { + "type": "string", + "enum": [ + "antarctica\/mawson" + ], + "title": "antarctica\/mawson" + }, + { + "type": "string", + "enum": [ + "antarctica\/mcmurdo" + ], + "title": "antarctica\/mcmurdo" + }, + { + "type": "string", + "enum": [ + "antarctica\/palmer" + ], + "title": "antarctica\/palmer" + }, + { + "type": "string", + "enum": [ + "antarctica\/rothera" + ], + "title": "antarctica\/rothera" + }, + { + "type": "string", + "enum": [ + "antarctica\/syowa" + ], + "title": "antarctica\/syowa" + }, + { + "type": "string", + "enum": [ + "antarctica\/troll" + ], + "title": "antarctica\/troll" + }, + { + "type": "string", + "enum": [ + "antarctica\/vostok" + ], + "title": "antarctica\/vostok" + }, + { + "type": "string", + "enum": [ + "arctic\/longyearbyen" + ], + "title": "arctic\/longyearbyen" + }, + { + "type": "string", + "enum": [ + "asia\/aden" + ], + "title": "asia\/aden" + }, + { + "type": "string", + "enum": [ + "asia\/almaty" + ], + "title": "asia\/almaty" + }, + { + "type": "string", + "enum": [ + "asia\/amman" + ], + "title": "asia\/amman" + }, + { + "type": "string", + "enum": [ + "asia\/anadyr" + ], + "title": "asia\/anadyr" + }, + { + "type": "string", + "enum": [ + "asia\/aqtau" + ], + "title": "asia\/aqtau" + }, + { + "type": "string", + "enum": [ + "asia\/aqtobe" + ], + "title": "asia\/aqtobe" + }, + { + "type": "string", + "enum": [ + "asia\/ashgabat" + ], + "title": "asia\/ashgabat" + }, + { + "type": "string", + "enum": [ + "asia\/atyrau" + ], + "title": "asia\/atyrau" + }, + { + "type": "string", + "enum": [ + "asia\/baghdad" + ], + "title": "asia\/baghdad" + }, + { + "type": "string", + "enum": [ + "asia\/bahrain" + ], + "title": "asia\/bahrain" + }, + { + "type": "string", + "enum": [ + "asia\/baku" + ], + "title": "asia\/baku" + }, + { + "type": "string", + "enum": [ + "asia\/bangkok" + ], + "title": "asia\/bangkok" + }, + { + "type": "string", + "enum": [ + "asia\/barnaul" + ], + "title": "asia\/barnaul" + }, + { + "type": "string", + "enum": [ + "asia\/beirut" + ], + "title": "asia\/beirut" + }, + { + "type": "string", + "enum": [ + "asia\/bishkek" + ], + "title": "asia\/bishkek" + }, + { + "type": "string", + "enum": [ + "asia\/brunei" + ], + "title": "asia\/brunei" + }, + { + "type": "string", + "enum": [ + "asia\/chita" + ], + "title": "asia\/chita" + }, + { + "type": "string", + "enum": [ + "asia\/colombo" + ], + "title": "asia\/colombo" + }, + { + "type": "string", + "enum": [ + "asia\/damascus" + ], + "title": "asia\/damascus" + }, + { + "type": "string", + "enum": [ + "asia\/dhaka" + ], + "title": "asia\/dhaka" + }, + { + "type": "string", + "enum": [ + "asia\/dili" + ], + "title": "asia\/dili" + }, + { + "type": "string", + "enum": [ + "asia\/dubai" + ], + "title": "asia\/dubai" + }, + { + "type": "string", + "enum": [ + "asia\/dushanbe" + ], + "title": "asia\/dushanbe" + }, + { + "type": "string", + "enum": [ + "asia\/famagusta" + ], + "title": "asia\/famagusta" + }, + { + "type": "string", + "enum": [ + "asia\/gaza" + ], + "title": "asia\/gaza" + }, + { + "type": "string", + "enum": [ + "asia\/hebron" + ], + "title": "asia\/hebron" + }, + { + "type": "string", + "enum": [ + "asia\/ho_chi_minh" + ], + "title": "asia\/ho_chi_minh" + }, + { + "type": "string", + "enum": [ + "asia\/hong_kong" + ], + "title": "asia\/hong_kong" + }, + { + "type": "string", + "enum": [ + "asia\/hovd" + ], + "title": "asia\/hovd" + }, + { + "type": "string", + "enum": [ + "asia\/irkutsk" + ], + "title": "asia\/irkutsk" + }, + { + "type": "string", + "enum": [ + "asia\/jakarta" + ], + "title": "asia\/jakarta" + }, + { + "type": "string", + "enum": [ + "asia\/jayapura" + ], + "title": "asia\/jayapura" + }, + { + "type": "string", + "enum": [ + "asia\/jerusalem" + ], + "title": "asia\/jerusalem" + }, + { + "type": "string", + "enum": [ + "asia\/kabul" + ], + "title": "asia\/kabul" + }, + { + "type": "string", + "enum": [ + "asia\/kamchatka" + ], + "title": "asia\/kamchatka" + }, + { + "type": "string", + "enum": [ + "asia\/karachi" + ], + "title": "asia\/karachi" + }, + { + "type": "string", + "enum": [ + "asia\/kathmandu" + ], + "title": "asia\/kathmandu" + }, + { + "type": "string", + "enum": [ + "asia\/khandyga" + ], + "title": "asia\/khandyga" + }, + { + "type": "string", + "enum": [ + "asia\/kolkata" + ], + "title": "asia\/kolkata" + }, + { + "type": "string", + "enum": [ + "asia\/krasnoyarsk" + ], + "title": "asia\/krasnoyarsk" + }, + { + "type": "string", + "enum": [ + "asia\/kuala_lumpur" + ], + "title": "asia\/kuala_lumpur" + }, + { + "type": "string", + "enum": [ + "asia\/kuching" + ], + "title": "asia\/kuching" + }, + { + "type": "string", + "enum": [ + "asia\/kuwait" + ], + "title": "asia\/kuwait" + }, + { + "type": "string", + "enum": [ + "asia\/macau" + ], + "title": "asia\/macau" + }, + { + "type": "string", + "enum": [ + "asia\/magadan" + ], + "title": "asia\/magadan" + }, + { + "type": "string", + "enum": [ + "asia\/makassar" + ], + "title": "asia\/makassar" + }, + { + "type": "string", + "enum": [ + "asia\/manila" + ], + "title": "asia\/manila" + }, + { + "type": "string", + "enum": [ + "asia\/muscat" + ], + "title": "asia\/muscat" + }, + { + "type": "string", + "enum": [ + "asia\/nicosia" + ], + "title": "asia\/nicosia" + }, + { + "type": "string", + "enum": [ + "asia\/novokuznetsk" + ], + "title": "asia\/novokuznetsk" + }, + { + "type": "string", + "enum": [ + "asia\/novosibirsk" + ], + "title": "asia\/novosibirsk" + }, + { + "type": "string", + "enum": [ + "asia\/omsk" + ], + "title": "asia\/omsk" + }, + { + "type": "string", + "enum": [ + "asia\/oral" + ], + "title": "asia\/oral" + }, + { + "type": "string", + "enum": [ + "asia\/phnom_penh" + ], + "title": "asia\/phnom_penh" + }, + { + "type": "string", + "enum": [ + "asia\/pontianak" + ], + "title": "asia\/pontianak" + }, + { + "type": "string", + "enum": [ + "asia\/pyongyang" + ], + "title": "asia\/pyongyang" + }, + { + "type": "string", + "enum": [ + "asia\/qatar" + ], + "title": "asia\/qatar" + }, + { + "type": "string", + "enum": [ + "asia\/qostanay" + ], + "title": "asia\/qostanay" + }, + { + "type": "string", + "enum": [ + "asia\/qyzylorda" + ], + "title": "asia\/qyzylorda" + }, + { + "type": "string", + "enum": [ + "asia\/riyadh" + ], + "title": "asia\/riyadh" + }, + { + "type": "string", + "enum": [ + "asia\/sakhalin" + ], + "title": "asia\/sakhalin" + }, + { + "type": "string", + "enum": [ + "asia\/samarkand" + ], + "title": "asia\/samarkand" + }, + { + "type": "string", + "enum": [ + "asia\/seoul" + ], + "title": "asia\/seoul" + }, + { + "type": "string", + "enum": [ + "asia\/shanghai" + ], + "title": "asia\/shanghai" + }, + { + "type": "string", + "enum": [ + "asia\/singapore" + ], + "title": "asia\/singapore" + }, + { + "type": "string", + "enum": [ + "asia\/srednekolymsk" + ], + "title": "asia\/srednekolymsk" + }, + { + "type": "string", + "enum": [ + "asia\/taipei" + ], + "title": "asia\/taipei" + }, + { + "type": "string", + "enum": [ + "asia\/tashkent" + ], + "title": "asia\/tashkent" + }, + { + "type": "string", + "enum": [ + "asia\/tbilisi" + ], + "title": "asia\/tbilisi" + }, + { + "type": "string", + "enum": [ + "asia\/tehran" + ], + "title": "asia\/tehran" + }, + { + "type": "string", + "enum": [ + "asia\/thimphu" + ], + "title": "asia\/thimphu" + }, + { + "type": "string", + "enum": [ + "asia\/tokyo" + ], + "title": "asia\/tokyo" + }, + { + "type": "string", + "enum": [ + "asia\/tomsk" + ], + "title": "asia\/tomsk" + }, + { + "type": "string", + "enum": [ + "asia\/ulaanbaatar" + ], + "title": "asia\/ulaanbaatar" + }, + { + "type": "string", + "enum": [ + "asia\/urumqi" + ], + "title": "asia\/urumqi" + }, + { + "type": "string", + "enum": [ + "asia\/ust-nera" + ], + "title": "asia\/ust-nera" + }, + { + "type": "string", + "enum": [ + "asia\/vientiane" + ], + "title": "asia\/vientiane" + }, + { + "type": "string", + "enum": [ + "asia\/vladivostok" + ], + "title": "asia\/vladivostok" + }, + { + "type": "string", + "enum": [ + "asia\/yakutsk" + ], + "title": "asia\/yakutsk" + }, + { + "type": "string", + "enum": [ + "asia\/yangon" + ], + "title": "asia\/yangon" + }, + { + "type": "string", + "enum": [ + "asia\/yekaterinburg" + ], + "title": "asia\/yekaterinburg" + }, + { + "type": "string", + "enum": [ + "asia\/yerevan" + ], + "title": "asia\/yerevan" + }, + { + "type": "string", + "enum": [ + "atlantic\/azores" + ], + "title": "atlantic\/azores" + }, + { + "type": "string", + "enum": [ + "atlantic\/bermuda" + ], + "title": "atlantic\/bermuda" + }, + { + "type": "string", + "enum": [ + "atlantic\/canary" + ], + "title": "atlantic\/canary" + }, + { + "type": "string", + "enum": [ + "atlantic\/cape_verde" + ], + "title": "atlantic\/cape_verde" + }, + { + "type": "string", + "enum": [ + "atlantic\/faroe" + ], + "title": "atlantic\/faroe" + }, + { + "type": "string", + "enum": [ + "atlantic\/madeira" + ], + "title": "atlantic\/madeira" + }, + { + "type": "string", + "enum": [ + "atlantic\/reykjavik" + ], + "title": "atlantic\/reykjavik" + }, + { + "type": "string", + "enum": [ + "atlantic\/south_georgia" + ], + "title": "atlantic\/south_georgia" + }, + { + "type": "string", + "enum": [ + "atlantic\/st_helena" + ], + "title": "atlantic\/st_helena" + }, + { + "type": "string", + "enum": [ + "atlantic\/stanley" + ], + "title": "atlantic\/stanley" + }, + { + "type": "string", + "enum": [ + "australia\/adelaide" + ], + "title": "australia\/adelaide" + }, + { + "type": "string", + "enum": [ + "australia\/brisbane" + ], + "title": "australia\/brisbane" + }, + { + "type": "string", + "enum": [ + "australia\/broken_hill" + ], + "title": "australia\/broken_hill" + }, + { + "type": "string", + "enum": [ + "australia\/darwin" + ], + "title": "australia\/darwin" + }, + { + "type": "string", + "enum": [ + "australia\/eucla" + ], + "title": "australia\/eucla" + }, + { + "type": "string", + "enum": [ + "australia\/hobart" + ], + "title": "australia\/hobart" + }, + { + "type": "string", + "enum": [ + "australia\/lindeman" + ], + "title": "australia\/lindeman" + }, + { + "type": "string", + "enum": [ + "australia\/lord_howe" + ], + "title": "australia\/lord_howe" + }, + { + "type": "string", + "enum": [ + "australia\/melbourne" + ], + "title": "australia\/melbourne" + }, + { + "type": "string", + "enum": [ + "australia\/perth" + ], + "title": "australia\/perth" + }, + { + "type": "string", + "enum": [ + "australia\/sydney" + ], + "title": "australia\/sydney" + }, + { + "type": "string", + "enum": [ + "europe\/amsterdam" + ], + "title": "europe\/amsterdam" + }, + { + "type": "string", + "enum": [ + "europe\/andorra" + ], + "title": "europe\/andorra" + }, + { + "type": "string", + "enum": [ + "europe\/astrakhan" + ], + "title": "europe\/astrakhan" + }, + { + "type": "string", + "enum": [ + "europe\/athens" + ], + "title": "europe\/athens" + }, + { + "type": "string", + "enum": [ + "europe\/belgrade" + ], + "title": "europe\/belgrade" + }, + { + "type": "string", + "enum": [ + "europe\/berlin" + ], + "title": "europe\/berlin" + }, + { + "type": "string", + "enum": [ + "europe\/bratislava" + ], + "title": "europe\/bratislava" + }, + { + "type": "string", + "enum": [ + "europe\/brussels" + ], + "title": "europe\/brussels" + }, + { + "type": "string", + "enum": [ + "europe\/bucharest" + ], + "title": "europe\/bucharest" + }, + { + "type": "string", + "enum": [ + "europe\/budapest" + ], + "title": "europe\/budapest" + }, + { + "type": "string", + "enum": [ + "europe\/busingen" + ], + "title": "europe\/busingen" + }, + { + "type": "string", + "enum": [ + "europe\/chisinau" + ], + "title": "europe\/chisinau" + }, + { + "type": "string", + "enum": [ + "europe\/copenhagen" + ], + "title": "europe\/copenhagen" + }, + { + "type": "string", + "enum": [ + "europe\/dublin" + ], + "title": "europe\/dublin" + }, + { + "type": "string", + "enum": [ + "europe\/gibraltar" + ], + "title": "europe\/gibraltar" + }, + { + "type": "string", + "enum": [ + "europe\/guernsey" + ], + "title": "europe\/guernsey" + }, + { + "type": "string", + "enum": [ + "europe\/helsinki" + ], + "title": "europe\/helsinki" + }, + { + "type": "string", + "enum": [ + "europe\/isle_of_man" + ], + "title": "europe\/isle_of_man" + }, + { + "type": "string", + "enum": [ + "europe\/istanbul" + ], + "title": "europe\/istanbul" + }, + { + "type": "string", + "enum": [ + "europe\/jersey" + ], + "title": "europe\/jersey" + }, + { + "type": "string", + "enum": [ + "europe\/kaliningrad" + ], + "title": "europe\/kaliningrad" + }, + { + "type": "string", + "enum": [ + "europe\/kirov" + ], + "title": "europe\/kirov" + }, + { + "type": "string", + "enum": [ + "europe\/kyiv" + ], + "title": "europe\/kyiv" + }, + { + "type": "string", + "enum": [ + "europe\/lisbon" + ], + "title": "europe\/lisbon" + }, + { + "type": "string", + "enum": [ + "europe\/ljubljana" + ], + "title": "europe\/ljubljana" + }, + { + "type": "string", + "enum": [ + "europe\/london" + ], + "title": "europe\/london" + }, + { + "type": "string", + "enum": [ + "europe\/luxembourg" + ], + "title": "europe\/luxembourg" + }, + { + "type": "string", + "enum": [ + "europe\/madrid" + ], + "title": "europe\/madrid" + }, + { + "type": "string", + "enum": [ + "europe\/malta" + ], + "title": "europe\/malta" + }, + { + "type": "string", + "enum": [ + "europe\/mariehamn" + ], + "title": "europe\/mariehamn" + }, + { + "type": "string", + "enum": [ + "europe\/minsk" + ], + "title": "europe\/minsk" + }, + { + "type": "string", + "enum": [ + "europe\/monaco" + ], + "title": "europe\/monaco" + }, + { + "type": "string", + "enum": [ + "europe\/moscow" + ], + "title": "europe\/moscow" + }, + { + "type": "string", + "enum": [ + "europe\/oslo" + ], + "title": "europe\/oslo" + }, + { + "type": "string", + "enum": [ + "europe\/paris" + ], + "title": "europe\/paris" + }, + { + "type": "string", + "enum": [ + "europe\/podgorica" + ], + "title": "europe\/podgorica" + }, + { + "type": "string", + "enum": [ + "europe\/prague" + ], + "title": "europe\/prague" + }, + { + "type": "string", + "enum": [ + "europe\/riga" + ], + "title": "europe\/riga" + }, + { + "type": "string", + "enum": [ + "europe\/rome" + ], + "title": "europe\/rome" + }, + { + "type": "string", + "enum": [ + "europe\/samara" + ], + "title": "europe\/samara" + }, + { + "type": "string", + "enum": [ + "europe\/san_marino" + ], + "title": "europe\/san_marino" + }, + { + "type": "string", + "enum": [ + "europe\/sarajevo" + ], + "title": "europe\/sarajevo" + }, + { + "type": "string", + "enum": [ + "europe\/saratov" + ], + "title": "europe\/saratov" + }, + { + "type": "string", + "enum": [ + "europe\/simferopol" + ], + "title": "europe\/simferopol" + }, + { + "type": "string", + "enum": [ + "europe\/skopje" + ], + "title": "europe\/skopje" + }, + { + "type": "string", + "enum": [ + "europe\/sofia" + ], + "title": "europe\/sofia" + }, + { + "type": "string", + "enum": [ + "europe\/stockholm" + ], + "title": "europe\/stockholm" + }, + { + "type": "string", + "enum": [ + "europe\/tallinn" + ], + "title": "europe\/tallinn" + }, + { + "type": "string", + "enum": [ + "europe\/tirane" + ], + "title": "europe\/tirane" + }, + { + "type": "string", + "enum": [ + "europe\/ulyanovsk" + ], + "title": "europe\/ulyanovsk" + }, + { + "type": "string", + "enum": [ + "europe\/vaduz" + ], + "title": "europe\/vaduz" + }, + { + "type": "string", + "enum": [ + "europe\/vatican" + ], + "title": "europe\/vatican" + }, + { + "type": "string", + "enum": [ + "europe\/vienna" + ], + "title": "europe\/vienna" + }, + { + "type": "string", + "enum": [ + "europe\/vilnius" + ], + "title": "europe\/vilnius" + }, + { + "type": "string", + "enum": [ + "europe\/volgograd" + ], + "title": "europe\/volgograd" + }, + { + "type": "string", + "enum": [ + "europe\/warsaw" + ], + "title": "europe\/warsaw" + }, + { + "type": "string", + "enum": [ + "europe\/zagreb" + ], + "title": "europe\/zagreb" + }, + { + "type": "string", + "enum": [ + "europe\/zurich" + ], + "title": "europe\/zurich" + }, + { + "type": "string", + "enum": [ + "indian\/antananarivo" + ], + "title": "indian\/antananarivo" + }, + { + "type": "string", + "enum": [ + "indian\/chagos" + ], + "title": "indian\/chagos" + }, + { + "type": "string", + "enum": [ + "indian\/christmas" + ], + "title": "indian\/christmas" + }, + { + "type": "string", + "enum": [ + "indian\/cocos" + ], + "title": "indian\/cocos" + }, + { + "type": "string", + "enum": [ + "indian\/comoro" + ], + "title": "indian\/comoro" + }, + { + "type": "string", + "enum": [ + "indian\/kerguelen" + ], + "title": "indian\/kerguelen" + }, + { + "type": "string", + "enum": [ + "indian\/mahe" + ], + "title": "indian\/mahe" + }, + { + "type": "string", + "enum": [ + "indian\/maldives" + ], + "title": "indian\/maldives" + }, + { + "type": "string", + "enum": [ + "indian\/mauritius" + ], + "title": "indian\/mauritius" + }, + { + "type": "string", + "enum": [ + "indian\/mayotte" + ], + "title": "indian\/mayotte" + }, + { + "type": "string", + "enum": [ + "indian\/reunion" + ], + "title": "indian\/reunion" + }, + { + "type": "string", + "enum": [ + "pacific\/apia" + ], + "title": "pacific\/apia" + }, + { + "type": "string", + "enum": [ + "pacific\/auckland" + ], + "title": "pacific\/auckland" + }, + { + "type": "string", + "enum": [ + "pacific\/bougainville" + ], + "title": "pacific\/bougainville" + }, + { + "type": "string", + "enum": [ + "pacific\/chatham" + ], + "title": "pacific\/chatham" + }, + { + "type": "string", + "enum": [ + "pacific\/chuuk" + ], + "title": "pacific\/chuuk" + }, + { + "type": "string", + "enum": [ + "pacific\/easter" + ], + "title": "pacific\/easter" + }, + { + "type": "string", + "enum": [ + "pacific\/efate" + ], + "title": "pacific\/efate" + }, + { + "type": "string", + "enum": [ + "pacific\/fakaofo" + ], + "title": "pacific\/fakaofo" + }, + { + "type": "string", + "enum": [ + "pacific\/fiji" + ], + "title": "pacific\/fiji" + }, + { + "type": "string", + "enum": [ + "pacific\/funafuti" + ], + "title": "pacific\/funafuti" + }, + { + "type": "string", + "enum": [ + "pacific\/galapagos" + ], + "title": "pacific\/galapagos" + }, + { + "type": "string", + "enum": [ + "pacific\/gambier" + ], + "title": "pacific\/gambier" + }, + { + "type": "string", + "enum": [ + "pacific\/guadalcanal" + ], + "title": "pacific\/guadalcanal" + }, + { + "type": "string", + "enum": [ + "pacific\/guam" + ], + "title": "pacific\/guam" + }, + { + "type": "string", + "enum": [ + "pacific\/honolulu" + ], + "title": "pacific\/honolulu" + }, + { + "type": "string", + "enum": [ + "pacific\/kanton" + ], + "title": "pacific\/kanton" + }, + { + "type": "string", + "enum": [ + "pacific\/kiritimati" + ], + "title": "pacific\/kiritimati" + }, + { + "type": "string", + "enum": [ + "pacific\/kosrae" + ], + "title": "pacific\/kosrae" + }, + { + "type": "string", + "enum": [ + "pacific\/kwajalein" + ], + "title": "pacific\/kwajalein" + }, + { + "type": "string", + "enum": [ + "pacific\/majuro" + ], + "title": "pacific\/majuro" + }, + { + "type": "string", + "enum": [ + "pacific\/marquesas" + ], + "title": "pacific\/marquesas" + }, + { + "type": "string", + "enum": [ + "pacific\/midway" + ], + "title": "pacific\/midway" + }, + { + "type": "string", + "enum": [ + "pacific\/nauru" + ], + "title": "pacific\/nauru" + }, + { + "type": "string", + "enum": [ + "pacific\/niue" + ], + "title": "pacific\/niue" + }, + { + "type": "string", + "enum": [ + "pacific\/norfolk" + ], + "title": "pacific\/norfolk" + }, + { + "type": "string", + "enum": [ + "pacific\/noumea" + ], + "title": "pacific\/noumea" + }, + { + "type": "string", + "enum": [ + "pacific\/pago_pago" + ], + "title": "pacific\/pago_pago" + }, + { + "type": "string", + "enum": [ + "pacific\/palau" + ], + "title": "pacific\/palau" + }, + { + "type": "string", + "enum": [ + "pacific\/pitcairn" + ], + "title": "pacific\/pitcairn" + }, + { + "type": "string", + "enum": [ + "pacific\/pohnpei" + ], + "title": "pacific\/pohnpei" + }, + { + "type": "string", + "enum": [ + "pacific\/port_moresby" + ], + "title": "pacific\/port_moresby" + }, + { + "type": "string", + "enum": [ + "pacific\/rarotonga" + ], + "title": "pacific\/rarotonga" + }, + { + "type": "string", + "enum": [ + "pacific\/saipan" + ], + "title": "pacific\/saipan" + }, + { + "type": "string", + "enum": [ + "pacific\/tahiti" + ], + "title": "pacific\/tahiti" + }, + { + "type": "string", + "enum": [ + "pacific\/tarawa" + ], + "title": "pacific\/tarawa" + }, + { + "type": "string", + "enum": [ + "pacific\/tongatapu" + ], + "title": "pacific\/tongatapu" + }, + { + "type": "string", + "enum": [ + "pacific\/wake" + ], + "title": "pacific\/wake" + }, + { + "type": "string", + "enum": [ + "pacific\/wallis" + ], + "title": "pacific\/wallis" + }, + { + "type": "string", + "enum": [ + "utc" + ], + "title": "utc" + } + ], + "default": "" + }, + "in": "query" + }, + { + "name": "latitude", + "description": "Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 37.7749, + "default": 0 + }, + "in": "query" + }, + { + "name": "longitude", + "description": "Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": -122.4194, + "default": 0 + }, + "in": "query" + }, + { + "name": "accuracy", + "description": "Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 100, + "default": 0 + }, + "in": "query" + }, + { + "name": "touch", + "description": "Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.", + "required": false, + "schema": { + "type": "boolean", + "example": true, + "default": false + }, + "in": "query" + }, + { + "name": "permissions", + "description": "Browser permissions to grant. Pass an array of permission names like [\"geolocation\", \"camera\", \"microphone\"]. Defaults to empty.", + "required": false, + "schema": { + "type": "array", + "items": { + "title": "BrowserPermission", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "geolocation" + ], + "title": "geolocation" + }, + { + "type": "string", + "enum": [ + "camera" + ], + "title": "camera" + }, + { + "type": "string", + "enum": [ + "microphone" + ], + "title": "microphone" + }, + { + "type": "string", + "enum": [ + "notifications" + ], + "title": "notifications" + }, + { + "type": "string", + "enum": [ + "midi" + ], + "title": "midi" + }, + { + "type": "string", + "enum": [ + "push" + ], + "title": "push" + }, + { + "type": "string", + "enum": [ + "clipboard-read" + ], + "title": "clipboard-read" + }, + { + "type": "string", + "enum": [ + "clipboard-write" + ], + "title": "clipboard-write" + }, + { + "type": "string", + "enum": [ + "payment-handler" + ], + "title": "payment-handler" + }, + { + "type": "string", + "enum": [ + "usb" + ], + "title": "usb" + }, + { + "type": "string", + "enum": [ + "bluetooth" + ], + "title": "bluetooth" + }, + { + "type": "string", + "enum": [ + "accelerometer" + ], + "title": "accelerometer" + }, + { + "type": "string", + "enum": [ + "gyroscope" + ], + "title": "gyroscope" + }, + { + "type": "string", + "enum": [ + "magnetometer" + ], + "title": "magnetometer" + }, + { + "type": "string", + "enum": [ + "ambient-light-sensor" + ], + "title": "ambient-light-sensor" + }, + { + "type": "string", + "enum": [ + "background-sync" + ], + "title": "background-sync" + }, + { + "type": "string", + "enum": [ + "persistent-storage" + ], + "title": "persistent-storage" + }, + { + "type": "string", + "enum": [ + "screen-wake-lock" + ], + "title": "screen-wake-lock" + }, + { + "type": "string", + "enum": [ + "web-share" + ], + "title": "web-share" + }, + { + "type": "string", + "enum": [ + "xr-spatial-tracking" + ], + "title": "xr-spatial-tracking" + } + ] + }, + "example": [ + "geolocation", + "notifications" + ], + "default": [] + }, + "in": "query" + }, + { + "name": "sleep", + "description": "Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 3, + "default": 0 + }, + "in": "query" + }, + { + "name": "width", + "description": "Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 800, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 600, + "default": 0 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 85, + "default": -1 + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "example": "jpeg", + "title": "ImageFormat", + "oneOf": [ + { + "type": "string", + "enum": [ + "jpg" + ], + "title": "jpg" + }, + { + "type": "string", + "enum": [ + "jpeg" + ], + "title": "jpeg" + }, + { + "type": "string", + "enum": [ + "png" + ], + "title": "png" + }, + { + "type": "string", + "enum": [ + "webp" + ], + "title": "webp" + }, + { + "type": "string", + "enum": [ + "heic" + ], + "title": "heic" + }, + { + "type": "string", + "enum": [ + "avif" + ], + "title": "avif" + }, + { + "type": "string", + "enum": [ + "gif" + ], + "title": "gif" + } + ], + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "queries", + "search", + "total" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DATABASE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "databasesListTransactions", + "tags": [ + "databases" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTransactions" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "databasesCreateTransaction", + "tags": [ + "databases" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTransaction" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/databases\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "databasesGetTransaction", + "tags": [ + "databases" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTransaction" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "databasesUpdateTransaction", + "tags": [ + "databases" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTransaction" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "databasesDeleteTransaction", + "tags": [ + "databases" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTransaction" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "databasesCreateOperations", + "tags": [ + "databases" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "transactions", + "demo": "databases\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createOperations" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "databases", + "demo": "databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collectionList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collections", + "operationId": "databasesCreateCollection", + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<COLLECTION_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "attributes": { + "description": "Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "indexes": { + "description": "Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC\/DESC, optional), and lengths (array of integers, optional).", + "type": "array", + "default": [], + "items": { + "type": "object" + } + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "purge": { + "description": "When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "collections", + "demo": "databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/bigint": { + "post": { + "summary": "Create bigint attribute", + "operationId": "databasesCreateBigIntAttribute", + "tags": [ + "databases" + ], + "description": "Create a bigint attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeBigInt", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBigint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-big-int-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBigIntColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 1000000, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/bigint\/{key}": { + "patch": { + "summary": "Update bigint attribute", + "operationId": "databasesUpdateBigIntAttribute", + "tags": [ + "databases" + ], + "description": "Update a bigint attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeBigInt", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBigint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-big-int-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBigIntColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 1000000, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "boolean", + "example": false, + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "boolean", + "example": false, + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update datetime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "elements": { + "description": "Array of enum values.", + "type": "array", + "example": [ + "active", + "inactive" + ], + "items": { + "type": "string" + } + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "active", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "description": "Updated list of enum values.", + "type": "array", + "example": [ + "active", + "inactive" + ], + "items": { + "type": "string" + } + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "active", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "max": { + "description": "Maximum value.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when required.", + "type": "number", + "example": 10.5, + "format": "float", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "max": { + "description": "Maximum value.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when required.", + "type": "number", + "example": 10.5, + "format": "float", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 100, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "integer", + "example": 10, + "format": "int64", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 100, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "integer", + "example": 10, + "format": "int64", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "string", + "example": "192.0.2.0", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value. Cannot be set when attribute is required.", + "type": "string", + "example": "192.0.2.0", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "type": "array", + "example": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "type": "array", + "example": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/longtext": { + "post": { + "summary": "Create longtext attribute", + "operationId": "databasesCreateLongtextAttribute", + "tags": [ + "databases" + ], + "description": "Create a longtext attribute.\n", + "responses": { + "202": { + "description": "AttributeLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLongtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-longtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLongtextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/longtext\/{key}": { + "patch": { + "summary": "Update longtext attribute", + "operationId": "databasesUpdateLongtextAttribute", + "tags": [ + "databases" + ], + "description": "Update a longtext attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLongtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-longtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLongtextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/mediumtext": { + "post": { + "summary": "Create mediumtext attribute", + "operationId": "databasesCreateMediumtextAttribute", + "tags": [ + "databases" + ], + "description": "Create a mediumtext attribute.\n", + "responses": { + "202": { + "description": "AttributeMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeMediumtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-mediumtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createMediumtextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/mediumtext\/{key}": { + "patch": { + "summary": "Update mediumtext attribute", + "operationId": "databasesUpdateMediumtextAttribute", + "tags": [ + "databases" + ], + "description": "Update a mediumtext attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeMediumtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-mediumtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateMediumtextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "type": "array", + "example": [ + 1, + 2 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "type": "array", + "example": [ + 1, + 2 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "type": "array", + "example": [ + [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ], + [ + 1, + 2 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "type": "array", + "example": [ + [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ], + [ + 1, + 2 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + }, + "newKey": { + "description": "New attribute key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "description": "Related Collection ID.", + "type": "string", + "example": "<RELATED_COLLECTION_ID>" + }, + "type": { + "description": "Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany.", + "type": "string", + "example": "oneToOne", + "title": "RelationshipType", + "oneOf": [ + { + "type": "string", + "enum": [ + "oneToOne" + ], + "title": "oneToOne" + }, + { + "type": "string", + "enum": [ + "manyToOne" + ], + "title": "manyToOne" + }, + { + "type": "string", + "enum": [ + "manyToMany" + ], + "title": "manyToMany" + }, + { + "type": "string", + "enum": [ + "oneToMany" + ], + "title": "oneToMany" + } + ] + }, + "twoWay": { + "description": "Is Two Way?", + "type": "boolean", + "default": false, + "example": false + }, + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "twoWayKey": { + "description": "Two Way Attribute Key.", + "type": "string", + "example": "<TWO_WAY_KEY>", + "nullable": true + }, + "onDelete": { + "description": "Delete constraint. Possible values are: cascade, restrict, setNull.", + "type": "string", + "default": "restrict", + "example": "cascade", + "title": "RelationMutate", + "oneOf": [ + { + "type": "string", + "enum": [ + "cascade" + ], + "title": "cascade" + }, + { + "type": "string", + "enum": [ + "restrict" + ], + "title": "restrict" + }, + { + "type": "string", + "enum": [ + "setNull" + ], + "title": "setNull" + } + ] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship\/{key}": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "description": "Delete constraint. Possible values are: cascade, restrict, setNull.", + "type": "string", + "example": "cascade", + "title": "RelationMutate", + "oneOf": [ + { + "type": "string", + "enum": [ + "cascade" + ], + "title": "cascade" + }, + { + "type": "string", + "enum": [ + "restrict" + ], + "title": "restrict" + }, + { + "type": "string", + "enum": [ + "setNull" + ], + "title": "setNull" + } + ] + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "size": { + "description": "Attribute size for text attributes, in number of characters.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "size": { + "description": "Maximum size of the string attribute.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/text": { + "post": { + "summary": "Create text attribute", + "operationId": "databasesCreateTextAttribute", + "tags": [ + "databases" + ], + "description": "Create a text attribute.\n", + "responses": { + "202": { + "description": "AttributeText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeText" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-text-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/text\/{key}": { + "patch": { + "summary": "Update text attribute", + "operationId": "databasesUpdateTextAttribute", + "tags": [ + "databases" + ], + "description": "Update a text attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeText" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-text-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/varchar": { + "post": { + "summary": "Create varchar attribute", + "operationId": "databasesCreateVarcharAttribute", + "tags": [ + "databases" + ], + "description": "Create a varchar attribute.\n", + "responses": { + "202": { + "description": "AttributeVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeVarchar" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/create-varchar-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createVarcharColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Attribute Key.", + "type": "string", + "example": "<KEY>" + }, + "size": { + "description": "Attribute size for varchar attributes, in number of characters. Maximum size is 16381.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is attribute an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/varchar\/{key}": { + "patch": { + "summary": "Update varchar attribute", + "operationId": "databasesUpdateVarcharAttribute", + "tags": [ + "databases" + ], + "description": "Update a varchar attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeVarchar" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/update-varchar-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateVarcharColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is attribute required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "size": { + "description": "Maximum size of the varchar attribute.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "newKey": { + "description": "New Attribute Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/attributeBoolean", + "integer": "#\/components\/schemas\/attributeInteger", + "double": "#\/components\/schemas\/attributeFloat", + "string": "#\/components\/schemas\/attributeString", + "datetime": "#\/components\/schemas\/attributeDatetime", + "relationship": "#\/components\/schemas\/attributeRelationship" + }, + "x-mapping": { + "#\/components\/schemas\/attributeBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/attributeInteger": { + "type": "integer" + }, + "#\/components\/schemas\/attributeFloat": { + "type": "double" + }, + "#\/components\/schemas\/attributeEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/attributeEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/attributeUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/attributeIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/attributeDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/attributeRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/attributeString": { + "type": "string" + } + } + } + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "attributes", + "demo": "databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + }, + "put": { + "summary": "Upsert documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "description": "Array of document data as JSON objects. May contain partial documents.", + "type": "array", + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-appwrite": { + "idGenerator": "ID.unique" + }, + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "indexes", + "demo": "databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "indexes", + "demo": "databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Index Key.", + "type": "string", + "example": "<KEY>" + }, + "type": { + "description": "Index type.", + "type": "string", + "example": "key", + "title": "DatabasesIndexType", + "oneOf": [ + { + "type": "string", + "enum": [ + "key" + ], + "title": "key" + }, + { + "type": "string", + "enum": [ + "fulltext" + ], + "title": "fulltext" + }, + { + "type": "string", + "enum": [ + "unique" + ], + "title": "unique" + }, + { + "type": "string", + "enum": [ + "spatial" + ], + "title": "spatial" + } + ] + }, + "attributes": { + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "orders": { + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "type": "array", + "default": [], + "items": { + "title": "OrderBy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ] + } + }, + "lengths": { + "description": "Length of index. Maximum of 100", + "type": "array", + "default": [], + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "tags": [ + "databases" + ], + "description": "Get an index by its unique ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "indexes", + "demo": "databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "indexes", + "demo": "databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb": { + "get": { + "summary": "List databases", + "operationId": "documentsDBList", + "tags": [ + "documentsDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "documentsDBCreate", + "tags": [ + "documentsDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DATABASE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/documentsdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "documentsDBListTransactions", + "tags": [ + "documentsDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "documentsDBCreateTransaction", + "tags": [ + "documentsDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/documentsdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "documentsDBGetTransaction", + "tags": [ + "documentsDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "documentsDBUpdateTransaction", + "tags": [ + "documentsDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "documentsDBDeleteTransaction", + "tags": [ + "documentsDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "documentsDBCreateOperations", + "tags": [ + "documentsDB" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "documentsdb\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "documentsDBGet", + "tags": [ + "documentsDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "documentsDBUpdate", + "tags": [ + "documentsDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "documentsDBDelete", + "tags": [ + "documentsDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documentsdb", + "demo": "documentsdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "documentsDBListCollections", + "tags": [ + "documentsDB" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collectionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collection", + "operationId": "documentsDBCreateCollection", + "tags": [ + "documentsDB" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<COLLECTION_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "attributes": { + "description": "Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "indexes": { + "description": "Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC\/DESC, optional), and lengths (array of integers, optional).", + "type": "array", + "default": [], + "items": { + "type": "object" + } + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "documentsDBGetCollection", + "tags": [ + "documentsDB" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "documentsDBUpdateCollection", + "tags": [ + "documentsDB" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "purge": { + "description": "When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "documentsDBDeleteCollection", + "tags": [ + "documentsDB" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "documentsdb\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "documentsDBListDocuments", + "tags": [ + "documentsDB" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "documentsDBCreateDocument", + "tags": [ + "documentsDB" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createDocument", + "namespace": "documentsDB", + "desc": "Create document", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/create-document.md", + "public": true + }, + { + "name": "createDocuments", + "namespace": "documentsDB", + "desc": "Create documents", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/create-documents.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + }, + "put": { + "summary": "Upsert documents", + "operationId": "documentsDBUpsertDocuments", + "tags": [ + "documentsDB" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "documentsDB", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.\n", + "demo": "documentsdb\/upsert-documents.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "description": "Array of document data as JSON objects. May contain partial documents.", + "type": "array", + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "documentsDBUpdateDocuments", + "tags": [ + "documentsDB" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "documentsDBDeleteDocuments", + "tags": [ + "documentsDB" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "documentsDBGetDocument", + "tags": [ + "documentsDB" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "documentsDBUpsertDocument", + "tags": [ + "documentsDB" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocument", + "namespace": "documentsDB", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "documentsdb\/upsert-document.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required fields of the document to be created or updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "documentsDBUpdateDocument", + "tags": [ + "documentsDB" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only fields and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "documentsDBDeleteDocument", + "tags": [ + "documentsDB" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "documentsDBDecrementDocumentAttribute", + "tags": [ + "documentsDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to decrement the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float" + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "documentsDBIncrementDocumentAttribute", + "tags": [ + "documentsDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string", + "example": "<ATTRIBUTE>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the attribute by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float" + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "documentsDBListIndexes", + "tags": [ + "documentsDB" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "documentsdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.indexes.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "documentsDBCreateIndex", + "tags": [ + "documentsDB" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "documentsdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.indexes.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Index Key.", + "type": "string", + "example": "<KEY>" + }, + "type": { + "description": "Index type.", + "type": "string", + "example": "key", + "title": "DocumentsDBIndexType", + "oneOf": [ + { + "type": "string", + "enum": [ + "key" + ], + "title": "key" + }, + { + "type": "string", + "enum": [ + "fulltext" + ], + "title": "fulltext" + }, + { + "type": "string", + "enum": [ + "unique" + ], + "title": "unique" + } + ] + }, + "attributes": { + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "orders": { + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "type": "array", + "default": [], + "items": { + "title": "OrderBy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ] + } + }, + "lengths": { + "description": "Length of index. Maximum of 100", + "type": "array", + "default": [], + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "documentsDBGetIndex", + "tags": [ + "documentsDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "documentsdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.indexes.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "documentsDBDeleteIndex", + "tags": [ + "documentsDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "documentsdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documentsdb.indexes.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/embeddings\/text": { + "post": { + "summary": "Create text embeddings", + "operationId": "embeddingsCreateTextEmbeddings", + "tags": [ + "embeddings" + ], + "description": "Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections.\n", + "responses": { + "200": { + "description": "Embedding list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/embeddingList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "embeddings", + "demo": "embeddings\/create-text-embeddings.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "embeddings.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createTextEmbeddings", + "namespace": "embeddings", + "desc": "Create Text Embedding", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "texts", + "model" + ], + "required": [ + "texts" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/embeddingList" + } + ], + "description": "Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections.\n", + "demo": "embeddings\/create-text-embeddings.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "texts": { + "description": "Array of text to generate embeddings.", + "type": "array", + "items": { + "type": "string" + } + }, + "model": { + "description": "The embedding model to use for generating vector embeddings.", + "type": "string", + "default": "nomic-embed-text", + "example": "nomic-embed-text", + "title": "EmbeddingModel", + "oneOf": [ + { + "type": "string", + "enum": [ + "nomic-embed-text" + ], + "title": "nomic-embed-text" + }, + { + "type": "string", + "enum": [ + "all-minilm" + ], + "title": "all-minilm" + } + ] + } + }, + "required": [ + "texts" + ] + } + } + } + } + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/functionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "functionId": { + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<FUNCTION_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Function name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "runtime": { + "description": "Execution runtime.", + "type": "string", + "example": "node-14.5", + "title": "Runtime", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "execute": { + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "type": "array", + "default": [], + "example": [ + "any" + ], + "items": { + "type": "string" + } + }, + "events": { + "description": "Events list. Maximum of 100 events are allowed.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "schedule": { + "description": "Schedule CRON syntax.", + "type": "string", + "default": "", + "example": "0 0 * * *" + }, + "timeout": { + "description": "Function maximum execution time in seconds.", + "type": "integer", + "default": 15, + "example": 1, + "format": "int32" + }, + "enabled": { + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "logging": { + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "type": "boolean", + "default": true, + "example": false + }, + "entrypoint": { + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "type": "string", + "default": "", + "example": "<ENTRYPOINT>" + }, + "commands": { + "description": "Build Commands.", + "type": "string", + "default": "", + "example": "<COMMANDS>" + }, + "scopes": { + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 200 scopes are allowed.", + "type": "array", + "default": [], + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "installationId": { + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "type": "string", + "default": "", + "example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "description": "Repository ID of the repo linked to the function.", + "type": "string", + "default": "", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "description": "Production branch for the repo linked to the function.", + "type": "string", + "default": "", + "example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "type": "boolean", + "default": false, + "example": false + }, + "providerRootDirectory": { + "description": "Path to function code in the linked repo.", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "providerBranches": { + "description": "List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "providerPaths": { + "description": "List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "buildSpecification": { + "description": "Build specification for the function deployments.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "runtimeSpecification": { + "description": "Runtime specification for the function executions.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "deploymentRetention": { + "description": "Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + } + } + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/runtimeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "runtimes", + "demo": "functions\/list-runtimes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "runtimes", + "demo": "functions\/list-specifications.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes.", + "required": false, + "schema": { + "type": "string", + "example": "runtimes", + "default": "runtimes" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Function name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "runtime": { + "description": "Execution runtime.", + "type": "string", + "default": "", + "example": "node-14.5", + "title": "Runtime", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "execute": { + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "type": "array", + "default": [], + "example": [ + "any" + ], + "items": { + "type": "string" + } + }, + "events": { + "description": "Events list. Maximum of 100 events are allowed.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "schedule": { + "description": "Schedule CRON syntax.", + "type": "string", + "default": "", + "example": "0 0 * * *" + }, + "timeout": { + "description": "Maximum execution time in seconds.", + "type": "integer", + "default": 15, + "example": 1, + "format": "int32" + }, + "enabled": { + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "logging": { + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "type": "boolean", + "default": true, + "example": false + }, + "entrypoint": { + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "type": "string", + "default": "", + "example": "<ENTRYPOINT>" + }, + "commands": { + "description": "Build Commands.", + "type": "string", + "default": "", + "example": "<COMMANDS>" + }, + "scopes": { + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed.", + "type": "array", + "default": [], + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "installationId": { + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "type": "string", + "default": "", + "example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "description": "Repository ID of the repo linked to the function", + "type": "string", + "example": "<PROVIDER_REPOSITORY_ID>", + "nullable": true + }, + "providerBranch": { + "description": "Production branch for the repo linked to the function", + "type": "string", + "default": "", + "example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "type": "boolean", + "default": false, + "example": false + }, + "providerRootDirectory": { + "description": "Path to function code in the linked repo.", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "providerBranches": { + "description": "List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "providerPaths": { + "description": "List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "buildSpecification": { + "description": "Build specification for the function deployments.", + "type": "string", + "example": "s-1vcpu-512mb", + "nullable": true + }, + "runtimeSpecification": { + "description": "Runtime specification for the function executions.", + "type": "string", + "example": "s-1vcpu-512mb", + "nullable": true + }, + "deploymentRetention": { + "description": "Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "functions", + "demo": "functions\/update-function-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "description": "Deployment ID.", + "type": "string", + "example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/list-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/create-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": true, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "entrypoint": { + "description": "Entrypoint File.", + "type": "string", + "example": "<ENTRYPOINT>", + "nullable": true + }, + "commands": { + "description": "Build Commands.", + "type": "string", + "example": "<COMMANDS>", + "nullable": true + }, + "code": { + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "type": "string", + "format": "binary" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/create-duplicate-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "description": "Deployment ID.", + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "buildId": { + "description": "Build unique ID.", + "type": "string", + "default": "", + "example": "<BUILD_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/products\/functions\/templates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/create-template-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "description": "Repository name of the template.", + "type": "string", + "example": "<REPOSITORY>" + }, + "owner": { + "description": "The name of the owner of the template.", + "type": "string", + "example": "<OWNER>" + }, + "rootDirectory": { + "description": "Path to function code in the template repo.", + "type": "string", + "example": "<ROOT_DIRECTORY>" + }, + "type": { + "description": "Type for the reference provided. Can be commit, branch, or tag", + "type": "string", + "example": "commit", + "title": "TemplateReferenceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "commit" + ], + "title": "commit" + }, + { + "type": "string", + "enum": [ + "branch" + ], + "title": "branch" + }, + { + "type": "string", + "enum": [ + "tag" + ], + "title": "tag" + } + ] + }, + "reference": { + "description": "Reference value, can be a commit hash, branch name, or release tag", + "type": "string", + "example": "<REFERENCE>" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "type", + "reference" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/create-vcs-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "description": "Type of reference passed. Allowed values are: branch, commit", + "type": "string", + "example": "branch", + "title": "VCSReferenceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "branch" + ], + "title": "branch" + }, + { + "type": "string", + "enum": [ + "commit" + ], + "title": "commit" + } + ] + }, + "reference": { + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "type": "string", + "example": "<REFERENCE>" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/get-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/delete-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "tags": [ + "functions" + ], + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/get-deployment-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "public", + "functions.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "example": "source", + "title": "DeploymentDownloadType", + "oneOf": [ + { + "type": "string", + "enum": [ + "source" + ], + "title": "source" + }, + { + "type": "string", + "enum": [ + "output" + ], + "title": "output" + } + ], + "default": "source" + }, + "in": "query" + }, + { + "name": "token", + "description": "Presigned source-download token for accessing this deployment without a session (jobs-service).", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "functions\/update-deployment-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/list-executions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.read", + "execution.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/create-execution.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.write", + "execution.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "description": "HTTP body of execution. Default value is empty string.", + "type": "string", + "default": "", + "example": "<BODY>" + }, + "async": { + "description": "Execute code in the background. Default value is false.", + "type": "boolean", + "default": false, + "example": false + }, + "path": { + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "type": "string", + "default": "\/", + "example": "<PATH>" + }, + "method": { + "description": "HTTP method of execution. Default value is POST.", + "type": "string", + "default": "POST", + "example": "GET", + "title": "ExecutionMethod", + "oneOf": [ + { + "type": "string", + "enum": [ + "GET" + ], + "title": "GET" + }, + { + "type": "string", + "enum": [ + "POST" + ], + "title": "POST" + }, + { + "type": "string", + "enum": [ + "PUT" + ], + "title": "PUT" + }, + { + "type": "string", + "enum": [ + "PATCH" + ], + "title": "PATCH" + }, + { + "type": "string", + "enum": [ + "DELETE" + ], + "title": "DELETE" + }, + { + "type": "string", + "enum": [ + "OPTIONS" + ], + "title": "OPTIONS" + }, + { + "type": "string", + "enum": [ + "HEAD" + ], + "title": "HEAD" + } + ] + }, + "headers": { + "description": "HTTP headers of execution. Defaults to empty.", + "type": "object", + "default": [], + "example": {} + }, + "scheduledAt": { + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "type": "string", + "example": "<SCHEDULED_AT>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/get-execution.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.read", + "execution.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "executions", + "demo": "functions\/delete-execution.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "executions.write", + "execution.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "variableId": { + "description": "Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<VARIABLE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>" + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>" + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "variableId", + "key", + "value" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>", + "nullable": true + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "functions\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "graphql", + "demo": "graphql\/query.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "description": "The query or queries to execute.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "query" + ] + } + } + } + } + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "graphql", + "demo": "graphql\/mutation.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "description": "The query or queries to execute.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "query" + ] + } + } + } + } + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/messageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<MESSAGE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "subject": { + "description": "Email Subject.", + "type": "string", + "example": "<SUBJECT>" + }, + "content": { + "description": "Email Content.", + "type": "string", + "example": "<CONTENT>" + }, + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "cc": { + "description": "Array of target IDs to be added as CC.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "bcc": { + "description": "Array of target IDs to be added as BCC.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "attachments": { + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "default": false, + "example": false + }, + "html": { + "description": "Is content of type HTML", + "type": "boolean", + "default": false, + "example": false + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "subject": { + "description": "Email Subject.", + "type": "string", + "example": "<SUBJECT>", + "nullable": true + }, + "content": { + "description": "Email Content.", + "type": "string", + "example": "<CONTENT>", + "nullable": true + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "example": false, + "nullable": true + }, + "html": { + "description": "Is content of type HTML", + "type": "boolean", + "example": false, + "nullable": true + }, + "cc": { + "description": "Array of target IDs to be added as CC.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "bcc": { + "description": "Array of target IDs to be added as BCC.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "attachments": { + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<MESSAGE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "title": { + "description": "Title for push notification.", + "type": "string", + "default": "", + "example": "<TITLE>" + }, + "body": { + "description": "Body for push notification.", + "type": "string", + "default": "", + "example": "<BODY>" + }, + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "data": { + "description": "Additional key-value pair data for push notification.", + "type": "object", + "default": {}, + "example": {}, + "nullable": true + }, + "action": { + "description": "Action for push notification.", + "type": "string", + "default": "", + "example": "<ACTION>" + }, + "image": { + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "type": "string", + "default": "", + "example": "<ID1:ID2>" + }, + "icon": { + "description": "Icon for push notification. Available only for Android and Web Platform.", + "type": "string", + "default": "", + "example": "<ICON>" + }, + "sound": { + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "type": "string", + "default": "", + "example": "<SOUND>" + }, + "color": { + "description": "Color for push notification. Available only for Android Platform.", + "type": "string", + "default": "", + "example": "<COLOR>" + }, + "tag": { + "description": "Tag for push notification. Available only for Android Platform.", + "type": "string", + "default": "", + "example": "<TAG>" + }, + "badge": { + "description": "Badge for push notification. Available only for iOS Platform.", + "type": "integer", + "default": -1, + "example": 1, + "format": "int32" + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "default": false, + "example": false + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "contentAvailable": { + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "type": "boolean", + "default": false, + "example": false + }, + "critical": { + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "type": "boolean", + "default": false, + "example": false + }, + "priority": { + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "type": "string", + "default": "high", + "example": "normal", + "title": "MessagePriority", + "oneOf": [ + { + "type": "string", + "enum": [ + "normal" + ], + "title": "normal" + }, + { + "type": "string", + "enum": [ + "high" + ], + "title": "high" + } + ] + } + }, + "required": [ + "messageId" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "title": { + "description": "Title for push notification.", + "type": "string", + "example": "<TITLE>", + "nullable": true + }, + "body": { + "description": "Body for push notification.", + "type": "string", + "example": "<BODY>", + "nullable": true + }, + "data": { + "description": "Additional Data for push notification.", + "type": "object", + "default": {}, + "example": {}, + "nullable": true + }, + "action": { + "description": "Action for push notification.", + "type": "string", + "example": "<ACTION>", + "nullable": true + }, + "image": { + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "type": "string", + "example": "<ID1:ID2>", + "nullable": true + }, + "icon": { + "description": "Icon for push notification. Available only for Android and Web platforms.", + "type": "string", + "example": "<ICON>", + "nullable": true + }, + "sound": { + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "type": "string", + "example": "<SOUND>", + "nullable": true + }, + "color": { + "description": "Color for push notification. Available only for Android platforms.", + "type": "string", + "example": "<COLOR>", + "nullable": true + }, + "tag": { + "description": "Tag for push notification. Available only for Android platforms.", + "type": "string", + "example": "<TAG>", + "nullable": true + }, + "badge": { + "description": "Badge for push notification. Available only for iOS platforms.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "example": false, + "nullable": true + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "contentAvailable": { + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "type": "boolean", + "example": false, + "nullable": true + }, + "critical": { + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "type": "boolean", + "example": false, + "nullable": true + }, + "priority": { + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "type": "string", + "example": "normal", + "title": "MessagePriority", + "oneOf": [ + { + "type": "string", + "enum": [ + "normal" + ], + "title": "normal" + }, + { + "type": "string", + "enum": [ + "high" + ], + "title": "high" + } + ], + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<MESSAGE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "content": { + "description": "SMS Content.", + "type": "string", + "example": "<CONTENT>" + }, + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "default": false, + "example": false + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + }, + "required": [ + "messageId", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "description": "List of Topic IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "users": { + "description": "List of User IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "targets": { + "description": "List of Targets IDs.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "content": { + "description": "Email Content.", + "type": "string", + "example": "<CONTENT>", + "nullable": true + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "example": false, + "nullable": true + }, + "scheduledAt": { + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "messages", + "demo": "messaging\/list-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "authKey": { + "description": "APNS authentication key.", + "type": "string", + "default": "", + "example": "<AUTH_KEY>" + }, + "authKeyId": { + "description": "APNS authentication key ID.", + "type": "string", + "default": "", + "example": "<AUTH_KEY_ID>" + }, + "teamId": { + "description": "APNS team ID.", + "type": "string", + "default": "", + "example": "<TEAM_ID>" + }, + "bundleId": { + "description": "APNS bundle ID.", + "type": "string", + "default": "", + "example": "<BUNDLE_ID>" + }, + "sandbox": { + "description": "Use APNS sandbox environment.", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "authKey": { + "description": "APNS authentication key.", + "type": "string", + "default": "", + "example": "<AUTH_KEY>" + }, + "authKeyId": { + "description": "APNS authentication key ID.", + "type": "string", + "default": "", + "example": "<AUTH_KEY_ID>" + }, + "teamId": { + "description": "APNS team ID.", + "type": "string", + "default": "", + "example": "<TEAM_ID>" + }, + "bundleId": { + "description": "APNS bundle ID.", + "type": "string", + "default": "", + "example": "<BUNDLE_ID>" + }, + "sandbox": { + "description": "Use APNS sandbox environment.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "serviceAccountJSON": { + "description": "FCM service account JSON.", + "type": "object", + "default": {}, + "example": {}, + "nullable": true + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "serviceAccountJSON": { + "description": "FCM service account JSON.", + "type": "object", + "default": {}, + "example": {}, + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "apiKey": { + "description": "Mailgun API Key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "domain": { + "description": "Mailgun Domain.", + "type": "string", + "default": "", + "example": "example.com" + }, + "isEuRegion": { + "description": "Set as EU region.", + "type": "boolean", + "example": false, + "nullable": true + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "apiKey": { + "description": "Mailgun API Key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "domain": { + "description": "Mailgun Domain.", + "type": "string", + "default": "", + "example": "example.com" + }, + "isEuRegion": { + "description": "Set as EU region.", + "type": "boolean", + "example": false, + "nullable": true + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-msg-91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "templateId": { + "description": "Msg91 template ID", + "type": "string", + "default": "", + "example": "<TEMPLATE_ID>" + }, + "senderId": { + "description": "Msg91 sender ID.", + "type": "string", + "default": "", + "example": "<SENDER_ID>" + }, + "authKey": { + "description": "Msg91 auth key.", + "type": "string", + "default": "", + "example": "<AUTH_KEY>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-msg-91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "templateId": { + "description": "Msg91 template ID.", + "type": "string", + "default": "", + "example": "<TEMPLATE_ID>" + }, + "senderId": { + "description": "Msg91 sender ID.", + "type": "string", + "default": "", + "example": "<SENDER_ID>" + }, + "authKey": { + "description": "Msg91 auth key.", + "type": "string", + "default": "", + "example": "<AUTH_KEY>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/resend": { + "post": { + "summary": "Create Resend provider", + "operationId": "messagingCreateResendProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Resend provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-resend-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "apiKey": { + "description": "Resend API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/resend\/{providerId}": { + "patch": { + "summary": "Update Resend provider", + "operationId": "messagingUpdateResendProvider", + "tags": [ + "messaging" + ], + "description": "Update a Resend provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-resend-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "apiKey": { + "description": "Resend API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "apiKey": { + "description": "Sendgrid API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "apiKey": { + "description": "Sendgrid API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/ses": { + "post": { + "summary": "Create Amazon SES provider", + "operationId": "messagingCreateSesProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Amazon SES provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-ses-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "accessKey": { + "description": "AWS access key ID.", + "type": "string", + "default": "", + "example": "<ACCESS_KEY>" + }, + "secretKey": { + "description": "AWS secret access key.", + "type": "string", + "default": "", + "example": "<SECRET_KEY>" + }, + "region": { + "description": "AWS region, for example us-east-1.", + "type": "string", + "default": "", + "example": "<REGION>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/ses\/{providerId}": { + "patch": { + "summary": "Update Amazon SES provider", + "operationId": "messagingUpdateSesProvider", + "tags": [ + "messaging" + ], + "description": "Update an Amazon SES provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-ses-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "accessKey": { + "description": "AWS access key ID.", + "type": "string", + "default": "", + "example": "<ACCESS_KEY>" + }, + "secretKey": { + "description": "AWS secret access key.", + "type": "string", + "default": "", + "example": "<SECRET_KEY>" + }, + "region": { + "description": "AWS region, for example us-east-1.", + "type": "string", + "default": "", + "example": "<REGION>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "host": { + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "type": "string", + "example": "<HOST>" + }, + "port": { + "description": "The default SMTP server port.", + "type": "integer", + "default": 587, + "example": 587, + "format": "int32" + }, + "username": { + "description": "Authentication username.", + "type": "string", + "default": "", + "example": "<USERNAME>" + }, + "password": { + "description": "Authentication password.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + }, + "encryption": { + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "type": "string", + "default": "", + "example": "none", + "title": "SmtpEncryption", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "ssl" + ], + "title": "ssl" + }, + { + "type": "string", + "enum": [ + "tls" + ], + "title": "tls" + } + ] + }, + "autoTLS": { + "description": "Enable SMTP AutoTLS feature.", + "type": "boolean", + "default": true, + "example": false + }, + "mailer": { + "description": "The value to use for the X-Mailer header.", + "type": "string", + "default": "", + "example": "<MAILER>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "host": { + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "type": "string", + "default": "", + "example": "<HOST>" + }, + "port": { + "description": "SMTP port.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "username": { + "description": "Authentication username.", + "type": "string", + "default": "", + "example": "<USERNAME>" + }, + "password": { + "description": "Authentication password.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + }, + "encryption": { + "description": "Encryption type. Can be 'ssl' or 'tls'", + "type": "string", + "default": "", + "example": "none", + "title": "SmtpEncryption", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "ssl" + ], + "title": "ssl" + }, + { + "type": "string", + "enum": [ + "tls" + ], + "title": "tls" + } + ] + }, + "autoTLS": { + "description": "Enable SMTP AutoTLS feature.", + "type": "boolean", + "example": false, + "nullable": true + }, + "mailer": { + "description": "The value to use for the X-Mailer header.", + "type": "string", + "default": "", + "example": "<MAILER>" + }, + "fromName": { + "description": "Sender Name.", + "type": "string", + "default": "", + "example": "<FROM_NAME>" + }, + "fromEmail": { + "description": "Sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "type": "string", + "default": "", + "example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "from": { + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "customerId": { + "description": "Telesign customer ID.", + "type": "string", + "default": "", + "example": "<CUSTOMER_ID>" + }, + "apiKey": { + "description": "Telesign API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "customerId": { + "description": "Telesign customer ID.", + "type": "string", + "default": "", + "example": "<CUSTOMER_ID>" + }, + "apiKey": { + "description": "Telesign API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "from": { + "description": "Sender number.", + "type": "string", + "default": "", + "example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "from": { + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "username": { + "description": "Textmagic username.", + "type": "string", + "default": "", + "example": "<USERNAME>" + }, + "apiKey": { + "description": "Textmagic apiKey.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "username": { + "description": "Textmagic username.", + "type": "string", + "default": "", + "example": "<USERNAME>" + }, + "apiKey": { + "description": "Textmagic apiKey.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "from": { + "description": "Sender number.", + "type": "string", + "default": "", + "example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "from": { + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "accountSid": { + "description": "Twilio account secret ID.", + "type": "string", + "default": "", + "example": "<ACCOUNT_SID>" + }, + "authToken": { + "description": "Twilio authentication token.", + "type": "string", + "default": "", + "example": "<AUTH_TOKEN>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "accountSid": { + "description": "Twilio account secret ID.", + "type": "string", + "default": "", + "example": "<ACCOUNT_SID>" + }, + "authToken": { + "description": "Twilio authentication token.", + "type": "string", + "default": "", + "example": "<AUTH_TOKEN>" + }, + "from": { + "description": "Sender number.", + "type": "string", + "default": "", + "example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROVIDER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "<NAME>" + }, + "from": { + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "apiKey": { + "description": "Vonage API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "apiSecret": { + "description": "Vonage API secret.", + "type": "string", + "default": "", + "example": "<API_SECRET>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "<NAME>" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "apiKey": { + "description": "Vonage API key.", + "type": "string", + "default": "", + "example": "<API_KEY>" + }, + "apiSecret": { + "description": "Vonage API secret.", + "type": "string", + "default": "", + "example": "<API_SECRET>" + }, + "from": { + "description": "Sender number.", + "type": "string", + "default": "", + "example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topicList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topicId": { + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "type": "string", + "example": "<TOPIC_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Topic Name.", + "type": "string", + "example": "<NAME>" + }, + "subscribe": { + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "type": "array", + "default": [ + "users" + ], + "example": [ + "any" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Topic Name.", + "type": "string", + "example": "<NAME>", + "nullable": true + }, + "subscribe": { + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "type": "array", + "example": [ + "any" + ], + "items": { + "type": "string" + }, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "topics", + "demo": "messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriberList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: targetId, topicId, userId, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "type": "string", + "example": "<SUBSCRIBER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "targetId": { + "description": "Target ID. The target ID to link to the specified Topic ID.", + "type": "string", + "example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "subscribers", + "demo": "messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/organization\/projects": { + "get": { + "summary": "List organization projects", + "operationId": "organizationListProjects", + "tags": [ + "organization" + ], + "description": "Get a list of all projects. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Projects List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/projectList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/list-projects.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create organization project", + "operationId": "organizationCreateProject", + "tags": [ + "organization" + ], + "description": "Create a new project.", + "responses": { + "201": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/create-project.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "projectId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PROJECT_ID>" + }, + "name": { + "description": "Project name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "region": { + "description": "Project Region.", + "type": "string", + "default": "default", + "example": "default", + "title": "Region", + "oneOf": [ + { + "type": "string", + "enum": [ + "default" + ], + "title": "default" + } + ] + } + }, + "required": [ + "projectId", + "name" + ] + } + } + } + } + } + }, + "\/organization\/projects\/{projectId}": { + "get": { + "summary": "Get organization project", + "operationId": "organizationGetProject", + "tags": [ + "organization" + ], + "description": "Get a project.", + "responses": { + "200": { + "description": "Project", + "content": { + "": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/get-project.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update organization project", + "operationId": "organizationUpdateProject", + "tags": [ + "organization" + ], + "description": "Update a project by its unique ID.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/update-project.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Project name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete organization project", + "operationId": "organizationDeleteProject", + "tags": [ + "organization" + ], + "description": "Delete a project by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "projects", + "demo": "organization\/delete-project.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Organization": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/ping": { + "get": { + "summary": "Test the connection between the Appwrite and the SDK.", + "operationId": "pingGet", + "tags": [ + "ping" + ], + "description": "Send a ping to project as part of onboarding.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "ping\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "global", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [], + "Session": [] + } + ] + } + }, + "\/presences": { + "get": { + "summary": "List presences", + "operationId": "presencesList", + "tags": [ + "presences" + ], + "description": "List presence logs. Expired entries are filtered out automatically.\n", + "responses": { + "200": { + "description": "Presences List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presenceList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/presences\/{presenceId}": { + "get": { + "summary": "Get presence", + "operationId": "presencesGet", + "tags": [ + "presences" + ], + "description": "Get a presence log by its unique ID. Entries whose `expiresAt` is in the past are treated as not found.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Upsert presence", + "operationId": "presencesUpsert", + "tags": [ + "presences" + ], + "description": "Create or update a presence log by its user ID.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/upsert.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "client", + "console" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsert", + "namespace": "presences", + "desc": "Upsert presence", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "presenceId", + "userId", + "status", + "permissions", + "expiresAt", + "metadata" + ], + "required": [ + "presenceId", + "userId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/presence" + } + ], + "description": "Create or update a presence log by its user ID.\n", + "demo": "presences\/upsert.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "status": { + "description": "Presence status.", + "type": "string", + "example": "<STATUS>" + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "expiresAt": { + "description": "Presence expiry datetime.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime" + }, + "metadata": { + "description": "Presence metadata object.", + "type": "object", + "default": [], + "example": {} + } + }, + "required": [ + "status" + ] + } + } + } + } + }, + "patch": { + "summary": "Update presence", + "operationId": "presencesUpdate", + "tags": [ + "presences" + ], + "description": "Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated.\n", + "responses": { + "200": { + "description": "Presence", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/presence" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "client", + "console" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "update", + "namespace": "presences", + "desc": "Update presence", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "presenceId", + "userId", + "status", + "expiresAt", + "metadata", + "permissions", + "purge" + ], + "required": [ + "presenceId", + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/presence" + } + ], + "description": "Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated.\n", + "demo": "presences\/update.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "status": { + "description": "Presence status.", + "type": "string", + "example": "<STATUS>" + }, + "expiresAt": { + "description": "Presence expiry datetime.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime" + }, + "metadata": { + "description": "Presence metadata object.", + "type": "object", + "default": {}, + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "purge": { + "description": "When true, purge cached responses used by list presences endpoint.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete presence", + "operationId": "presencesDelete", + "tags": [ + "presences" + ], + "description": "Delete a presence log by its unique ID.\n", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "presences", + "demo": "presences\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "presences.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "presenceId", + "description": "Presence unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PRESENCE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/project": { + "get": { + "summary": "Get project", + "operationId": "projectGet", + "tags": [ + "project" + ], + "description": "Get a project.", + "responses": { + "200": { + "description": "Project", + "content": { + "": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + }, + "delete": { + "summary": "Delete project", + "operationId": "projectDelete", + "tags": [ + "project" + ], + "description": "Delete a project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/project\/auth-methods\/{methodId}": { + "patch": { + "summary": "Update project auth method status", + "operationId": "projectUpdateAuthMethod", + "tags": [ + "project" + ], + "description": "Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/update-auth-method.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "methodId", + "description": "Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone", + "required": true, + "schema": { + "type": "string", + "example": "email-password", + "title": "ProjectAuthMethodId", + "oneOf": [ + { + "type": "string", + "enum": [ + "email-password" + ], + "title": "email-password" + }, + { + "type": "string", + "enum": [ + "magic-url" + ], + "title": "magic-url" + }, + { + "type": "string", + "enum": [ + "email-otp" + ], + "title": "email-otp" + }, + { + "type": "string", + "enum": [ + "anonymous" + ], + "title": "anonymous" + }, + { + "type": "string", + "enum": [ + "invites" + ], + "title": "invites" + }, + { + "type": "string", + "enum": [ + "jwt" + ], + "title": "jwt" + }, + { + "type": "string", + "enum": [ + "phone" + ], + "title": "phone" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Auth method status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/keys": { + "get": { + "summary": "List project keys", + "operationId": "projectListKeys", + "tags": [ + "project" + ], + "description": "Get a list of all API keys from the current project.", + "responses": { + "200": { + "description": "API Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/keyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/list-keys.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/project\/keys\/ephemeral": { + "post": { + "summary": "Create ephemeral project key", + "operationId": "projectCreateEphemeralKey", + "tags": [ + "project" + ], + "description": "Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.\n\nYou can also create a standard API key if you need a longer-lived key instead.", + "responses": { + "201": { + "description": "Ephemeral Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/ephemeralKey" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/create-ephemeral-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "scopes": { + "description": "Key scopes list. Maximum of 200 scopes are allowed.", + "type": "array", + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "duration": { + "description": "Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds.", + "type": "integer", + "example": 600, + "format": "int32" + } + }, + "required": [ + "scopes", + "duration" + ] + } + } + } + } + } + }, + "\/project\/keys\/{keyId}": { + "get": { + "summary": "Get project key", + "operationId": "projectGetKey", + "tags": [ + "project" + ], + "description": "Get a key by its unique ID. ", + "responses": { + "200": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/get-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "keyId", + "description": "Key ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update project key", + "operationId": "projectUpdateKey", + "tags": [ + "project" + ], + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.", + "responses": { + "200": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/update-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "keyId", + "description": "Key ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Key name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "scopes": { + "description": "Key scopes list. Maximum of 200 scopes are allowed.", + "type": "array", + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + }, + "expire": { + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + }, + "required": [ + "name", + "scopes" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete project key", + "operationId": "projectDeleteKey", + "tags": [ + "project" + ], + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "keys", + "demo": "project\/delete-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "keyId", + "description": "Key ID.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/project\/labels": { + "put": { + "summary": "Update project labels", + "operationId": "projectUpdateLabels", + "tags": [ + "project" + ], + "description": "Update the project labels. Labels can be used to easily filter projects in an organization.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/update-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "description": "Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, + "\/project\/mock-phones": { + "get": { + "summary": "List project mock phones", + "operationId": "projectListMockPhones", + "tags": [ + "project" + ], + "description": "Get a list of all mock phones in the project. This endpoint returns an array of all mock phones and their OTPs.", + "responses": { + "200": { + "description": "Mock Numbers List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mockNumberList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/list-mock-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create project mock phone", + "operationId": "projectCreateMockPhone", + "tags": [ + "project" + ], + "description": "Create a new mock phone for your project. Use this endpoint to register a mock phone number and its sign-in OTP for your testers.", + "responses": { + "201": { + "description": "Mock Number", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mockNumber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/create-mock-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "description": "Phone number to associate with the mock phone. Must be a valid E.164 formatted phone number.", + "type": "string", + "example": "+12065550100", + "format": "phone" + }, + "otp": { + "description": "One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "number", + "otp" + ] + } + } + } + } + } + }, + "\/project\/mock-phones\/{number}": { + "get": { + "summary": "Get project mock phone", + "operationId": "projectGetMockPhone", + "tags": [ + "project" + ], + "description": "Get a mock phone by its unique number. This endpoint returns the mock phone's OTP.", + "responses": { + "200": { + "description": "Mock Number", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mockNumber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/get-mock-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "number", + "description": "Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.", + "required": true, + "schema": { + "type": "string", + "format": "phone", + "example": "+12065550100" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update project mock phone", + "operationId": "projectUpdateMockPhone", + "tags": [ + "project" + ], + "description": "Update a mock phone by its unique number. Use this endpoint to update the mock phone's OTP.", + "responses": { + "200": { + "description": "Mock Number", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mockNumber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/update-mock-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "number", + "description": "Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.", + "required": true, + "schema": { + "type": "string", + "format": "phone", + "example": "+12065550100" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "description": "One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code.", + "type": "string", + "example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete project mock phone", + "operationId": "projectDeleteMockPhone", + "tags": [ + "project" + ], + "description": "Delete a mock phone by its unique number. This endpoint removes the mock phone and its OTP configuration from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mocks", + "demo": "project\/delete-mock-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "mocks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "number", + "description": "Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.", + "required": true, + "schema": { + "type": "string", + "format": "phone", + "example": "+12065550100" + }, + "in": "path" + } + ] + } + }, + "\/project\/oauth2": { + "get": { + "summary": "List project OAuth2 providers", + "operationId": "projectListOAuth2Providers", + "tags": [ + "project" + ], + "description": "Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty.", + "responses": { + "200": { + "description": "OAuth2 Providers List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2ProviderList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/list-o-auth-2-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/project\/oauth2\/amazon": { + "patch": { + "summary": "Update project OAuth2 Amazon", + "operationId": "projectUpdateOAuth2Amazon", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Amazon configuration.", + "responses": { + "200": { + "description": "OAuth2Amazon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Amazon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-amazon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/apple": { + "patch": { + "summary": "Update project OAuth2 Apple", + "operationId": "projectUpdateOAuth2Apple", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Apple configuration.", + "responses": { + "200": { + "description": "OAuth2Apple", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Apple" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-apple.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "serviceId": { + "description": "'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web", + "type": "string", + "example": "<SERVICE_ID>", + "nullable": true + }, + "keyId": { + "description": "'Key ID' of Apple OAuth2 app. For example: P4000000N8", + "type": "string", + "example": "<KEY_ID>", + "nullable": true + }, + "teamId": { + "description": "'Team ID' of Apple OAuth2 app. For example: D4000000R6", + "type": "string", + "example": "<TEAM_ID>", + "nullable": true + }, + "p8File": { + "description": "Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----", + "type": "string", + "example": "<P8_FILE>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/appwrite": { + "patch": { + "summary": "Update project OAuth2 Appwrite", + "operationId": "projectUpdateOAuth2Appwrite", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Appwrite configuration.", + "responses": { + "200": { + "description": "OAuth2Appwrite", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Appwrite" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-appwrite.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/auth0": { + "patch": { + "summary": "Update project OAuth2 Auth0", + "operationId": "projectUpdateOAuth2Auth0", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Auth0 configuration.", + "responses": { + "200": { + "description": "OAuth2Auth0", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Auth0" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-auth-0.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Domain of Auth0 instance. For example: example.us.auth0.com", + "type": "string", + "example": "<ENDPOINT>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/authentik": { + "patch": { + "summary": "Update project OAuth2 Authentik", + "operationId": "projectUpdateOAuth2Authentik", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Authentik configuration.", + "responses": { + "200": { + "description": "OAuth2Authentik", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Authentik" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-authentik.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Domain of Authentik instance. For example: example.authentik.com", + "type": "string", + "example": "<ENDPOINT>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/autodesk": { + "patch": { + "summary": "Update project OAuth2 Autodesk", + "operationId": "projectUpdateOAuth2Autodesk", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Autodesk configuration.", + "responses": { + "200": { + "description": "OAuth2Autodesk", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Autodesk" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-autodesk.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/bitbucket": { + "patch": { + "summary": "Update project OAuth2 Bitbucket", + "operationId": "projectUpdateOAuth2Bitbucket", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Bitbucket configuration.", + "responses": { + "200": { + "description": "OAuth2Bitbucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Bitbucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-bitbucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "secret": { + "description": "'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx", + "type": "string", + "example": "<SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/bitly": { + "patch": { + "summary": "Update project OAuth2 Bitly", + "operationId": "projectUpdateOAuth2Bitly", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Bitly configuration.", + "responses": { + "200": { + "description": "OAuth2Bitly", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Bitly" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-bitly.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/box": { + "patch": { + "summary": "Update project OAuth2 Box", + "operationId": "projectUpdateOAuth2Box", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Box configuration.", + "responses": { + "200": { + "description": "OAuth2Box", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Box" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-box.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/cloudflare": { + "patch": { + "summary": "Update project OAuth2 Cloudflare", + "operationId": "projectUpdateOAuth2Cloudflare", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Cloudflare configuration.", + "responses": { + "200": { + "description": "OAuth2Cloudflare", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Cloudflare" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-cloudflare.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Cloudflare OAuth2 app. For example: 4b866000000000000000000000c9e4e2", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Cloudflare OAuth2 app. For example: cfoc_5Q6YRl0000000000000000000000000000000000003d214f", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/dailymotion": { + "patch": { + "summary": "Update project OAuth2 Dailymotion", + "operationId": "projectUpdateOAuth2Dailymotion", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Dailymotion configuration.", + "responses": { + "200": { + "description": "OAuth2Dailymotion", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Dailymotion" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-dailymotion.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "apiKey": { + "description": "'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f", + "type": "string", + "example": "<API_KEY>", + "nullable": true + }, + "apiSecret": { + "description": "'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639", + "type": "string", + "example": "<API_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/discord": { + "patch": { + "summary": "Update project OAuth2 Discord", + "operationId": "projectUpdateOAuth2Discord", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Discord configuration.", + "responses": { + "200": { + "description": "OAuth2Discord", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Discord" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-discord.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Discord OAuth2 app. For example: 950722000000343754", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/disqus": { + "patch": { + "summary": "Update project OAuth2 Disqus", + "operationId": "projectUpdateOAuth2Disqus", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Disqus configuration.", + "responses": { + "200": { + "description": "OAuth2Disqus", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Disqus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-disqus.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "publicKey": { + "description": "'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX", + "type": "string", + "example": "<PUBLIC_KEY>", + "nullable": true + }, + "secretKey": { + "description": "'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9", + "type": "string", + "example": "<SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/dropbox": { + "patch": { + "summary": "Update project OAuth2 Dropbox", + "operationId": "projectUpdateOAuth2Dropbox", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Dropbox configuration.", + "responses": { + "200": { + "description": "OAuth2Dropbox", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Dropbox" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-dropbox.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "appKey": { + "description": "'App Key' of Dropbox OAuth2 app. For example: jl000000000009t", + "type": "string", + "example": "<APP_KEY>", + "nullable": true + }, + "appSecret": { + "description": "'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw", + "type": "string", + "example": "<APP_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/etsy": { + "patch": { + "summary": "Update project OAuth2 Etsy", + "operationId": "projectUpdateOAuth2Etsy", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Etsy configuration.", + "responses": { + "200": { + "description": "OAuth2Etsy", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Etsy" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-etsy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "keyString": { + "description": "'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2", + "type": "string", + "example": "<KEY_STRING>", + "nullable": true + }, + "sharedSecret": { + "description": "'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru", + "type": "string", + "example": "<SHARED_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/facebook": { + "patch": { + "summary": "Update project OAuth2 Facebook", + "operationId": "projectUpdateOAuth2Facebook", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Facebook configuration.", + "responses": { + "200": { + "description": "OAuth2Facebook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Facebook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-facebook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "appId": { + "description": "'App ID' of Facebook OAuth2 app. For example: 260600000007694", + "type": "string", + "example": "<APP_ID>", + "nullable": true + }, + "appSecret": { + "description": "'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4", + "type": "string", + "example": "<APP_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/figma": { + "patch": { + "summary": "Update project OAuth2 Figma", + "operationId": "projectUpdateOAuth2Figma", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Figma configuration.", + "responses": { + "200": { + "description": "OAuth2Figma", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Figma" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-figma.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/fusionauth": { + "patch": { + "summary": "Update project OAuth2 FusionAuth", + "operationId": "projectUpdateOAuth2FusionAuth", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 FusionAuth configuration.", + "responses": { + "200": { + "description": "OAuth2FusionAuth", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2FusionAuth" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-fusion-auth.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Domain of FusionAuth instance. For example: example.fusionauth.io", + "type": "string", + "example": "<ENDPOINT>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/github": { + "patch": { + "summary": "Update project OAuth2 GitHub", + "operationId": "projectUpdateOAuth2GitHub", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 GitHub configuration.", + "responses": { + "200": { + "description": "OAuth2GitHub", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Github" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-git-hub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/gitlab": { + "patch": { + "summary": "Update project OAuth2 Gitlab", + "operationId": "projectUpdateOAuth2Gitlab", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Gitlab configuration.", + "responses": { + "200": { + "description": "OAuth2Gitlab", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Gitlab" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-gitlab.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "applicationId": { + "description": "'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252", + "type": "string", + "example": "<APPLICATION_ID>", + "nullable": true + }, + "secret": { + "description": "'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38", + "type": "string", + "example": "<SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Endpoint URL of self-hosted GitLab instance. For example: https:\/\/gitlab.com", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/google": { + "patch": { + "summary": "Update project OAuth2 Google", + "operationId": "projectUpdateOAuth2Google", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Google configuration.", + "responses": { + "200": { + "description": "OAuth2Google", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Google" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-google.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "prompt": { + "description": "Array of Google OAuth2 prompt values. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. Must not be specified with other values. \"consent\" means: prompt the user for consent. \"select_account\" means: prompt the user to select an account.", + "type": "array", + "items": { + "title": "ProjectOAuth2GooglePrompt", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "consent" + ], + "title": "consent" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/huggingface": { + "patch": { + "summary": "Update project OAuth2 Hugging Face", + "operationId": "projectUpdateOAuth2HuggingFace", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Hugging Face configuration.", + "responses": { + "200": { + "description": "OAuth2HuggingFace", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2HuggingFace" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-hugging-face.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/keycloak": { + "patch": { + "summary": "Update project OAuth2 Keycloak", + "operationId": "projectUpdateOAuth2Keycloak", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Keycloak configuration.", + "responses": { + "200": { + "description": "OAuth2Keycloak", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Keycloak" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-keycloak.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "endpoint": { + "description": "Domain of Keycloak instance. For example: keycloak.example.com", + "type": "string", + "example": "<ENDPOINT>", + "nullable": true + }, + "realmName": { + "description": "Keycloak realm name. For example: appwrite-realm", + "type": "string", + "example": "<REALM_NAME>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/kick": { + "patch": { + "summary": "Update project OAuth2 Kick", + "operationId": "projectUpdateOAuth2Kick", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Kick configuration.", + "responses": { + "200": { + "description": "OAuth2Kick", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Kick" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-kick.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/linkedin": { + "patch": { + "summary": "Update project OAuth2 Linkedin", + "operationId": "projectUpdateOAuth2Linkedin", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Linkedin configuration.", + "responses": { + "200": { + "description": "OAuth2Linkedin", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Linkedin" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-linkedin.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "primaryClientSecret": { + "description": "'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000.\/HtlYw==", + "type": "string", + "example": "<PRIMARY_CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/microsoft": { + "patch": { + "summary": "Update project OAuth2 Microsoft", + "operationId": "projectUpdateOAuth2Microsoft", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Microsoft configuration.", + "responses": { + "200": { + "description": "OAuth2Microsoft", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Microsoft" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-microsoft.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "applicationId": { + "description": "'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444", + "type": "string", + "example": "<APPLICATION_ID>", + "nullable": true + }, + "applicationSecret": { + "description": "'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", + "type": "string", + "example": "<APPLICATION_SECRET>", + "nullable": true + }, + "tenant": { + "description": "Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common", + "type": "string", + "example": "<TENANT>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/notion": { + "patch": { + "summary": "Update project OAuth2 Notion", + "operationId": "projectUpdateOAuth2Notion", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Notion configuration.", + "responses": { + "200": { + "description": "OAuth2Notion", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Notion" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-notion.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "oauthClientId": { + "description": "'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3", + "type": "string", + "example": "<OAUTH_CLIENT_ID>", + "nullable": true + }, + "oauthClientSecret": { + "description": "'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9", + "type": "string", + "example": "<OAUTH_CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/oidc": { + "patch": { + "summary": "Update project OAuth2 Oidc", + "operationId": "projectUpdateOAuth2Oidc", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Oidc configuration.", + "responses": { + "200": { + "description": "OAuth2Oidc", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Oidc" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-oidc.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "wellKnownURL": { + "description": "OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https:\/\/myoauth.com\/.well-known\/openid-configuration", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "authorizationURL": { + "description": "OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https:\/\/myoauth.com\/oauth2\/authorize", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "tokenURL": { + "description": "OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https:\/\/myoauth.com\/oauth2\/token", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "userInfoURL": { + "description": "OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https:\/\/myoauth.com\/oauth2\/userinfo", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "prompt": { + "description": "Array of OpenID Connect prompt values controlling the authentication and consent screens. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. \"login\" means: prompt the user to re-authenticate. \"consent\" means: prompt the user for consent. \"select_account\" means: prompt the user to select an account.", + "type": "array", + "items": { + "title": "ProjectOAuth2OidcPrompt", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "login" + ], + "title": "login" + }, + { + "type": "string", + "enum": [ + "consent" + ], + "title": "consent" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "nullable": true + }, + "maxAge": { + "description": "Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate.", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/okta": { + "patch": { + "summary": "Update project OAuth2 Okta", + "operationId": "projectUpdateOAuth2Okta", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Okta configuration.", + "responses": { + "200": { + "description": "OAuth2Okta", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Okta" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-okta.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "domain": { + "description": "Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https:\/\/trial-6400025.okta.com\/", + "type": "string", + "example": "example.com", + "nullable": true + }, + "authorizationServerId": { + "description": "Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z", + "type": "string", + "example": "<AUTHORIZATION_SERVER_ID>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/paypal": { + "patch": { + "summary": "Update project OAuth2 Paypal", + "operationId": "projectUpdateOAuth2Paypal", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Paypal configuration.", + "responses": { + "200": { + "description": "OAuth2Paypal", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Paypal" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-paypal.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "secretKey": { + "description": "'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp", + "type": "string", + "example": "<SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/paypalSandbox": { + "patch": { + "summary": "Update project OAuth2 PaypalSandbox", + "operationId": "projectUpdateOAuth2PaypalSandbox", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 PaypalSandbox configuration.", + "responses": { + "200": { + "description": "OAuth2Paypal", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Paypal" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-paypal-sandbox.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "secretKey": { + "description": "'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp", + "type": "string", + "example": "<SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/podio": { + "patch": { + "summary": "Update project OAuth2 Podio", + "operationId": "projectUpdateOAuth2Podio", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Podio configuration.", + "responses": { + "200": { + "description": "OAuth2Podio", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Podio" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-podio.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/resend": { + "patch": { + "summary": "Update project OAuth2 Resend", + "operationId": "projectUpdateOAuth2Resend", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Resend configuration.", + "responses": { + "200": { + "description": "OAuth2Resend", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Resend" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-resend.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Resend OAuth2 app. For example: f47ac10b-58cc-4372-a567-0e02b2c3d479", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Resend OAuth2 app. For example: 9c1e4b00000000000000000000000000000000000000000000000000a72d5f4", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/salesforce": { + "patch": { + "summary": "Update project OAuth2 Salesforce", + "operationId": "projectUpdateOAuth2Salesforce", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Salesforce configuration.", + "responses": { + "200": { + "description": "OAuth2Salesforce", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Salesforce" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-salesforce.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "customerKey": { + "description": "'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq", + "type": "string", + "example": "<CUSTOMER_KEY>", + "nullable": true + }, + "customerSecret": { + "description": "'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2", + "type": "string", + "example": "<CUSTOMER_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/slack": { + "patch": { + "summary": "Update project OAuth2 Slack", + "operationId": "projectUpdateOAuth2Slack", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Slack configuration.", + "responses": { + "200": { + "description": "OAuth2Slack", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Slack" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-slack.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/spotify": { + "patch": { + "summary": "Update project OAuth2 Spotify", + "operationId": "projectUpdateOAuth2Spotify", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Spotify configuration.", + "responses": { + "200": { + "description": "OAuth2Spotify", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Spotify" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-spotify.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/stripe": { + "patch": { + "summary": "Update project OAuth2 Stripe", + "operationId": "projectUpdateOAuth2Stripe", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Stripe configuration.", + "responses": { + "200": { + "description": "OAuth2Stripe", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Stripe" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-stripe.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "apiSecretKey": { + "description": "'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp", + "type": "string", + "example": "<API_SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/tradeshift": { + "patch": { + "summary": "Update project OAuth2 Tradeshift", + "operationId": "projectUpdateOAuth2Tradeshift", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Tradeshift configuration.", + "responses": { + "200": { + "description": "OAuth2Tradeshift", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Tradeshift" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-tradeshift.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "oauth2ClientId": { + "description": "'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app", + "type": "string", + "example": "<OAUTH2_CLIENT_ID>", + "nullable": true + }, + "oauth2ClientSecret": { + "description": "'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83", + "type": "string", + "example": "<OAUTH2_CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/tradeshiftBox": { + "patch": { + "summary": "Update project OAuth2 Tradeshift Sandbox", + "operationId": "projectUpdateOAuth2TradeshiftSandbox", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Tradeshift Sandbox configuration.", + "responses": { + "200": { + "description": "OAuth2Tradeshift", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Tradeshift" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-tradeshift-sandbox.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "oauth2ClientId": { + "description": "'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app", + "type": "string", + "example": "<OAUTH2_CLIENT_ID>", + "nullable": true + }, + "oauth2ClientSecret": { + "description": "'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83", + "type": "string", + "example": "<OAUTH2_CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/twitch": { + "patch": { + "summary": "Update project OAuth2 Twitch", + "operationId": "projectUpdateOAuth2Twitch", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Twitch configuration.", + "responses": { + "200": { + "description": "OAuth2Twitch", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Twitch" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-twitch.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/wordpress": { + "patch": { + "summary": "Update project OAuth2 WordPress", + "operationId": "projectUpdateOAuth2WordPress", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 WordPress configuration.", + "responses": { + "200": { + "description": "OAuth2WordPress", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2WordPress" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-word-press.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of WordPress OAuth2 app. For example: 130005", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/x": { + "patch": { + "summary": "Update project OAuth2 X", + "operationId": "projectUpdateOAuth2X", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 X configuration.", + "responses": { + "200": { + "description": "OAuth2X", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2X" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2x.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "customerKey": { + "description": "'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT", + "type": "string", + "example": "<CUSTOMER_KEY>", + "nullable": true + }, + "secretKey": { + "description": "'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9", + "type": "string", + "example": "<SECRET_KEY>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/yahoo": { + "patch": { + "summary": "Update project OAuth2 Yahoo", + "operationId": "projectUpdateOAuth2Yahoo", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Yahoo configuration.", + "responses": { + "200": { + "description": "OAuth2Yahoo", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Yahoo" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-yahoo.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/yandex": { + "patch": { + "summary": "Update project OAuth2 Yandex", + "operationId": "projectUpdateOAuth2Yandex", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Yandex configuration.", + "responses": { + "200": { + "description": "OAuth2Yandex", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Yandex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-yandex.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/zoho": { + "patch": { + "summary": "Update project OAuth2 Zoho", + "operationId": "projectUpdateOAuth2Zoho", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Zoho configuration.", + "responses": { + "200": { + "description": "OAuth2Zoho", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Zoho" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-zoho.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/zoom": { + "patch": { + "summary": "Update project OAuth2 Zoom", + "operationId": "projectUpdateOAuth2Zoom", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Zoom configuration.", + "responses": { + "200": { + "description": "OAuth2Zoom", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Zoom" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-zoom.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ", + "type": "string", + "example": "<CLIENT_ID>", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON", + "type": "string", + "example": "<CLIENT_SECRET>", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/{providerId}": { + "get": { + "summary": "Get project OAuth2 provider", + "operationId": "projectGetOAuth2Provider", + "tags": [ + "project" + ], + "description": "Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key\/team IDs) are write-only and always returned empty.", + "responses": { + "200": { + "description": "OAuth2GitHub, or OAuth2Discord, or OAuth2Figma, or OAuth2Dropbox, or OAuth2Dailymotion, or OAuth2Bitbucket, or OAuth2Bitly, or OAuth2Box, or OAuth2Autodesk, or OAuth2Google, or OAuth2Zoom, or OAuth2Zoho, or OAuth2Yandex, or OAuth2X, or OAuth2WordPress, or OAuth2Twitch, or OAuth2Stripe, or OAuth2Spotify, or OAuth2Slack, or OAuth2Podio, or OAuth2Notion, or OAuth2Salesforce, or OAuth2Yahoo, or OAuth2HuggingFace, or OAuth2Resend, or OAuth2Cloudflare, or OAuth2Linkedin, or OAuth2Disqus, or OAuth2Amazon, or OAuth2Etsy, or OAuth2Facebook, or OAuth2Tradeshift, or OAuth2Paypal, or OAuth2Gitlab, or OAuth2Authentik, or OAuth2Auth0, or OAuth2FusionAuth, or OAuth2Keycloak, or OAuth2Oidc, or OAuth2Apple, or OAuth2Okta, or OAuth2Kick, or OAuth2Microsoft", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/oAuth2Github" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Discord" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Figma" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Dropbox" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Dailymotion" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Bitbucket" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Bitly" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Box" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Autodesk" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Google" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Zoom" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Zoho" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Yandex" + }, + { + "$ref": "#\/components\/schemas\/oAuth2X" + }, + { + "$ref": "#\/components\/schemas\/oAuth2WordPress" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Twitch" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Stripe" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Spotify" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Slack" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Podio" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Notion" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Salesforce" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Yahoo" + }, + { + "$ref": "#\/components\/schemas\/oAuth2HuggingFace" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Resend" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Cloudflare" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Linkedin" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Disqus" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Amazon" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Etsy" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Facebook" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Tradeshift" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Paypal" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Gitlab" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Authentik" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Auth0" + }, + { + "$ref": "#\/components\/schemas\/oAuth2FusionAuth" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Keycloak" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Oidc" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Apple" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Okta" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Kick" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Microsoft" + } + ], + "discriminator": { + "propertyName": "$id", + "mapping": { + "github": "#\/components\/schemas\/oAuth2Github", + "discord": "#\/components\/schemas\/oAuth2Discord", + "figma": "#\/components\/schemas\/oAuth2Figma", + "dropbox": "#\/components\/schemas\/oAuth2Dropbox", + "dailymotion": "#\/components\/schemas\/oAuth2Dailymotion", + "bitbucket": "#\/components\/schemas\/oAuth2Bitbucket", + "bitly": "#\/components\/schemas\/oAuth2Bitly", + "box": "#\/components\/schemas\/oAuth2Box", + "autodesk": "#\/components\/schemas\/oAuth2Autodesk", + "google": "#\/components\/schemas\/oAuth2Google", + "zoom": "#\/components\/schemas\/oAuth2Zoom", + "zoho": "#\/components\/schemas\/oAuth2Zoho", + "yandex": "#\/components\/schemas\/oAuth2Yandex", + "x": "#\/components\/schemas\/oAuth2X", + "wordpress": "#\/components\/schemas\/oAuth2WordPress", + "twitch": "#\/components\/schemas\/oAuth2Twitch", + "stripe": "#\/components\/schemas\/oAuth2Stripe", + "spotify": "#\/components\/schemas\/oAuth2Spotify", + "slack": "#\/components\/schemas\/oAuth2Slack", + "podio": "#\/components\/schemas\/oAuth2Podio", + "notion": "#\/components\/schemas\/oAuth2Notion", + "salesforce": "#\/components\/schemas\/oAuth2Salesforce", + "yahoo": "#\/components\/schemas\/oAuth2Yahoo", + "huggingface": "#\/components\/schemas\/oAuth2HuggingFace", + "resend": "#\/components\/schemas\/oAuth2Resend", + "cloudflare": "#\/components\/schemas\/oAuth2Cloudflare", + "linkedin": "#\/components\/schemas\/oAuth2Linkedin", + "disqus": "#\/components\/schemas\/oAuth2Disqus", + "amazon": "#\/components\/schemas\/oAuth2Amazon", + "etsy": "#\/components\/schemas\/oAuth2Etsy", + "facebook": "#\/components\/schemas\/oAuth2Facebook", + "tradeshift": "#\/components\/schemas\/oAuth2Tradeshift", + "tradeshiftBox": "#\/components\/schemas\/oAuth2Tradeshift", + "paypal": "#\/components\/schemas\/oAuth2Paypal", + "paypalSandbox": "#\/components\/schemas\/oAuth2Paypal", + "gitlab": "#\/components\/schemas\/oAuth2Gitlab", + "authentik": "#\/components\/schemas\/oAuth2Authentik", + "auth0": "#\/components\/schemas\/oAuth2Auth0", + "fusionauth": "#\/components\/schemas\/oAuth2FusionAuth", + "keycloak": "#\/components\/schemas\/oAuth2Keycloak", + "oidc": "#\/components\/schemas\/oAuth2Oidc", + "apple": "#\/components\/schemas\/oAuth2Apple", + "okta": "#\/components\/schemas\/oAuth2Okta", + "kick": "#\/components\/schemas\/oAuth2Kick", + "microsoft": "#\/components\/schemas\/oAuth2Microsoft" + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/get-o-auth-2-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "OAuth2 provider key. For example: github, google, apple.", + "required": true, + "schema": { + "type": "string", + "example": "amazon", + "title": "ProjectOAuthProviderId", + "oneOf": [ + { + "type": "string", + "enum": [ + "amazon" + ], + "title": "amazon" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "appwrite" + ], + "title": "appwrite" + }, + { + "type": "string", + "enum": [ + "auth0" + ], + "title": "auth0" + }, + { + "type": "string", + "enum": [ + "authentik" + ], + "title": "authentik" + }, + { + "type": "string", + "enum": [ + "autodesk" + ], + "title": "autodesk" + }, + { + "type": "string", + "enum": [ + "bitbucket" + ], + "title": "bitbucket" + }, + { + "type": "string", + "enum": [ + "bitly" + ], + "title": "bitly" + }, + { + "type": "string", + "enum": [ + "box" + ], + "title": "box" + }, + { + "type": "string", + "enum": [ + "cloudflare" + ], + "title": "cloudflare" + }, + { + "type": "string", + "enum": [ + "dailymotion" + ], + "title": "dailymotion" + }, + { + "type": "string", + "enum": [ + "discord" + ], + "title": "discord" + }, + { + "type": "string", + "enum": [ + "disqus" + ], + "title": "disqus" + }, + { + "type": "string", + "enum": [ + "dropbox" + ], + "title": "dropbox" + }, + { + "type": "string", + "enum": [ + "etsy" + ], + "title": "etsy" + }, + { + "type": "string", + "enum": [ + "facebook" + ], + "title": "facebook" + }, + { + "type": "string", + "enum": [ + "figma" + ], + "title": "figma" + }, + { + "type": "string", + "enum": [ + "fusionauth" + ], + "title": "fusionauth" + }, + { + "type": "string", + "enum": [ + "github" + ], + "title": "github" + }, + { + "type": "string", + "enum": [ + "gitlab" + ], + "title": "gitlab" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + }, + { + "type": "string", + "enum": [ + "huggingface" + ], + "title": "huggingface" + }, + { + "type": "string", + "enum": [ + "keycloak" + ], + "title": "keycloak" + }, + { + "type": "string", + "enum": [ + "kick" + ], + "title": "kick" + }, + { + "type": "string", + "enum": [ + "linkedin" + ], + "title": "linkedin" + }, + { + "type": "string", + "enum": [ + "microsoft" + ], + "title": "microsoft" + }, + { + "type": "string", + "enum": [ + "notion" + ], + "title": "notion" + }, + { + "type": "string", + "enum": [ + "oidc" + ], + "title": "oidc" + }, + { + "type": "string", + "enum": [ + "okta" + ], + "title": "okta" + }, + { + "type": "string", + "enum": [ + "paypal" + ], + "title": "paypal" + }, + { + "type": "string", + "enum": [ + "paypalSandbox" + ], + "title": "paypalSandbox" + }, + { + "type": "string", + "enum": [ + "podio" + ], + "title": "podio" + }, + { + "type": "string", + "enum": [ + "resend" + ], + "title": "resend" + }, + { + "type": "string", + "enum": [ + "salesforce" + ], + "title": "salesforce" + }, + { + "type": "string", + "enum": [ + "slack" + ], + "title": "slack" + }, + { + "type": "string", + "enum": [ + "spotify" + ], + "title": "spotify" + }, + { + "type": "string", + "enum": [ + "stripe" + ], + "title": "stripe" + }, + { + "type": "string", + "enum": [ + "tradeshift" + ], + "title": "tradeshift" + }, + { + "type": "string", + "enum": [ + "tradeshiftBox" + ], + "title": "tradeshiftBox" + }, + { + "type": "string", + "enum": [ + "twitch" + ], + "title": "twitch" + }, + { + "type": "string", + "enum": [ + "wordpress" + ], + "title": "wordpress" + }, + { + "type": "string", + "enum": [ + "x" + ], + "title": "x" + }, + { + "type": "string", + "enum": [ + "yahoo" + ], + "title": "yahoo" + }, + { + "type": "string", + "enum": [ + "yammer" + ], + "title": "yammer" + }, + { + "type": "string", + "enum": [ + "yandex" + ], + "title": "yandex" + }, + { + "type": "string", + "enum": [ + "zoho" + ], + "title": "zoho" + }, + { + "type": "string", + "enum": [ + "zoom" + ], + "title": "zoom" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/project\/platforms": { + "get": { + "summary": "List project platforms", + "operationId": "projectListPlatforms", + "tags": [ + "project" + ], + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations.", + "responses": { + "200": { + "description": "Platforms List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/list-platforms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/project\/platforms\/android": { + "post": { + "summary": "Create project Android platform", + "operationId": "projectCreateAndroidPlatform", + "tags": [ + "project" + ], + "description": "Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Android", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformAndroid" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-android-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "applicationId": { + "description": "Android application ID. Max length: 256 chars.", + "type": "string", + "example": "<APPLICATION_ID>" + } + }, + "required": [ + "platformId", + "name", + "applicationId" + ] + } + } + } + } + } + }, + "\/project\/platforms\/android\/{platformId}": { + "put": { + "summary": "Update project Android platform", + "operationId": "projectUpdateAndroidPlatform", + "tags": [ + "project" + ], + "description": "Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID.", + "responses": { + "200": { + "description": "Platform Android", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformAndroid" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-android-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "applicationId": { + "description": "Android application ID. Max length: 256 chars.", + "type": "string", + "example": "<APPLICATION_ID>" + } + }, + "required": [ + "name", + "applicationId" + ] + } + } + } + } + } + }, + "\/project\/platforms\/apple": { + "post": { + "summary": "Create project Apple platform", + "operationId": "projectCreateApplePlatform", + "tags": [ + "project" + ], + "description": "Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Apple", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformApple" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-apple-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "bundleIdentifier": { + "description": "Apple bundle identifier. Max length: 256 chars.", + "type": "string", + "example": "<BUNDLE_IDENTIFIER>" + } + }, + "required": [ + "platformId", + "name", + "bundleIdentifier" + ] + } + } + } + } + } + }, + "\/project\/platforms\/apple\/{platformId}": { + "put": { + "summary": "Update project Apple platform", + "operationId": "projectUpdateApplePlatform", + "tags": [ + "project" + ], + "description": "Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier.", + "responses": { + "200": { + "description": "Platform Apple", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformApple" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-apple-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "bundleIdentifier": { + "description": "Apple bundle identifier. Max length: 256 chars.", + "type": "string", + "example": "<BUNDLE_IDENTIFIER>" + } + }, + "required": [ + "name", + "bundleIdentifier" + ] + } + } + } + } + } + }, + "\/project\/platforms\/linux": { + "post": { + "summary": "Create project Linux platform", + "operationId": "projectCreateLinuxPlatform", + "tags": [ + "project" + ], + "description": "Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Linux", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformLinux" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-linux-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "packageName": { + "description": "Linux package name. Max length: 256 chars.", + "type": "string", + "example": "<PACKAGE_NAME>" + } + }, + "required": [ + "platformId", + "name", + "packageName" + ] + } + } + } + } + } + }, + "\/project\/platforms\/linux\/{platformId}": { + "put": { + "summary": "Update project Linux platform", + "operationId": "projectUpdateLinuxPlatform", + "tags": [ + "project" + ], + "description": "Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name.", + "responses": { + "200": { + "description": "Platform Linux", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformLinux" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-linux-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "packageName": { + "description": "Linux package name. Max length: 256 chars.", + "type": "string", + "example": "<PACKAGE_NAME>" + } + }, + "required": [ + "name", + "packageName" + ] + } + } + } + } + } + }, + "\/project\/platforms\/web": { + "post": { + "summary": "Create project web platform", + "operationId": "projectCreateWebPlatform", + "tags": [ + "project" + ], + "description": "Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Web", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformWeb" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-web-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "hostname": { + "description": "Platform web hostname. Max length: 256 chars.", + "type": "string", + "example": "app.example.com" + } + }, + "required": [ + "platformId", + "name", + "hostname" + ] + } + } + } + } + } + }, + "\/project\/platforms\/web\/{platformId}": { + "put": { + "summary": "Update project web platform", + "operationId": "projectUpdateWebPlatform", + "tags": [ + "project" + ], + "description": "Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname.", + "responses": { + "200": { + "description": "Platform Web", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformWeb" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-web-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "hostname": { + "description": "Platform web hostname. Max length: 256 chars.", + "type": "string", + "example": "app.example.com" + } + }, + "required": [ + "name", + "hostname" + ] + } + } + } + } + } + }, + "\/project\/platforms\/windows": { + "post": { + "summary": "Create project Windows platform", + "operationId": "projectCreateWindowsPlatform", + "tags": [ + "project" + ], + "description": "Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform Windows", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformWindows" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/create-windows-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "platformId": { + "description": "Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<PLATFORM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "packageIdentifierName": { + "description": "Windows package identifier name. Max length: 256 chars.", + "type": "string", + "example": "<PACKAGE_IDENTIFIER_NAME>" + } + }, + "required": [ + "platformId", + "name", + "packageIdentifierName" + ] + } + } + } + } + } + }, + "\/project\/platforms\/windows\/{platformId}": { + "put": { + "summary": "Update project Windows platform", + "operationId": "projectUpdateWindowsPlatform", + "tags": [ + "project" + ], + "description": "Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name.", + "responses": { + "200": { + "description": "Platform Windows", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformWindows" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/update-windows-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Platform name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "packageIdentifierName": { + "description": "Windows package identifier name. Max length: 256 chars.", + "type": "string", + "example": "<PACKAGE_IDENTIFIER_NAME>" + } + }, + "required": [ + "name", + "packageIdentifierName" + ] + } + } + } + } + } + }, + "\/project\/platforms\/{platformId}": { + "get": { + "summary": "Get project platform", + "operationId": "projectGetPlatform", + "tags": [ + "project" + ], + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations.", + "responses": { + "200": { + "description": "Platform Web, or Platform Apple, or Platform Android, or Platform Windows, or Platform Linux", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/platformWeb" + }, + { + "$ref": "#\/components\/schemas\/platformApple" + }, + { + "$ref": "#\/components\/schemas\/platformAndroid" + }, + { + "$ref": "#\/components\/schemas\/platformWindows" + }, + { + "$ref": "#\/components\/schemas\/platformLinux" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "web": "#\/components\/schemas\/platformWeb", + "apple": "#\/components\/schemas\/platformApple", + "android": "#\/components\/schemas\/platformAndroid", + "windows": "#\/components\/schemas\/platformWindows", + "linux": "#\/components\/schemas\/platformLinux" + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/get-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete project platform", + "operationId": "projectDeletePlatform", + "tags": [ + "project" + ], + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "platforms", + "demo": "project\/delete-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "platformId", + "description": "Platform ID.", + "required": true, + "schema": { + "type": "string", + "example": "<PLATFORM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/project\/policies": { + "get": { + "summary": "List project policies", + "operationId": "projectListPolicies", + "tags": [ + "project" + ], + "description": "Get a list of all project policies and their current configuration.", + "responses": { + "200": { + "description": "Policies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/policyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/list-policies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.read", + "project.policies.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/project\/policies\/membership-privacy": { + "patch": { + "summary": "Update membership privacy policy", + "operationId": "projectUpdateMembershipPrivacyPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members..", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-membership-privacy-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "Set to true if you want make user ID visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userEmail": { + "description": "Set to true if you want make user email visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userPhone": { + "description": "Set to true if you want make user phone number visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userName": { + "description": "Set to true if you want make user name visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userMFA": { + "description": "Set to true if you want make user MFA status visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + }, + "userAccessedAt": { + "description": "Set to true if you want make user last access time visible to all team members, or false to hide it.", + "type": "boolean", + "example": false + } + } + } + } + } + } + } + }, + "\/project\/policies\/mfa-factors": { + "patch": { + "summary": "Update MFA factors policy", + "operationId": "projectUpdateMFAFactorsPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control which factors users can use to complete an MFA challenge. Disabled factors cannot be used to create a challenge and are reported as unavailable when listing factors. The custom factor is disabled by default; enable it to deliver challenge codes through your own channel. Recovery codes always remain available as a fallback.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-mfa-factors-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "totp": { + "description": "Set to true to allow TOTP to complete an MFA challenge, or false to disable it.", + "type": "boolean", + "example": false + }, + "email": { + "description": "Set to true to allow email to complete an MFA challenge, or false to disable it.", + "type": "boolean", + "example": false + }, + "phone": { + "description": "Set to true to allow phone (SMS) to complete an MFA challenge, or false to disable it.", + "type": "boolean", + "example": false + }, + "custom": { + "description": "Set to true to allow the custom factor to complete an MFA challenge, or false to disable it.", + "type": "boolean", + "example": false + } + } + } + } + } + } + } + }, + "\/project\/policies\/password-dictionary": { + "patch": { + "summary": "Update password dictionary policy", + "operationId": "projectUpdatePasswordDictionaryPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-dictionary-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/policies\/password-history": { + "patch": { + "summary": "Update password history policy", + "operationId": "projectUpdatePasswordHistoryPolicy", + "tags": [ + "project" + ], + "description": "Updates one of password strength policies. Based on total length configured, previous password hashes are stored, and users cannot choose a new password that is already stored in the passwird history list, when updating an user password, or setting new one through password recovery.\n\nKeep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-history-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "total": { + "description": "Set the password history length per user. Value can be between 1 and 20, or null to disable the limit.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + } + }, + "required": [ + "total" + ] + } + } + } + } + } + }, + "\/project\/policies\/password-personal-data": { + "patch": { + "summary": "Update password personal data policy", + "operationId": "projectUpdatePasswordPersonalDataPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-personal-data-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/policies\/password-strength": { + "patch": { + "summary": "Update password strength policy", + "operationId": "projectUpdatePasswordStrengthPolicy", + "tags": [ + "project" + ], + "description": "Update the password strength requirements for users in the project.", + "responses": { + "200": { + "description": "Policy Password Strength", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/policyPasswordStrength" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-strength-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "min": { + "description": "Minimum password length. Value must be between 8 and 256. Default is 8.", + "type": "integer", + "example": 8, + "format": "int32" + }, + "uppercase": { + "description": "Whether passwords must include at least one uppercase letter.", + "type": "boolean", + "example": false + }, + "lowercase": { + "description": "Whether passwords must include at least one lowercase letter.", + "type": "boolean", + "example": false + }, + "number": { + "description": "Whether passwords must include at least one number.", + "type": "boolean", + "example": false + }, + "symbols": { + "description": "Whether passwords must include at least one symbol.", + "type": "boolean", + "example": false + } + } + } + } + } + } + } + }, + "\/project\/policies\/session-alert": { + "patch": { + "summary": "Update session alert policy", + "operationId": "projectUpdateSessionAlertPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if email alert is sent upon session creation. When enabled, and user signs into their account, they will be sent an email notification. There is an exception, the first session after a new sign up does not trigger an alert, even if the policy is enabled.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-session-alert-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle session alert policy. Set to true if you want users to receive email notifications when a sessions are created for their users, or false to not send email alerts.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/policies\/session-duration": { + "patch": { + "summary": "Update session duration policy", + "operationId": "projectUpdateSessionDurationPolicy", + "tags": [ + "project" + ], + "description": "Update maximum duration how long sessions created within a project should stay active for.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-session-duration-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "duration": { + "description": "Maximum session length in seconds. Minium allowed value is 60 seconds, and maximum is 1 year, which is 31536000 seconds.", + "type": "integer", + "example": 60, + "format": "int32" + } + }, + "required": [ + "duration" + ] + } + } + } + } + } + }, + "\/project\/policies\/session-invalidation": { + "patch": { + "summary": "Update session invalidation policy", + "operationId": "projectUpdateSessionInvalidationPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if existing sessions should be invalidated when a password of a user is changed. When enabled, and user changes their password, they will be logged out of all their devices.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-session-invalidation-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle session invalidation policy. Set to true if you want password change to invalidate all sessions of an user, or false to keep sessions active.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/policies\/session-limit": { + "patch": { + "summary": "Update session limit policy", + "operationId": "projectUpdateSessionLimitPolicy", + "tags": [ + "project" + ], + "description": "Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-session-limit-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "total": { + "description": "Set the maximum number of sessions allowed per user. Value can be between 1 and 100.", + "type": "integer", + "example": 1, + "format": "int32" + } + }, + "required": [ + "total" + ] + } + } + } + } + } + }, + "\/project\/policies\/user-limit": { + "patch": { + "summary": "Update user limit policy", + "operationId": "projectUpdateUserLimitPolicy", + "tags": [ + "project" + ], + "description": "Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-user-limit-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "total": { + "description": "Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit.", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + } + }, + "required": [ + "total" + ] + } + } + } + } + } + }, + "\/project\/policies\/{policyId}": { + "get": { + "summary": "Get project policy", + "operationId": "projectGetPolicy", + "tags": [ + "project" + ], + "description": "Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy.", + "responses": { + "200": { + "description": "Policy Password Dictionary, or Policy Password History, or Policy Password Strength, or Policy Password Personal Data, or Policy Session Alert, or Policy Session Duration, or Policy Session Invalidation, or Policy Session Limit, or Policy User Limit, or Policy Membership Privacy, or Policy MFA Factors", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/policyPasswordDictionary" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordHistory" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordStrength" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordPersonalData" + }, + { + "$ref": "#\/components\/schemas\/policySessionAlert" + }, + { + "$ref": "#\/components\/schemas\/policySessionDuration" + }, + { + "$ref": "#\/components\/schemas\/policySessionInvalidation" + }, + { + "$ref": "#\/components\/schemas\/policySessionLimit" + }, + { + "$ref": "#\/components\/schemas\/policyUserLimit" + }, + { + "$ref": "#\/components\/schemas\/policyMembershipPrivacy" + }, + { + "$ref": "#\/components\/schemas\/policyMfaFactors" + } + ], + "discriminator": { + "propertyName": "$id", + "mapping": { + "password-dictionary": "#\/components\/schemas\/policyPasswordDictionary", + "password-history": "#\/components\/schemas\/policyPasswordHistory", + "password-strength": "#\/components\/schemas\/policyPasswordStrength", + "password-personal-data": "#\/components\/schemas\/policyPasswordPersonalData", + "session-alert": "#\/components\/schemas\/policySessionAlert", + "session-duration": "#\/components\/schemas\/policySessionDuration", + "session-invalidation": "#\/components\/schemas\/policySessionInvalidation", + "session-limit": "#\/components\/schemas\/policySessionLimit", + "user-limit": "#\/components\/schemas\/policyUserLimit", + "membership-privacy": "#\/components\/schemas\/policyMembershipPrivacy", + "mfa-factors": "#\/components\/schemas\/policyMfaFactors" + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/get-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.read", + "project.policies.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "policyId", + "description": "Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors.", + "required": true, + "schema": { + "type": "string", + "example": "password-dictionary", + "title": "ProjectPolicyId", + "oneOf": [ + { + "type": "string", + "enum": [ + "password-dictionary" + ], + "title": "password-dictionary" + }, + { + "type": "string", + "enum": [ + "password-history" + ], + "title": "password-history" + }, + { + "type": "string", + "enum": [ + "password-strength" + ], + "title": "password-strength" + }, + { + "type": "string", + "enum": [ + "password-personal-data" + ], + "title": "password-personal-data" + }, + { + "type": "string", + "enum": [ + "session-alert" + ], + "title": "session-alert" + }, + { + "type": "string", + "enum": [ + "session-duration" + ], + "title": "session-duration" + }, + { + "type": "string", + "enum": [ + "session-invalidation" + ], + "title": "session-invalidation" + }, + { + "type": "string", + "enum": [ + "session-limit" + ], + "title": "session-limit" + }, + { + "type": "string", + "enum": [ + "user-limit" + ], + "title": "user-limit" + }, + { + "type": "string", + "enum": [ + "membership-privacy" + ], + "title": "membership-privacy" + }, + { + "type": "string", + "enum": [ + "mfa-factors" + ], + "title": "mfa-factors" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/project\/protocols\/{protocolId}": { + "patch": { + "summary": "Update project protocol", + "operationId": "projectUpdateProtocol", + "tags": [ + "project" + ], + "description": "Update properties of a specific protocol. Use this endpoint to enable or disable a protocol in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/update-protocol.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "protocolId", + "description": "Protocol name. Can be one of: rest, graphql, websocket", + "required": true, + "schema": { + "type": "string", + "example": "rest", + "title": "ProjectProtocolId", + "oneOf": [ + { + "type": "string", + "enum": [ + "rest" + ], + "title": "rest" + }, + { + "type": "string", + "enum": [ + "graphql" + ], + "title": "graphql" + }, + { + "type": "string", + "enum": [ + "websocket" + ], + "title": "websocket" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Protocol status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/services\/{serviceId}": { + "patch": { + "summary": "Update project service", + "operationId": "projectUpdateService", + "tags": [ + "project" + ], + "description": "Update properties of a specific service. Use this endpoint to enable or disable a service in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "project\/update-service.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "serviceId", + "description": "Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor", + "required": true, + "schema": { + "type": "string", + "example": "account", + "title": "ProjectServiceId", + "oneOf": [ + { + "type": "string", + "enum": [ + "account" + ], + "title": "account" + }, + { + "type": "string", + "enum": [ + "avatars" + ], + "title": "avatars" + }, + { + "type": "string", + "enum": [ + "databases" + ], + "title": "databases" + }, + { + "type": "string", + "enum": [ + "tablesdb" + ], + "title": "tablesdb" + }, + { + "type": "string", + "enum": [ + "locale" + ], + "title": "locale" + }, + { + "type": "string", + "enum": [ + "health" + ], + "title": "health" + }, + { + "type": "string", + "enum": [ + "project" + ], + "title": "project" + }, + { + "type": "string", + "enum": [ + "storage" + ], + "title": "storage" + }, + { + "type": "string", + "enum": [ + "teams" + ], + "title": "teams" + }, + { + "type": "string", + "enum": [ + "users" + ], + "title": "users" + }, + { + "type": "string", + "enum": [ + "vcs" + ], + "title": "vcs" + }, + { + "type": "string", + "enum": [ + "sites" + ], + "title": "sites" + }, + { + "type": "string", + "enum": [ + "functions" + ], + "title": "functions" + }, + { + "type": "string", + "enum": [ + "proxy" + ], + "title": "proxy" + }, + { + "type": "string", + "enum": [ + "graphql" + ], + "title": "graphql" + }, + { + "type": "string", + "enum": [ + "migrations" + ], + "title": "migrations" + }, + { + "type": "string", + "enum": [ + "messaging" + ], + "title": "messaging" + }, + { + "type": "string", + "enum": [ + "advisor" + ], + "title": "advisor" + } + ] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Service status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/project\/smtp": { + "patch": { + "summary": "Update project SMTP configuration", + "operationId": "projectUpdateSMTP", + "tags": [ + "project" + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "smtp", + "demo": "project\/update-smtp.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "host": { + "description": "SMTP server hostname (domain)", + "type": "string", + "example": "example.com", + "nullable": true + }, + "port": { + "description": "SMTP server port", + "type": "integer", + "example": 587, + "format": "int32", + "nullable": true + }, + "username": { + "description": "SMTP server username. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "<USERNAME>", + "nullable": true + }, + "password": { + "description": "SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only).", + "type": "string", + "example": "password", + "format": "password", + "nullable": true + }, + "senderEmail": { + "description": "Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "senderName": { + "description": "Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "<SENDER_NAME>", + "nullable": true + }, + "replyToEmail": { + "description": "Email used when user replies to the email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "replyToName": { + "description": "Name used when user replies to the email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "<REPLY_TO_NAME>", + "nullable": true + }, + "secure": { + "description": "Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption.", + "type": "string", + "example": "tls", + "title": "ProjectSMTPSecure", + "oneOf": [ + { + "type": "string", + "enum": [ + "tls" + ], + "title": "tls" + }, + { + "type": "string", + "enum": [ + "ssl" + ], + "title": "ssl" + } + ], + "nullable": true + }, + "enabled": { + "description": "Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/smtp\/tests": { + "post": { + "summary": "Create project SMTP test", + "operationId": "projectCreateSMTPTest", + "tags": [ + "project" + ], + "description": "Send a test email to verify SMTP configuration. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "smtp", + "demo": "project\/create-smtp-test.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emails": { + "description": "Array of emails to send test email to. Maximum of 10 emails are allowed.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "emails" + ] + } + } + } + } + } + }, + "\/project\/templates\/email": { + "get": { + "summary": "List project email templates", + "operationId": "projectListEmailTemplates", + "tags": [ + "project" + ], + "description": "Get a list of all custom email templates configured for the project. This endpoint returns an array of all configured email templates and their locales.", + "responses": { + "200": { + "description": "Email Templates List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplateList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "project\/list-email-templates.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "templates.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "patch": { + "summary": "Update project email template", + "operationId": "projectUpdateEmailTemplate", + "tags": [ + "project" + ], + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "project\/update-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "templates.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "templateId": { + "description": "Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession", + "type": "string", + "example": "verification", + "title": "ProjectEmailTemplateId", + "oneOf": [ + { + "type": "string", + "enum": [ + "verification" + ], + "title": "verification" + }, + { + "type": "string", + "enum": [ + "magicSession" + ], + "title": "magicSession" + }, + { + "type": "string", + "enum": [ + "recovery" + ], + "title": "recovery" + }, + { + "type": "string", + "enum": [ + "invitation" + ], + "title": "invitation" + }, + { + "type": "string", + "enum": [ + "mfaChallenge" + ], + "title": "mfaChallenge" + }, + { + "type": "string", + "enum": [ + "sessionAlert" + ], + "title": "sessionAlert" + }, + { + "type": "string", + "enum": [ + "otpSession" + ], + "title": "otpSession" + } + ] + }, + "locale": { + "description": "Custom email template locale. If left empty, the fallback locale (en) will be used.", + "type": "string", + "default": "", + "example": "af", + "title": "ProjectEmailTemplateLocale", + "oneOf": [ + { + "type": "string", + "enum": [ + "af" + ], + "title": "af" + }, + { + "type": "string", + "enum": [ + "ar-ae" + ], + "title": "ar-ae" + }, + { + "type": "string", + "enum": [ + "ar-bh" + ], + "title": "ar-bh" + }, + { + "type": "string", + "enum": [ + "ar-dz" + ], + "title": "ar-dz" + }, + { + "type": "string", + "enum": [ + "ar-eg" + ], + "title": "ar-eg" + }, + { + "type": "string", + "enum": [ + "ar-iq" + ], + "title": "ar-iq" + }, + { + "type": "string", + "enum": [ + "ar-jo" + ], + "title": "ar-jo" + }, + { + "type": "string", + "enum": [ + "ar-kw" + ], + "title": "ar-kw" + }, + { + "type": "string", + "enum": [ + "ar-lb" + ], + "title": "ar-lb" + }, + { + "type": "string", + "enum": [ + "ar-ly" + ], + "title": "ar-ly" + }, + { + "type": "string", + "enum": [ + "ar-ma" + ], + "title": "ar-ma" + }, + { + "type": "string", + "enum": [ + "ar-om" + ], + "title": "ar-om" + }, + { + "type": "string", + "enum": [ + "ar-qa" + ], + "title": "ar-qa" + }, + { + "type": "string", + "enum": [ + "ar-sa" + ], + "title": "ar-sa" + }, + { + "type": "string", + "enum": [ + "ar-sy" + ], + "title": "ar-sy" + }, + { + "type": "string", + "enum": [ + "ar-tn" + ], + "title": "ar-tn" + }, + { + "type": "string", + "enum": [ + "ar-ye" + ], + "title": "ar-ye" + }, + { + "type": "string", + "enum": [ + "as" + ], + "title": "as" + }, + { + "type": "string", + "enum": [ + "az" + ], + "title": "az" + }, + { + "type": "string", + "enum": [ + "be" + ], + "title": "be" + }, + { + "type": "string", + "enum": [ + "bg" + ], + "title": "bg" + }, + { + "type": "string", + "enum": [ + "bh" + ], + "title": "bh" + }, + { + "type": "string", + "enum": [ + "bn" + ], + "title": "bn" + }, + { + "type": "string", + "enum": [ + "bs" + ], + "title": "bs" + }, + { + "type": "string", + "enum": [ + "ca" + ], + "title": "ca" + }, + { + "type": "string", + "enum": [ + "cs" + ], + "title": "cs" + }, + { + "type": "string", + "enum": [ + "cy" + ], + "title": "cy" + }, + { + "type": "string", + "enum": [ + "da" + ], + "title": "da" + }, + { + "type": "string", + "enum": [ + "de" + ], + "title": "de" + }, + { + "type": "string", + "enum": [ + "de-at" + ], + "title": "de-at" + }, + { + "type": "string", + "enum": [ + "de-ch" + ], + "title": "de-ch" + }, + { + "type": "string", + "enum": [ + "de-li" + ], + "title": "de-li" + }, + { + "type": "string", + "enum": [ + "de-lu" + ], + "title": "de-lu" + }, + { + "type": "string", + "enum": [ + "el" + ], + "title": "el" + }, + { + "type": "string", + "enum": [ + "en" + ], + "title": "en" + }, + { + "type": "string", + "enum": [ + "en-au" + ], + "title": "en-au" + }, + { + "type": "string", + "enum": [ + "en-bz" + ], + "title": "en-bz" + }, + { + "type": "string", + "enum": [ + "en-ca" + ], + "title": "en-ca" + }, + { + "type": "string", + "enum": [ + "en-gb" + ], + "title": "en-gb" + }, + { + "type": "string", + "enum": [ + "en-ie" + ], + "title": "en-ie" + }, + { + "type": "string", + "enum": [ + "en-jm" + ], + "title": "en-jm" + }, + { + "type": "string", + "enum": [ + "en-nz" + ], + "title": "en-nz" + }, + { + "type": "string", + "enum": [ + "en-tt" + ], + "title": "en-tt" + }, + { + "type": "string", + "enum": [ + "en-us" + ], + "title": "en-us" + }, + { + "type": "string", + "enum": [ + "en-za" + ], + "title": "en-za" + }, + { + "type": "string", + "enum": [ + "eo" + ], + "title": "eo" + }, + { + "type": "string", + "enum": [ + "es" + ], + "title": "es" + }, + { + "type": "string", + "enum": [ + "es-ar" + ], + "title": "es-ar" + }, + { + "type": "string", + "enum": [ + "es-bo" + ], + "title": "es-bo" + }, + { + "type": "string", + "enum": [ + "es-cl" + ], + "title": "es-cl" + }, + { + "type": "string", + "enum": [ + "es-co" + ], + "title": "es-co" + }, + { + "type": "string", + "enum": [ + "es-cr" + ], + "title": "es-cr" + }, + { + "type": "string", + "enum": [ + "es-do" + ], + "title": "es-do" + }, + { + "type": "string", + "enum": [ + "es-ec" + ], + "title": "es-ec" + }, + { + "type": "string", + "enum": [ + "es-gt" + ], + "title": "es-gt" + }, + { + "type": "string", + "enum": [ + "es-hn" + ], + "title": "es-hn" + }, + { + "type": "string", + "enum": [ + "es-mx" + ], + "title": "es-mx" + }, + { + "type": "string", + "enum": [ + "es-ni" + ], + "title": "es-ni" + }, + { + "type": "string", + "enum": [ + "es-pa" + ], + "title": "es-pa" + }, + { + "type": "string", + "enum": [ + "es-pe" + ], + "title": "es-pe" + }, + { + "type": "string", + "enum": [ + "es-pr" + ], + "title": "es-pr" + }, + { + "type": "string", + "enum": [ + "es-py" + ], + "title": "es-py" + }, + { + "type": "string", + "enum": [ + "es-sv" + ], + "title": "es-sv" + }, + { + "type": "string", + "enum": [ + "es-uy" + ], + "title": "es-uy" + }, + { + "type": "string", + "enum": [ + "es-ve" + ], + "title": "es-ve" + }, + { + "type": "string", + "enum": [ + "et" + ], + "title": "et" + }, + { + "type": "string", + "enum": [ + "eu" + ], + "title": "eu" + }, + { + "type": "string", + "enum": [ + "fa" + ], + "title": "fa" + }, + { + "type": "string", + "enum": [ + "fi" + ], + "title": "fi" + }, + { + "type": "string", + "enum": [ + "fo" + ], + "title": "fo" + }, + { + "type": "string", + "enum": [ + "fr" + ], + "title": "fr" + }, + { + "type": "string", + "enum": [ + "fr-be" + ], + "title": "fr-be" + }, + { + "type": "string", + "enum": [ + "fr-ca" + ], + "title": "fr-ca" + }, + { + "type": "string", + "enum": [ + "fr-ch" + ], + "title": "fr-ch" + }, + { + "type": "string", + "enum": [ + "fr-lu" + ], + "title": "fr-lu" + }, + { + "type": "string", + "enum": [ + "ga" + ], + "title": "ga" + }, + { + "type": "string", + "enum": [ + "gd" + ], + "title": "gd" + }, + { + "type": "string", + "enum": [ + "he" + ], + "title": "he" + }, + { + "type": "string", + "enum": [ + "hi" + ], + "title": "hi" + }, + { + "type": "string", + "enum": [ + "hr" + ], + "title": "hr" + }, + { + "type": "string", + "enum": [ + "hu" + ], + "title": "hu" + }, + { + "type": "string", + "enum": [ + "id" + ], + "title": "id" + }, + { + "type": "string", + "enum": [ + "is" + ], + "title": "is" + }, + { + "type": "string", + "enum": [ + "it" + ], + "title": "it" + }, + { + "type": "string", + "enum": [ + "it-ch" + ], + "title": "it-ch" + }, + { + "type": "string", + "enum": [ + "ja" + ], + "title": "ja" + }, + { + "type": "string", + "enum": [ + "ji" + ], + "title": "ji" + }, + { + "type": "string", + "enum": [ + "ko" + ], + "title": "ko" + }, + { + "type": "string", + "enum": [ + "ku" + ], + "title": "ku" + }, + { + "type": "string", + "enum": [ + "lt" + ], + "title": "lt" + }, + { + "type": "string", + "enum": [ + "lv" + ], + "title": "lv" + }, + { + "type": "string", + "enum": [ + "mk" + ], + "title": "mk" + }, + { + "type": "string", + "enum": [ + "ml" + ], + "title": "ml" + }, + { + "type": "string", + "enum": [ + "ms" + ], + "title": "ms" + }, + { + "type": "string", + "enum": [ + "mt" + ], + "title": "mt" + }, + { + "type": "string", + "enum": [ + "nb" + ], + "title": "nb" + }, + { + "type": "string", + "enum": [ + "ne" + ], + "title": "ne" + }, + { + "type": "string", + "enum": [ + "nl" + ], + "title": "nl" + }, + { + "type": "string", + "enum": [ + "nl-be" + ], + "title": "nl-be" + }, + { + "type": "string", + "enum": [ + "nn" + ], + "title": "nn" + }, + { + "type": "string", + "enum": [ + "no" + ], + "title": "no" + }, + { + "type": "string", + "enum": [ + "pa" + ], + "title": "pa" + }, + { + "type": "string", + "enum": [ + "pl" + ], + "title": "pl" + }, + { + "type": "string", + "enum": [ + "pt" + ], + "title": "pt" + }, + { + "type": "string", + "enum": [ + "pt-br" + ], + "title": "pt-br" + }, + { + "type": "string", + "enum": [ + "rm" + ], + "title": "rm" + }, + { + "type": "string", + "enum": [ + "ro" + ], + "title": "ro" + }, + { + "type": "string", + "enum": [ + "ro-md" + ], + "title": "ro-md" + }, + { + "type": "string", + "enum": [ + "ru" + ], + "title": "ru" + }, + { + "type": "string", + "enum": [ + "ru-md" + ], + "title": "ru-md" + }, + { + "type": "string", + "enum": [ + "sb" + ], + "title": "sb" + }, + { + "type": "string", + "enum": [ + "sk" + ], + "title": "sk" + }, + { + "type": "string", + "enum": [ + "sl" + ], + "title": "sl" + }, + { + "type": "string", + "enum": [ + "sq" + ], + "title": "sq" + }, + { + "type": "string", + "enum": [ + "sr" + ], + "title": "sr" + }, + { + "type": "string", + "enum": [ + "sv" + ], + "title": "sv" + }, + { + "type": "string", + "enum": [ + "sv-fi" + ], + "title": "sv-fi" + }, + { + "type": "string", + "enum": [ + "th" + ], + "title": "th" + }, + { + "type": "string", + "enum": [ + "tn" + ], + "title": "tn" + }, + { + "type": "string", + "enum": [ + "tr" + ], + "title": "tr" + }, + { + "type": "string", + "enum": [ + "ts" + ], + "title": "ts" + }, + { + "type": "string", + "enum": [ + "ua" + ], + "title": "ua" + }, + { + "type": "string", + "enum": [ + "ur" + ], + "title": "ur" + }, + { + "type": "string", + "enum": [ + "ve" + ], + "title": "ve" + }, + { + "type": "string", + "enum": [ + "vi" + ], + "title": "vi" + }, + { + "type": "string", + "enum": [ + "xh" + ], + "title": "xh" + }, + { + "type": "string", + "enum": [ + "zh-cn" + ], + "title": "zh-cn" + }, + { + "type": "string", + "enum": [ + "zh-hk" + ], + "title": "zh-hk" + }, + { + "type": "string", + "enum": [ + "zh-sg" + ], + "title": "zh-sg" + }, + { + "type": "string", + "enum": [ + "zh-tw" + ], + "title": "zh-tw" + }, + { + "type": "string", + "enum": [ + "zu" + ], + "title": "zu" + } + ] + }, + "subject": { + "description": "Subject of the email template. Can be up to 255 characters.", + "type": "string", + "example": "<SUBJECT>", + "nullable": true + }, + "message": { + "description": "Plain or HTML body of the email template message. Can be up to 10MB of content.", + "type": "string", + "example": "<MESSAGE>", + "nullable": true + }, + "senderName": { + "description": "Name of the email sender.", + "type": "string", + "example": "<SENDER_NAME>", + "nullable": true + }, + "senderEmail": { + "description": "Email of the sender. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "replyToEmail": { + "description": "Reply to email. Pass an empty string to clear a previously set value.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "replyToName": { + "description": "Reply to name.", + "type": "string", + "example": "<REPLY_TO_NAME>", + "nullable": true + } + }, + "required": [ + "templateId" + ] + } + } + } + } + } + }, + "\/project\/templates\/email\/{templateId}": { + "get": { + "summary": "Get project email template", + "operationId": "projectGetEmailTemplate", + "tags": [ + "project" + ], + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details.", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "templates", + "demo": "project\/get-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "templates.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession", + "required": true, + "schema": { + "type": "string", + "example": "verification", + "title": "ProjectEmailTemplateId", + "oneOf": [ + { + "type": "string", + "enum": [ + "verification" + ], + "title": "verification" + }, + { + "type": "string", + "enum": [ + "magicSession" + ], + "title": "magicSession" + }, + { + "type": "string", + "enum": [ + "recovery" + ], + "title": "recovery" + }, + { + "type": "string", + "enum": [ + "invitation" + ], + "title": "invitation" + }, + { + "type": "string", + "enum": [ + "mfaChallenge" + ], + "title": "mfaChallenge" + }, + { + "type": "string", + "enum": [ + "sessionAlert" + ], + "title": "sessionAlert" + }, + { + "type": "string", + "enum": [ + "otpSession" + ], + "title": "otpSession" + } + ] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Custom email template locale. If left empty, the fallback locale (en) will be used.", + "required": false, + "schema": { + "type": "string", + "example": "af", + "title": "ProjectEmailTemplateLocale", + "oneOf": [ + { + "type": "string", + "enum": [ + "af" + ], + "title": "af" + }, + { + "type": "string", + "enum": [ + "ar-ae" + ], + "title": "ar-ae" + }, + { + "type": "string", + "enum": [ + "ar-bh" + ], + "title": "ar-bh" + }, + { + "type": "string", + "enum": [ + "ar-dz" + ], + "title": "ar-dz" + }, + { + "type": "string", + "enum": [ + "ar-eg" + ], + "title": "ar-eg" + }, + { + "type": "string", + "enum": [ + "ar-iq" + ], + "title": "ar-iq" + }, + { + "type": "string", + "enum": [ + "ar-jo" + ], + "title": "ar-jo" + }, + { + "type": "string", + "enum": [ + "ar-kw" + ], + "title": "ar-kw" + }, + { + "type": "string", + "enum": [ + "ar-lb" + ], + "title": "ar-lb" + }, + { + "type": "string", + "enum": [ + "ar-ly" + ], + "title": "ar-ly" + }, + { + "type": "string", + "enum": [ + "ar-ma" + ], + "title": "ar-ma" + }, + { + "type": "string", + "enum": [ + "ar-om" + ], + "title": "ar-om" + }, + { + "type": "string", + "enum": [ + "ar-qa" + ], + "title": "ar-qa" + }, + { + "type": "string", + "enum": [ + "ar-sa" + ], + "title": "ar-sa" + }, + { + "type": "string", + "enum": [ + "ar-sy" + ], + "title": "ar-sy" + }, + { + "type": "string", + "enum": [ + "ar-tn" + ], + "title": "ar-tn" + }, + { + "type": "string", + "enum": [ + "ar-ye" + ], + "title": "ar-ye" + }, + { + "type": "string", + "enum": [ + "as" + ], + "title": "as" + }, + { + "type": "string", + "enum": [ + "az" + ], + "title": "az" + }, + { + "type": "string", + "enum": [ + "be" + ], + "title": "be" + }, + { + "type": "string", + "enum": [ + "bg" + ], + "title": "bg" + }, + { + "type": "string", + "enum": [ + "bh" + ], + "title": "bh" + }, + { + "type": "string", + "enum": [ + "bn" + ], + "title": "bn" + }, + { + "type": "string", + "enum": [ + "bs" + ], + "title": "bs" + }, + { + "type": "string", + "enum": [ + "ca" + ], + "title": "ca" + }, + { + "type": "string", + "enum": [ + "cs" + ], + "title": "cs" + }, + { + "type": "string", + "enum": [ + "cy" + ], + "title": "cy" + }, + { + "type": "string", + "enum": [ + "da" + ], + "title": "da" + }, + { + "type": "string", + "enum": [ + "de" + ], + "title": "de" + }, + { + "type": "string", + "enum": [ + "de-at" + ], + "title": "de-at" + }, + { + "type": "string", + "enum": [ + "de-ch" + ], + "title": "de-ch" + }, + { + "type": "string", + "enum": [ + "de-li" + ], + "title": "de-li" + }, + { + "type": "string", + "enum": [ + "de-lu" + ], + "title": "de-lu" + }, + { + "type": "string", + "enum": [ + "el" + ], + "title": "el" + }, + { + "type": "string", + "enum": [ + "en" + ], + "title": "en" + }, + { + "type": "string", + "enum": [ + "en-au" + ], + "title": "en-au" + }, + { + "type": "string", + "enum": [ + "en-bz" + ], + "title": "en-bz" + }, + { + "type": "string", + "enum": [ + "en-ca" + ], + "title": "en-ca" + }, + { + "type": "string", + "enum": [ + "en-gb" + ], + "title": "en-gb" + }, + { + "type": "string", + "enum": [ + "en-ie" + ], + "title": "en-ie" + }, + { + "type": "string", + "enum": [ + "en-jm" + ], + "title": "en-jm" + }, + { + "type": "string", + "enum": [ + "en-nz" + ], + "title": "en-nz" + }, + { + "type": "string", + "enum": [ + "en-tt" + ], + "title": "en-tt" + }, + { + "type": "string", + "enum": [ + "en-us" + ], + "title": "en-us" + }, + { + "type": "string", + "enum": [ + "en-za" + ], + "title": "en-za" + }, + { + "type": "string", + "enum": [ + "eo" + ], + "title": "eo" + }, + { + "type": "string", + "enum": [ + "es" + ], + "title": "es" + }, + { + "type": "string", + "enum": [ + "es-ar" + ], + "title": "es-ar" + }, + { + "type": "string", + "enum": [ + "es-bo" + ], + "title": "es-bo" + }, + { + "type": "string", + "enum": [ + "es-cl" + ], + "title": "es-cl" + }, + { + "type": "string", + "enum": [ + "es-co" + ], + "title": "es-co" + }, + { + "type": "string", + "enum": [ + "es-cr" + ], + "title": "es-cr" + }, + { + "type": "string", + "enum": [ + "es-do" + ], + "title": "es-do" + }, + { + "type": "string", + "enum": [ + "es-ec" + ], + "title": "es-ec" + }, + { + "type": "string", + "enum": [ + "es-gt" + ], + "title": "es-gt" + }, + { + "type": "string", + "enum": [ + "es-hn" + ], + "title": "es-hn" + }, + { + "type": "string", + "enum": [ + "es-mx" + ], + "title": "es-mx" + }, + { + "type": "string", + "enum": [ + "es-ni" + ], + "title": "es-ni" + }, + { + "type": "string", + "enum": [ + "es-pa" + ], + "title": "es-pa" + }, + { + "type": "string", + "enum": [ + "es-pe" + ], + "title": "es-pe" + }, + { + "type": "string", + "enum": [ + "es-pr" + ], + "title": "es-pr" + }, + { + "type": "string", + "enum": [ + "es-py" + ], + "title": "es-py" + }, + { + "type": "string", + "enum": [ + "es-sv" + ], + "title": "es-sv" + }, + { + "type": "string", + "enum": [ + "es-uy" + ], + "title": "es-uy" + }, + { + "type": "string", + "enum": [ + "es-ve" + ], + "title": "es-ve" + }, + { + "type": "string", + "enum": [ + "et" + ], + "title": "et" + }, + { + "type": "string", + "enum": [ + "eu" + ], + "title": "eu" + }, + { + "type": "string", + "enum": [ + "fa" + ], + "title": "fa" + }, + { + "type": "string", + "enum": [ + "fi" + ], + "title": "fi" + }, + { + "type": "string", + "enum": [ + "fo" + ], + "title": "fo" + }, + { + "type": "string", + "enum": [ + "fr" + ], + "title": "fr" + }, + { + "type": "string", + "enum": [ + "fr-be" + ], + "title": "fr-be" + }, + { + "type": "string", + "enum": [ + "fr-ca" + ], + "title": "fr-ca" + }, + { + "type": "string", + "enum": [ + "fr-ch" + ], + "title": "fr-ch" + }, + { + "type": "string", + "enum": [ + "fr-lu" + ], + "title": "fr-lu" + }, + { + "type": "string", + "enum": [ + "ga" + ], + "title": "ga" + }, + { + "type": "string", + "enum": [ + "gd" + ], + "title": "gd" + }, + { + "type": "string", + "enum": [ + "he" + ], + "title": "he" + }, + { + "type": "string", + "enum": [ + "hi" + ], + "title": "hi" + }, + { + "type": "string", + "enum": [ + "hr" + ], + "title": "hr" + }, + { + "type": "string", + "enum": [ + "hu" + ], + "title": "hu" + }, + { + "type": "string", + "enum": [ + "id" + ], + "title": "id" + }, + { + "type": "string", + "enum": [ + "is" + ], + "title": "is" + }, + { + "type": "string", + "enum": [ + "it" + ], + "title": "it" + }, + { + "type": "string", + "enum": [ + "it-ch" + ], + "title": "it-ch" + }, + { + "type": "string", + "enum": [ + "ja" + ], + "title": "ja" + }, + { + "type": "string", + "enum": [ + "ji" + ], + "title": "ji" + }, + { + "type": "string", + "enum": [ + "ko" + ], + "title": "ko" + }, + { + "type": "string", + "enum": [ + "ku" + ], + "title": "ku" + }, + { + "type": "string", + "enum": [ + "lt" + ], + "title": "lt" + }, + { + "type": "string", + "enum": [ + "lv" + ], + "title": "lv" + }, + { + "type": "string", + "enum": [ + "mk" + ], + "title": "mk" + }, + { + "type": "string", + "enum": [ + "ml" + ], + "title": "ml" + }, + { + "type": "string", + "enum": [ + "ms" + ], + "title": "ms" + }, + { + "type": "string", + "enum": [ + "mt" + ], + "title": "mt" + }, + { + "type": "string", + "enum": [ + "nb" + ], + "title": "nb" + }, + { + "type": "string", + "enum": [ + "ne" + ], + "title": "ne" + }, + { + "type": "string", + "enum": [ + "nl" + ], + "title": "nl" + }, + { + "type": "string", + "enum": [ + "nl-be" + ], + "title": "nl-be" + }, + { + "type": "string", + "enum": [ + "nn" + ], + "title": "nn" + }, + { + "type": "string", + "enum": [ + "no" + ], + "title": "no" + }, + { + "type": "string", + "enum": [ + "pa" + ], + "title": "pa" + }, + { + "type": "string", + "enum": [ + "pl" + ], + "title": "pl" + }, + { + "type": "string", + "enum": [ + "pt" + ], + "title": "pt" + }, + { + "type": "string", + "enum": [ + "pt-br" + ], + "title": "pt-br" + }, + { + "type": "string", + "enum": [ + "rm" + ], + "title": "rm" + }, + { + "type": "string", + "enum": [ + "ro" + ], + "title": "ro" + }, + { + "type": "string", + "enum": [ + "ro-md" + ], + "title": "ro-md" + }, + { + "type": "string", + "enum": [ + "ru" + ], + "title": "ru" + }, + { + "type": "string", + "enum": [ + "ru-md" + ], + "title": "ru-md" + }, + { + "type": "string", + "enum": [ + "sb" + ], + "title": "sb" + }, + { + "type": "string", + "enum": [ + "sk" + ], + "title": "sk" + }, + { + "type": "string", + "enum": [ + "sl" + ], + "title": "sl" + }, + { + "type": "string", + "enum": [ + "sq" + ], + "title": "sq" + }, + { + "type": "string", + "enum": [ + "sr" + ], + "title": "sr" + }, + { + "type": "string", + "enum": [ + "sv" + ], + "title": "sv" + }, + { + "type": "string", + "enum": [ + "sv-fi" + ], + "title": "sv-fi" + }, + { + "type": "string", + "enum": [ + "th" + ], + "title": "th" + }, + { + "type": "string", + "enum": [ + "tn" + ], + "title": "tn" + }, + { + "type": "string", + "enum": [ + "tr" + ], + "title": "tr" + }, + { + "type": "string", + "enum": [ + "ts" + ], + "title": "ts" + }, + { + "type": "string", + "enum": [ + "ua" + ], + "title": "ua" + }, + { + "type": "string", + "enum": [ + "ur" + ], + "title": "ur" + }, + { + "type": "string", + "enum": [ + "ve" + ], + "title": "ve" + }, + { + "type": "string", + "enum": [ + "vi" + ], + "title": "vi" + }, + { + "type": "string", + "enum": [ + "xh" + ], + "title": "xh" + }, + { + "type": "string", + "enum": [ + "zh-cn" + ], + "title": "zh-cn" + }, + { + "type": "string", + "enum": [ + "zh-hk" + ], + "title": "zh-hk" + }, + { + "type": "string", + "enum": [ + "zh-sg" + ], + "title": "zh-sg" + }, + { + "type": "string", + "enum": [ + "zh-tw" + ], + "title": "zh-tw" + }, + { + "type": "string", + "enum": [ + "zu" + ], + "title": "zu" + } + ], + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/project\/variables": { + "get": { + "summary": "List project variables", + "operationId": "projectListVariables", + "tags": [ + "project" + ], + "description": "Get a list of all project environment variables.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create project variable", + "operationId": "projectCreateVariable", + "tags": [ + "project" + ], + "description": "Create a new project environment variable. These variables can be accessed by all functions and sites in the project.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "variableId": { + "description": "Variable unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<VARIABLE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>" + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>" + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "variableId", + "key", + "value" + ] + } + } + } + } + } + }, + "\/project\/variables\/{variableId}": { + "get": { + "summary": "Get project variable", + "operationId": "projectGetVariable", + "tags": [ + "project" + ], + "description": "Get a variable by its unique ID. ", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update project variable", + "operationId": "projectUpdateVariable", + "tags": [ + "project" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>", + "nullable": true + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete project variable", + "operationId": "projectDeleteVariable", + "tags": [ + "project" + ], + "description": "Delete a variable by its unique ID. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "project\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/proxy\/rules": { + "get": { + "summary": "List rules", + "operationId": "proxyListRules", + "tags": [ + "proxy" + ], + "description": "Get a list of all the proxy rules. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rule List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRuleList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/list-rules.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "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: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/proxy\/rules\/api": { + "post": { + "summary": "Create API rule", + "operationId": "proxyCreateAPIRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite's API on custom domain.\n\nRule ID is automatically generated as MD5 hash of a rule domain for performance purposes.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-api-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain name.", + "type": "string", + "example": "example.com" + } + }, + "required": [ + "domain" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/function": { + "post": { + "summary": "Create function rule", + "operationId": "proxyCreateFunctionRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for executing Appwrite Function on custom domain.\n\nRule ID is automatically generated as MD5 hash of a rule domain for performance purposes.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-function-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain name.", + "type": "string", + "example": "example.com" + }, + "functionId": { + "description": "ID of function to be executed.", + "type": "string", + "example": "<FUNCTION_ID>" + }, + "branch": { + "description": "Name of VCS branch to deploy changes automatically", + "type": "string", + "default": "", + "example": "<BRANCH>" + } + }, + "required": [ + "domain", + "functionId" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/redirect": { + "post": { + "summary": "Create redirect rule", + "operationId": "proxyCreateRedirectRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for to redirect from custom domain to another domain.\n\nRule ID is automatically generated as MD5 hash of a rule domain for performance purposes.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-redirect-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain name.", + "type": "string", + "example": "example.com" + }, + "url": { + "description": "Target URL of redirection", + "type": "string", + "example": "https:\/\/example.com", + "format": "url" + }, + "statusCode": { + "description": "Status code of redirection", + "type": "string", + "example": "301", + "title": "StatusCode", + "oneOf": [ + { + "type": "string", + "enum": [ + "301" + ], + "title": "MovedPermanently" + }, + { + "type": "string", + "enum": [ + "302" + ], + "title": "Found" + }, + { + "type": "string", + "enum": [ + "307" + ], + "title": "TemporaryRedirect" + }, + { + "type": "string", + "enum": [ + "308" + ], + "title": "PermanentRedirect" + } + ] + }, + "resourceId": { + "description": "ID of parent resource.", + "type": "string", + "example": "<RESOURCE_ID>" + }, + "resourceType": { + "description": "Type of parent resource.", + "type": "string", + "example": "site", + "title": "ProxyResourceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "site" + ], + "title": "Site" + }, + { + "type": "string", + "enum": [ + "function" + ], + "title": "Function" + } + ] + } + }, + "required": [ + "domain", + "url", + "statusCode", + "resourceId", + "resourceType" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/site": { + "post": { + "summary": "Create site rule", + "operationId": "proxyCreateSiteRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite Site on custom domain.\n\nRule ID is automatically generated as MD5 hash of a rule domain for performance purposes.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-site-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain name.", + "type": "string", + "example": "example.com" + }, + "siteId": { + "description": "ID of site to be executed.", + "type": "string", + "example": "<SITE_ID>" + }, + "branch": { + "description": "Name of VCS branch to deploy changes automatically", + "type": "string", + "default": "", + "example": "<BRANCH>" + } + }, + "required": [ + "domain", + "siteId" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/{ruleId}": { + "get": { + "summary": "Get rule", + "operationId": "proxyGetRule", + "tags": [ + "proxy" + ], + "description": "Get a proxy rule by its unique ID.", + "responses": { + "200": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/get-rule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RULE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete rule", + "operationId": "proxyDeleteRule", + "tags": [ + "proxy" + ], + "description": "Delete a proxy rule by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/delete-rule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/proxy\/rules\/{ruleId}\/status": { + "patch": { + "summary": "Update rule status", + "operationId": "proxyUpdateRuleStatus", + "tags": [ + "proxy" + ], + "description": "If not succeeded yet, retry verification process of a proxy rule domain. This endpoint triggers domain verification by checking DNS records. If verification is successful, a TLS certificate will be automatically provisioned for the domain asynchronously in the background.", + "responses": { + "200": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/update-rule-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/reports": { + "get": { + "summary": "List reports", + "operationId": "advisorListReports", + "tags": [ + "advisor" + ], + "description": "Get a list of all the project's analyzer reports. You can use the query params to filter your results.\n", + "responses": { + "200": { + "description": "Reports List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/reportList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "reports", + "demo": "advisor\/list-reports.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "reports.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: appId, type, targetType, target, analyzedAt", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/reports\/{reportId}": { + "get": { + "summary": "Get report", + "operationId": "advisorGetReport", + "tags": [ + "advisor" + ], + "description": "Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced.\n", + "responses": { + "200": { + "description": "Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/report" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "reports", + "demo": "advisor\/get-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "reports.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "reportId", + "description": "Report ID.", + "required": true, + "schema": { + "type": "string", + "example": "<REPORT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete report", + "operationId": "advisorDeleteReport", + "tags": [ + "advisor" + ], + "description": "Delete an analyzer report by its unique ID. Nested insights and CTA metadata are removed asynchronously by the deletes worker.\n", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "reports", + "demo": "advisor\/delete-report.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "projectId:{projectId},userId:{userId}", + "scope": "reports.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "reportId", + "description": "Report ID.", + "required": true, + "schema": { + "type": "string", + "example": "<REPORT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/reports\/{reportId}\/insights": { + "get": { + "summary": "List insights", + "operationId": "advisorListInsights", + "tags": [ + "advisor" + ], + "description": "List the insights produced under a single analyzer report. You can use the query params to filter your results further.\n", + "responses": { + "200": { + "description": "Insights List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/insightList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "insights", + "demo": "advisor\/list-insights.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "insights.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "reportId", + "description": "Parent report ID.", + "required": true, + "schema": { + "type": "string", + "example": "<REPORT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, severity, status, resourceType, resourceId, parentResourceType, parentResourceId, analyzedAt, dismissedAt, dismissedBy", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/reports\/{reportId}\/insights\/{insightId}": { + "get": { + "summary": "Get insight", + "operationId": "advisorGetInsight", + "tags": [ + "advisor" + ], + "description": "Get an insight by its unique ID, scoped to its parent report.\n", + "responses": { + "200": { + "description": "Insight", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/insight" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "insights", + "demo": "advisor\/get-insight.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "insights.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "reportId", + "description": "Parent report ID.", + "required": true, + "schema": { + "type": "string", + "example": "<REPORT_ID>" + }, + "in": "path" + }, + { + "name": "insightId", + "description": "Insight ID.", + "required": true, + "schema": { + "type": "string", + "example": "<INSIGHT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/siteList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "siteId": { + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<SITE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Site name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "framework": { + "description": "Sites framework.", + "type": "string", + "example": "analog", + "title": "Framework", + "oneOf": [ + { + "type": "string", + "enum": [ + "analog" + ], + "title": "analog" + }, + { + "type": "string", + "enum": [ + "angular" + ], + "title": "angular" + }, + { + "type": "string", + "enum": [ + "nextjs" + ], + "title": "nextjs" + }, + { + "type": "string", + "enum": [ + "react" + ], + "title": "react" + }, + { + "type": "string", + "enum": [ + "nuxt" + ], + "title": "nuxt" + }, + { + "type": "string", + "enum": [ + "vue" + ], + "title": "vue" + }, + { + "type": "string", + "enum": [ + "sveltekit" + ], + "title": "sveltekit" + }, + { + "type": "string", + "enum": [ + "astro" + ], + "title": "astro" + }, + { + "type": "string", + "enum": [ + "tanstack-start" + ], + "title": "tanstack-start" + }, + { + "type": "string", + "enum": [ + "remix" + ], + "title": "remix" + }, + { + "type": "string", + "enum": [ + "lynx" + ], + "title": "lynx" + }, + { + "type": "string", + "enum": [ + "flutter" + ], + "title": "flutter" + }, + { + "type": "string", + "enum": [ + "react-native" + ], + "title": "react-native" + }, + { + "type": "string", + "enum": [ + "vite" + ], + "title": "vite" + }, + { + "type": "string", + "enum": [ + "other" + ], + "title": "other" + } + ] + }, + "enabled": { + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "logging": { + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "type": "boolean", + "default": true, + "example": false + }, + "timeout": { + "description": "Maximum request time in seconds.", + "type": "integer", + "default": 30, + "example": 1, + "format": "int32" + }, + "installCommand": { + "description": "Install Command.", + "type": "string", + "default": "", + "example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "description": "Build Command.", + "type": "string", + "default": "", + "example": "<BUILD_COMMAND>" + }, + "startCommand": { + "description": "Custom start command. Leave empty to use default.", + "type": "string", + "default": "", + "example": "<START_COMMAND>" + }, + "outputDirectory": { + "description": "Output Directory for site.", + "type": "string", + "default": "", + "example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "description": "Runtime to use during build step.", + "type": "string", + "example": "node-14.5", + "title": "BuildRuntime", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "adapter": { + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "type": "string", + "default": "", + "example": "static", + "title": "Adapter", + "oneOf": [ + { + "type": "string", + "enum": [ + "static" + ], + "title": "static" + }, + { + "type": "string", + "enum": [ + "ssr" + ], + "title": "ssr" + } + ] + }, + "installationId": { + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "type": "string", + "default": "", + "example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "description": "Fallback file for single page application sites.", + "type": "string", + "default": "", + "example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "description": "Repository ID of the repo linked to the site.", + "type": "string", + "default": "", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "description": "Production branch for the repo linked to the site.", + "type": "string", + "default": "", + "example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "type": "boolean", + "default": false, + "example": false + }, + "providerRootDirectory": { + "description": "Path to site code in the linked repo.", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "providerBranches": { + "description": "List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "providerPaths": { + "description": "List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "buildSpecification": { + "description": "Build specification for the site deployments.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "runtimeSpecification": { + "description": "Runtime specification for the SSR executions.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "deploymentRetention": { + "description": "Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + }, + "scopes": { + "description": "List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed.", + "type": "array", + "default": [], + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + } + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + } + } + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/frameworkList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "frameworks", + "demo": "sites\/list-frameworks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "frameworks", + "demo": "sites\/list-specifications.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes.", + "required": false, + "schema": { + "type": "string", + "example": "runtimes", + "default": "runtimes" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Site name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "framework": { + "description": "Sites framework.", + "type": "string", + "example": "analog", + "title": "Framework", + "oneOf": [ + { + "type": "string", + "enum": [ + "analog" + ], + "title": "analog" + }, + { + "type": "string", + "enum": [ + "angular" + ], + "title": "angular" + }, + { + "type": "string", + "enum": [ + "nextjs" + ], + "title": "nextjs" + }, + { + "type": "string", + "enum": [ + "react" + ], + "title": "react" + }, + { + "type": "string", + "enum": [ + "nuxt" + ], + "title": "nuxt" + }, + { + "type": "string", + "enum": [ + "vue" + ], + "title": "vue" + }, + { + "type": "string", + "enum": [ + "sveltekit" + ], + "title": "sveltekit" + }, + { + "type": "string", + "enum": [ + "astro" + ], + "title": "astro" + }, + { + "type": "string", + "enum": [ + "tanstack-start" + ], + "title": "tanstack-start" + }, + { + "type": "string", + "enum": [ + "remix" + ], + "title": "remix" + }, + { + "type": "string", + "enum": [ + "lynx" + ], + "title": "lynx" + }, + { + "type": "string", + "enum": [ + "flutter" + ], + "title": "flutter" + }, + { + "type": "string", + "enum": [ + "react-native" + ], + "title": "react-native" + }, + { + "type": "string", + "enum": [ + "vite" + ], + "title": "vite" + }, + { + "type": "string", + "enum": [ + "other" + ], + "title": "other" + } + ] + }, + "enabled": { + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "logging": { + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "type": "boolean", + "default": true, + "example": false + }, + "timeout": { + "description": "Maximum request time in seconds.", + "type": "integer", + "default": 30, + "example": 1, + "format": "int32" + }, + "installCommand": { + "description": "Install Command.", + "type": "string", + "default": "", + "example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "description": "Build Command.", + "type": "string", + "default": "", + "example": "<BUILD_COMMAND>" + }, + "startCommand": { + "description": "Custom start command. Leave empty to use default.", + "type": "string", + "default": "", + "example": "<START_COMMAND>" + }, + "outputDirectory": { + "description": "Output Directory for site.", + "type": "string", + "default": "", + "example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "description": "Runtime to use during build step.", + "type": "string", + "default": "", + "example": "node-14.5", + "title": "BuildRuntime", + "oneOf": [ + { + "type": "string", + "enum": [ + "node-14.5" + ], + "title": "node-14.5" + }, + { + "type": "string", + "enum": [ + "node-16.0" + ], + "title": "node-16.0" + }, + { + "type": "string", + "enum": [ + "node-18.0" + ], + "title": "node-18.0" + }, + { + "type": "string", + "enum": [ + "node-19.0" + ], + "title": "node-19.0" + }, + { + "type": "string", + "enum": [ + "node-20.0" + ], + "title": "node-20.0" + }, + { + "type": "string", + "enum": [ + "node-21.0" + ], + "title": "node-21.0" + }, + { + "type": "string", + "enum": [ + "node-22" + ], + "title": "node-22" + }, + { + "type": "string", + "enum": [ + "node-23" + ], + "title": "node-23" + }, + { + "type": "string", + "enum": [ + "node-24" + ], + "title": "node-24" + }, + { + "type": "string", + "enum": [ + "node-25" + ], + "title": "node-25" + }, + { + "type": "string", + "enum": [ + "node-26" + ], + "title": "node-26" + }, + { + "type": "string", + "enum": [ + "php-8.0" + ], + "title": "php-8.0" + }, + { + "type": "string", + "enum": [ + "php-8.1" + ], + "title": "php-8.1" + }, + { + "type": "string", + "enum": [ + "php-8.2" + ], + "title": "php-8.2" + }, + { + "type": "string", + "enum": [ + "php-8.3" + ], + "title": "php-8.3" + }, + { + "type": "string", + "enum": [ + "php-8.4" + ], + "title": "php-8.4" + }, + { + "type": "string", + "enum": [ + "ruby-3.0" + ], + "title": "ruby-3.0" + }, + { + "type": "string", + "enum": [ + "ruby-3.1" + ], + "title": "ruby-3.1" + }, + { + "type": "string", + "enum": [ + "ruby-3.2" + ], + "title": "ruby-3.2" + }, + { + "type": "string", + "enum": [ + "ruby-3.3" + ], + "title": "ruby-3.3" + }, + { + "type": "string", + "enum": [ + "ruby-3.4" + ], + "title": "ruby-3.4" + }, + { + "type": "string", + "enum": [ + "ruby-4.0" + ], + "title": "ruby-4.0" + }, + { + "type": "string", + "enum": [ + "python-3.8" + ], + "title": "python-3.8" + }, + { + "type": "string", + "enum": [ + "python-3.9" + ], + "title": "python-3.9" + }, + { + "type": "string", + "enum": [ + "python-3.10" + ], + "title": "python-3.10" + }, + { + "type": "string", + "enum": [ + "python-3.11" + ], + "title": "python-3.11" + }, + { + "type": "string", + "enum": [ + "python-3.12" + ], + "title": "python-3.12" + }, + { + "type": "string", + "enum": [ + "python-3.13" + ], + "title": "python-3.13" + }, + { + "type": "string", + "enum": [ + "python-3.14" + ], + "title": "python-3.14" + }, + { + "type": "string", + "enum": [ + "python-ml-3.11" + ], + "title": "python-ml-3.11" + }, + { + "type": "string", + "enum": [ + "python-ml-3.12" + ], + "title": "python-ml-3.12" + }, + { + "type": "string", + "enum": [ + "python-ml-3.13" + ], + "title": "python-ml-3.13" + }, + { + "type": "string", + "enum": [ + "deno-1.21" + ], + "title": "deno-1.21" + }, + { + "type": "string", + "enum": [ + "deno-1.24" + ], + "title": "deno-1.24" + }, + { + "type": "string", + "enum": [ + "deno-1.35" + ], + "title": "deno-1.35" + }, + { + "type": "string", + "enum": [ + "deno-1.40" + ], + "title": "deno-1.40" + }, + { + "type": "string", + "enum": [ + "deno-1.46" + ], + "title": "deno-1.46" + }, + { + "type": "string", + "enum": [ + "deno-2.0" + ], + "title": "deno-2.0" + }, + { + "type": "string", + "enum": [ + "deno-2.5" + ], + "title": "deno-2.5" + }, + { + "type": "string", + "enum": [ + "deno-2.6" + ], + "title": "deno-2.6" + }, + { + "type": "string", + "enum": [ + "dart-2.15" + ], + "title": "dart-2.15" + }, + { + "type": "string", + "enum": [ + "dart-2.16" + ], + "title": "dart-2.16" + }, + { + "type": "string", + "enum": [ + "dart-2.17" + ], + "title": "dart-2.17" + }, + { + "type": "string", + "enum": [ + "dart-2.18" + ], + "title": "dart-2.18" + }, + { + "type": "string", + "enum": [ + "dart-2.19" + ], + "title": "dart-2.19" + }, + { + "type": "string", + "enum": [ + "dart-3.0" + ], + "title": "dart-3.0" + }, + { + "type": "string", + "enum": [ + "dart-3.1" + ], + "title": "dart-3.1" + }, + { + "type": "string", + "enum": [ + "dart-3.3" + ], + "title": "dart-3.3" + }, + { + "type": "string", + "enum": [ + "dart-3.5" + ], + "title": "dart-3.5" + }, + { + "type": "string", + "enum": [ + "dart-3.8" + ], + "title": "dart-3.8" + }, + { + "type": "string", + "enum": [ + "dart-3.9" + ], + "title": "dart-3.9" + }, + { + "type": "string", + "enum": [ + "dart-3.10" + ], + "title": "dart-3.10" + }, + { + "type": "string", + "enum": [ + "dart-3.11" + ], + "title": "dart-3.11" + }, + { + "type": "string", + "enum": [ + "dart-3.12" + ], + "title": "dart-3.12" + }, + { + "type": "string", + "enum": [ + "dotnet-6.0" + ], + "title": "dotnet-6.0" + }, + { + "type": "string", + "enum": [ + "dotnet-7.0" + ], + "title": "dotnet-7.0" + }, + { + "type": "string", + "enum": [ + "dotnet-8.0" + ], + "title": "dotnet-8.0" + }, + { + "type": "string", + "enum": [ + "dotnet-10" + ], + "title": "dotnet-10" + }, + { + "type": "string", + "enum": [ + "java-8.0" + ], + "title": "java-8.0" + }, + { + "type": "string", + "enum": [ + "java-11.0" + ], + "title": "java-11.0" + }, + { + "type": "string", + "enum": [ + "java-17.0" + ], + "title": "java-17.0" + }, + { + "type": "string", + "enum": [ + "java-18.0" + ], + "title": "java-18.0" + }, + { + "type": "string", + "enum": [ + "java-21.0" + ], + "title": "java-21.0" + }, + { + "type": "string", + "enum": [ + "java-22" + ], + "title": "java-22" + }, + { + "type": "string", + "enum": [ + "java-25" + ], + "title": "java-25" + }, + { + "type": "string", + "enum": [ + "swift-5.5" + ], + "title": "swift-5.5" + }, + { + "type": "string", + "enum": [ + "swift-5.8" + ], + "title": "swift-5.8" + }, + { + "type": "string", + "enum": [ + "swift-5.9" + ], + "title": "swift-5.9" + }, + { + "type": "string", + "enum": [ + "swift-5.10" + ], + "title": "swift-5.10" + }, + { + "type": "string", + "enum": [ + "swift-6.2" + ], + "title": "swift-6.2" + }, + { + "type": "string", + "enum": [ + "kotlin-1.6" + ], + "title": "kotlin-1.6" + }, + { + "type": "string", + "enum": [ + "kotlin-1.8" + ], + "title": "kotlin-1.8" + }, + { + "type": "string", + "enum": [ + "kotlin-1.9" + ], + "title": "kotlin-1.9" + }, + { + "type": "string", + "enum": [ + "kotlin-2.0" + ], + "title": "kotlin-2.0" + }, + { + "type": "string", + "enum": [ + "kotlin-2.3" + ], + "title": "kotlin-2.3" + }, + { + "type": "string", + "enum": [ + "cpp-17" + ], + "title": "cpp-17" + }, + { + "type": "string", + "enum": [ + "cpp-20" + ], + "title": "cpp-20" + }, + { + "type": "string", + "enum": [ + "bun-1.0" + ], + "title": "bun-1.0" + }, + { + "type": "string", + "enum": [ + "bun-1.1" + ], + "title": "bun-1.1" + }, + { + "type": "string", + "enum": [ + "bun-1.2" + ], + "title": "bun-1.2" + }, + { + "type": "string", + "enum": [ + "bun-1.3" + ], + "title": "bun-1.3" + }, + { + "type": "string", + "enum": [ + "bun-1.4" + ], + "title": "bun-1.4" + }, + { + "type": "string", + "enum": [ + "go-1.23" + ], + "title": "go-1.23" + }, + { + "type": "string", + "enum": [ + "go-1.24" + ], + "title": "go-1.24" + }, + { + "type": "string", + "enum": [ + "go-1.25" + ], + "title": "go-1.25" + }, + { + "type": "string", + "enum": [ + "go-1.26" + ], + "title": "go-1.26" + }, + { + "type": "string", + "enum": [ + "rust-1.83" + ], + "title": "rust-1.83" + }, + { + "type": "string", + "enum": [ + "static-1" + ], + "title": "static-1" + }, + { + "type": "string", + "enum": [ + "flutter-3.24" + ], + "title": "flutter-3.24" + }, + { + "type": "string", + "enum": [ + "flutter-3.27" + ], + "title": "flutter-3.27" + }, + { + "type": "string", + "enum": [ + "flutter-3.29" + ], + "title": "flutter-3.29" + }, + { + "type": "string", + "enum": [ + "flutter-3.32" + ], + "title": "flutter-3.32" + }, + { + "type": "string", + "enum": [ + "flutter-3.35" + ], + "title": "flutter-3.35" + }, + { + "type": "string", + "enum": [ + "flutter-3.38" + ], + "title": "flutter-3.38" + }, + { + "type": "string", + "enum": [ + "flutter-3.41" + ], + "title": "flutter-3.41" + }, + { + "type": "string", + "enum": [ + "flutter-3.44" + ], + "title": "flutter-3.44" + } + ] + }, + "adapter": { + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "type": "string", + "default": "", + "example": "static", + "title": "Adapter", + "oneOf": [ + { + "type": "string", + "enum": [ + "static" + ], + "title": "static" + }, + { + "type": "string", + "enum": [ + "ssr" + ], + "title": "ssr" + } + ] + }, + "fallbackFile": { + "description": "Fallback file for single page application sites.", + "type": "string", + "default": "", + "example": "<FALLBACK_FILE>" + }, + "installationId": { + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "type": "string", + "default": "", + "example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "description": "Repository ID of the repo linked to the site.", + "type": "string", + "default": "", + "example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "description": "Production branch for the repo linked to the site.", + "type": "string", + "default": "", + "example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "type": "boolean", + "default": false, + "example": false + }, + "providerRootDirectory": { + "description": "Path to site code in the linked repo.", + "type": "string", + "default": "", + "example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "providerBranches": { + "description": "List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "providerPaths": { + "description": "List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "buildSpecification": { + "description": "Build specification for the site deployments.", + "type": "string", + "example": "s-1vcpu-512mb", + "nullable": true + }, + "runtimeSpecification": { + "description": "Runtime specification for the SSR executions.", + "type": "string", + "default": {}, + "example": "s-1vcpu-512mb" + }, + "deploymentRetention": { + "description": "Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + }, + "scopes": { + "description": "List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed.", + "type": "array", + "items": { + "title": "ProjectKeyScopes", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "project.read" + ], + "title": "project.read" + }, + { + "type": "string", + "enum": [ + "project.write" + ], + "title": "project.write" + }, + { + "type": "string", + "enum": [ + "usage.read" + ], + "title": "usage.read" + }, + { + "type": "string", + "enum": [ + "keys.read" + ], + "title": "keys.read" + }, + { + "type": "string", + "enum": [ + "keys.write" + ], + "title": "keys.write" + }, + { + "type": "string", + "enum": [ + "platforms.read" + ], + "title": "platforms.read" + }, + { + "type": "string", + "enum": [ + "platforms.write" + ], + "title": "platforms.write" + }, + { + "type": "string", + "enum": [ + "mocks.read" + ], + "title": "mocks.read" + }, + { + "type": "string", + "enum": [ + "mocks.write" + ], + "title": "mocks.write" + }, + { + "type": "string", + "enum": [ + "policies.read" + ], + "title": "policies.read" + }, + { + "type": "string", + "enum": [ + "policies.write" + ], + "title": "policies.write" + }, + { + "type": "string", + "enum": [ + "project.policies.read" + ], + "title": "project.policies.read" + }, + { + "type": "string", + "enum": [ + "project.policies.write" + ], + "title": "project.policies.write" + }, + { + "type": "string", + "enum": [ + "project.oauth2.read" + ], + "title": "project.oauth2.read" + }, + { + "type": "string", + "enum": [ + "project.oauth2.write" + ], + "title": "project.oauth2.write" + }, + { + "type": "string", + "enum": [ + "templates.read" + ], + "title": "templates.read" + }, + { + "type": "string", + "enum": [ + "templates.write" + ], + "title": "templates.write" + }, + { + "type": "string", + "enum": [ + "stages.read" + ], + "title": "stages.read" + }, + { + "type": "string", + "enum": [ + "stages.write" + ], + "title": "stages.write" + }, + { + "type": "string", + "enum": [ + "users.read" + ], + "title": "users.read" + }, + { + "type": "string", + "enum": [ + "users.write" + ], + "title": "users.write" + }, + { + "type": "string", + "enum": [ + "sessions.read" + ], + "title": "sessions.read" + }, + { + "type": "string", + "enum": [ + "sessions.write" + ], + "title": "sessions.write" + }, + { + "type": "string", + "enum": [ + "teams.read" + ], + "title": "teams.read" + }, + { + "type": "string", + "enum": [ + "teams.write" + ], + "title": "teams.write" + }, + { + "type": "string", + "enum": [ + "databases.read" + ], + "title": "databases.read" + }, + { + "type": "string", + "enum": [ + "databases.write" + ], + "title": "databases.write" + }, + { + "type": "string", + "enum": [ + "tables.read" + ], + "title": "tables.read" + }, + { + "type": "string", + "enum": [ + "tables.write" + ], + "title": "tables.write" + }, + { + "type": "string", + "enum": [ + "columns.read" + ], + "title": "columns.read" + }, + { + "type": "string", + "enum": [ + "columns.write" + ], + "title": "columns.write" + }, + { + "type": "string", + "enum": [ + "indexes.read" + ], + "title": "indexes.read" + }, + { + "type": "string", + "enum": [ + "indexes.write" + ], + "title": "indexes.write" + }, + { + "type": "string", + "enum": [ + "rows.read" + ], + "title": "rows.read" + }, + { + "type": "string", + "enum": [ + "rows.write" + ], + "title": "rows.write" + }, + { + "type": "string", + "enum": [ + "embeddings.write" + ], + "title": "embeddings.write" + }, + { + "type": "string", + "enum": [ + "collections.read" + ], + "title": "collections.read" + }, + { + "type": "string", + "enum": [ + "collections.write" + ], + "title": "collections.write" + }, + { + "type": "string", + "enum": [ + "attributes.read" + ], + "title": "attributes.read" + }, + { + "type": "string", + "enum": [ + "attributes.write" + ], + "title": "attributes.write" + }, + { + "type": "string", + "enum": [ + "documents.read" + ], + "title": "documents.read" + }, + { + "type": "string", + "enum": [ + "documents.write" + ], + "title": "documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.read" + ], + "title": "documentsdb.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.write" + ], + "title": "documentsdb.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.read" + ], + "title": "documentsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.collections.write" + ], + "title": "documentsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.read" + ], + "title": "documentsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.documents.write" + ], + "title": "documentsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.read" + ], + "title": "documentsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "documentsdb.indexes.write" + ], + "title": "documentsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.read" + ], + "title": "vectorsdb.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.write" + ], + "title": "vectorsdb.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.read" + ], + "title": "vectorsdb.collections.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.collections.write" + ], + "title": "vectorsdb.collections.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.read" + ], + "title": "vectorsdb.documents.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.documents.write" + ], + "title": "vectorsdb.documents.write" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.read" + ], + "title": "vectorsdb.indexes.read" + }, + { + "type": "string", + "enum": [ + "vectorsdb.indexes.write" + ], + "title": "vectorsdb.indexes.write" + }, + { + "type": "string", + "enum": [ + "buckets.read" + ], + "title": "buckets.read" + }, + { + "type": "string", + "enum": [ + "buckets.write" + ], + "title": "buckets.write" + }, + { + "type": "string", + "enum": [ + "files.read" + ], + "title": "files.read" + }, + { + "type": "string", + "enum": [ + "files.write" + ], + "title": "files.write" + }, + { + "type": "string", + "enum": [ + "tokens.read" + ], + "title": "tokens.read" + }, + { + "type": "string", + "enum": [ + "tokens.write" + ], + "title": "tokens.write" + }, + { + "type": "string", + "enum": [ + "functions.read" + ], + "title": "functions.read" + }, + { + "type": "string", + "enum": [ + "functions.write" + ], + "title": "functions.write" + }, + { + "type": "string", + "enum": [ + "executions.read" + ], + "title": "executions.read" + }, + { + "type": "string", + "enum": [ + "executions.write" + ], + "title": "executions.write" + }, + { + "type": "string", + "enum": [ + "execution.read" + ], + "title": "execution.read" + }, + { + "type": "string", + "enum": [ + "execution.write" + ], + "title": "execution.write" + }, + { + "type": "string", + "enum": [ + "sites.read" + ], + "title": "sites.read" + }, + { + "type": "string", + "enum": [ + "sites.write" + ], + "title": "sites.write" + }, + { + "type": "string", + "enum": [ + "log.read" + ], + "title": "log.read" + }, + { + "type": "string", + "enum": [ + "log.write" + ], + "title": "log.write" + }, + { + "type": "string", + "enum": [ + "providers.read" + ], + "title": "providers.read" + }, + { + "type": "string", + "enum": [ + "providers.write" + ], + "title": "providers.write" + }, + { + "type": "string", + "enum": [ + "topics.read" + ], + "title": "topics.read" + }, + { + "type": "string", + "enum": [ + "topics.write" + ], + "title": "topics.write" + }, + { + "type": "string", + "enum": [ + "subscribers.read" + ], + "title": "subscribers.read" + }, + { + "type": "string", + "enum": [ + "subscribers.write" + ], + "title": "subscribers.write" + }, + { + "type": "string", + "enum": [ + "targets.read" + ], + "title": "targets.read" + }, + { + "type": "string", + "enum": [ + "targets.write" + ], + "title": "targets.write" + }, + { + "type": "string", + "enum": [ + "messages.read" + ], + "title": "messages.read" + }, + { + "type": "string", + "enum": [ + "messages.write" + ], + "title": "messages.write" + }, + { + "type": "string", + "enum": [ + "rules.read" + ], + "title": "rules.read" + }, + { + "type": "string", + "enum": [ + "rules.write" + ], + "title": "rules.write" + }, + { + "type": "string", + "enum": [ + "webhooks.read" + ], + "title": "webhooks.read" + }, + { + "type": "string", + "enum": [ + "webhooks.write" + ], + "title": "webhooks.write" + }, + { + "type": "string", + "enum": [ + "locale.read" + ], + "title": "locale.read" + }, + { + "type": "string", + "enum": [ + "avatars.read" + ], + "title": "avatars.read" + }, + { + "type": "string", + "enum": [ + "health.read" + ], + "title": "health.read" + }, + { + "type": "string", + "enum": [ + "assistant.read" + ], + "title": "assistant.read" + }, + { + "type": "string", + "enum": [ + "migrations.read" + ], + "title": "migrations.read" + }, + { + "type": "string", + "enum": [ + "migrations.write" + ], + "title": "migrations.write" + }, + { + "type": "string", + "enum": [ + "schedules.read" + ], + "title": "schedules.read" + }, + { + "type": "string", + "enum": [ + "schedules.write" + ], + "title": "schedules.write" + }, + { + "type": "string", + "enum": [ + "vcs.read" + ], + "title": "vcs.read" + }, + { + "type": "string", + "enum": [ + "vcs.write" + ], + "title": "vcs.write" + }, + { + "type": "string", + "enum": [ + "insights.read" + ], + "title": "insights.read" + }, + { + "type": "string", + "enum": [ + "insights.write" + ], + "title": "insights.write" + }, + { + "type": "string", + "enum": [ + "reports.read" + ], + "title": "reports.read" + }, + { + "type": "string", + "enum": [ + "reports.write" + ], + "title": "reports.write" + }, + { + "type": "string", + "enum": [ + "presences.read" + ], + "title": "presences.read" + }, + { + "type": "string", + "enum": [ + "presences.write" + ], + "title": "presences.write" + } + ] + }, + "nullable": true + } + }, + "required": [ + "name", + "framework" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sites", + "demo": "sites\/update-site-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "description": "Deployment ID.", + "type": "string", + "example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/list-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/create-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": true, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "installCommand": { + "description": "Install Commands.", + "type": "string", + "example": "<INSTALL_COMMAND>", + "nullable": true + }, + "buildCommand": { + "description": "Build Commands.", + "type": "string", + "example": "<BUILD_COMMAND>", + "nullable": true + }, + "outputDirectory": { + "description": "Output Directory.", + "type": "string", + "example": "<OUTPUT_DIRECTORY>", + "nullable": true + }, + "code": { + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "type": "string", + "format": "binary" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "code" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/create-duplicate-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "description": "Deployment ID.", + "type": "string", + "example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/products\/sites\/templates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/create-template-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "description": "Repository name of the template.", + "type": "string", + "example": "<REPOSITORY>" + }, + "owner": { + "description": "The name of the owner of the template.", + "type": "string", + "example": "<OWNER>" + }, + "rootDirectory": { + "description": "Path to site code in the template repo.", + "type": "string", + "example": "<ROOT_DIRECTORY>" + }, + "type": { + "description": "Type for the reference provided. Can be commit, branch, or tag", + "type": "string", + "example": "branch", + "title": "TemplateReferenceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "branch" + ], + "title": "branch" + }, + { + "type": "string", + "enum": [ + "commit" + ], + "title": "commit" + }, + { + "type": "string", + "enum": [ + "tag" + ], + "title": "tag" + } + ] + }, + "reference": { + "description": "Reference value, can be a commit hash, branch name, or release tag", + "type": "string", + "example": "<REFERENCE>" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "type", + "reference" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/create-vcs-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "description": "Type of reference passed. Allowed values are: branch, commit", + "type": "string", + "example": "branch", + "title": "VCSReferenceType", + "oneOf": [ + { + "type": "string", + "enum": [ + "branch" + ], + "title": "branch" + }, + { + "type": "string", + "enum": [ + "commit" + ], + "title": "commit" + }, + { + "type": "string", + "enum": [ + "tag" + ], + "title": "tag" + } + ] + }, + "reference": { + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "type": "string", + "example": "<REFERENCE>" + }, + "activate": { + "description": "Automatically activate the deployment when it is finished building.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/get-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/delete-deployment.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "tags": [ + "sites" + ], + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/get-deployment-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "public", + "sites.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "example": "source", + "title": "DeploymentDownloadType", + "oneOf": [ + { + "type": "string", + "enum": [ + "source" + ], + "title": "source" + }, + { + "type": "string", + "enum": [ + "output" + ], + "title": "output" + } + ], + "default": "source" + }, + "in": "query" + }, + { + "name": "token", + "description": "Presigned source-download token for accessing this deployment without a session (jobs-service).", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "deployments", + "demo": "sites\/update-deployment-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "logs", + "demo": "sites\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "logs", + "demo": "sites\/get-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "example": "<LOG_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "logs", + "demo": "sites\/delete-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "produces": [ + "application\/json" + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "example": "<LOG_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "variableId": { + "description": "Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<VARIABLE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>" + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>" + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "variableId", + "key", + "value" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "value": { + "description": "Variable value. Max length: 8192 chars.", + "type": "string", + "example": "<VALUE>", + "nullable": true + }, + "secret": { + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "variables", + "demo": "sites\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucketList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<BUCKET_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Bucket name", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "fileSecurity": { + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "maximumFileSize": { + "description": "Maximum file size allowed in bytes. Maximum allowed value is 0B.", + "type": "integer", + "default": {}, + "example": 1, + "format": "int32" + }, + "allowedFileExtensions": { + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "compression": { + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "type": "string", + "default": "none", + "example": "none", + "title": "Compression", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "gzip" + ], + "title": "gzip" + }, + { + "type": "string", + "enum": [ + "zstd" + ], + "title": "zstd" + } + ] + }, + "encryption": { + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "type": "boolean", + "default": true, + "example": false + }, + "antivirus": { + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "type": "boolean", + "default": true, + "example": false + }, + "transformations": { + "description": "Are image transformations enabled?", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Bucket name", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "fileSecurity": { + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "maximumFileSize": { + "description": "Maximum file size allowed in bytes. Maximum allowed value is 0B.", + "type": "integer", + "default": {}, + "example": 1, + "format": "int32" + }, + "allowedFileExtensions": { + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "compression": { + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "type": "string", + "default": "none", + "example": "none", + "title": "Compression", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "gzip" + ], + "title": "gzip" + }, + { + "type": "string", + "enum": [ + "zstd" + ], + "title": "zstd" + } + ] + }, + "encryption": { + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "type": "boolean", + "default": true, + "example": false + }, + "antivirus": { + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "type": "boolean", + "default": true, + "example": false + }, + "transformations": { + "description": "Are image transformations enabled?", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "buckets", + "demo": "storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<FILE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "file": { + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "type": "string", + "format": "binary" + }, + "permissions": { + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "folder": { + "description": "Virtual folder to place the file in, for example \"photos\/2026\". Nest folders with `\/`. Defaults to the bucket root.", + "type": "string", + "default": "", + "example": "photos\/2026" + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/update-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "File name.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "example": "center", + "title": "ImageGravity", + "oneOf": [ + { + "type": "string", + "enum": [ + "center" + ], + "title": "center" + }, + { + "type": "string", + "enum": [ + "top-left" + ], + "title": "top-left" + }, + { + "type": "string", + "enum": [ + "top" + ], + "title": "top" + }, + { + "type": "string", + "enum": [ + "top-right" + ], + "title": "top-right" + }, + { + "type": "string", + "enum": [ + "left" + ], + "title": "left" + }, + { + "type": "string", + "enum": [ + "right" + ], + "title": "right" + }, + { + "type": "string", + "enum": [ + "bottom-left" + ], + "title": "bottom-left" + }, + { + "type": "string", + "enum": [ + "bottom" + ], + "title": "bottom" + }, + { + "type": "string", + "enum": [ + "bottom-right" + ], + "title": "bottom-right" + } + ], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": -360, + "default": 0 + }, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "example": "FFFFFF", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "example": "jpg", + "title": "ImageFormat", + "oneOf": [ + { + "type": "string", + "enum": [ + "jpg" + ], + "title": "jpg" + }, + { + "type": "string", + "enum": [ + "jpeg" + ], + "title": "jpeg" + }, + { + "type": "string", + "enum": [ + "png" + ], + "title": "png" + }, + { + "type": "string", + "enum": [ + "webp" + ], + "title": "webp" + }, + { + "type": "string", + "enum": [ + "heic" + ], + "title": "heic" + }, + { + "type": "string", + "enum": [ + "avif" + ], + "title": "avif" + }, + { + "type": "string", + "enum": [ + "gif" + ], + "title": "gif" + } + ], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "content": { + "*\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DATABASE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "tablesDBListTransactions", + "tags": [ + "tablesDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.read", + "rows.read" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "tablesDBCreateTransaction", + "tags": [ + "tablesDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/tablesdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "tablesDBGetTransaction", + "tags": [ + "tablesDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.read", + "rows.read" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "tablesDBUpdateTransaction", + "tags": [ + "tablesDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "tablesDBDeleteTransaction", + "tags": [ + "tablesDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "tablesDBCreateOperations", + "tags": [ + "tablesDB" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "tablesdb\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "documents.write", + "rows.write" + ], + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tablesdb", + "demo": "tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/tableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "tableId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TABLE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Table name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "rowSecurity": { + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "columns": { + "description": "Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "indexes": { + "description": "Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC\/DESC, optional), and lengths (array of integers, optional).", + "type": "array", + "default": [], + "items": { + "type": "object" + } + } + }, + "required": [ + "tableId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Table name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "rowSecurity": { + "description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + }, + "purge": { + "description": "When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tables", + "demo": "tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read", + "columns.read", + "attributes.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/bigint": { + "post": { + "summary": "Create bigint column", + "operationId": "tablesDBCreateBigIntColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a bigint column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnBigInt", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBigint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-big-int-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 1000000, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/bigint\/{key}": { + "patch": { + "summary": "Update bigint column", + "operationId": "tablesDBUpdateBigIntColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a bigint column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnBigInt", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBigint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-big-int-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 1000000, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "boolean", + "example": false, + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "boolean", + "example": false, + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update datetime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "elements": { + "description": "Array of enum values.", + "type": "array", + "example": [ + "active", + "inactive" + ], + "items": { + "type": "string" + } + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "active", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "description": "Updated list of enum values.", + "type": "array", + "example": [ + "active", + "inactive" + ], + "items": { + "type": "string" + } + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "active", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when required.", + "type": "number", + "example": 10.5, + "format": "float", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when required.", + "type": "number", + "example": 10.5, + "format": "float", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 100, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "integer", + "example": 10, + "format": "int64", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "min": { + "description": "Minimum value", + "type": "integer", + "example": 0, + "format": "int64", + "nullable": true + }, + "max": { + "description": "Maximum value", + "type": "integer", + "example": 100, + "format": "int64", + "nullable": true + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "integer", + "example": 10, + "format": "int64", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "string", + "example": "192.0.2.0", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value. Cannot be set when column is required.", + "type": "string", + "example": "192.0.2.0", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "type": "array", + "example": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "type": "array", + "example": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/longtext": { + "post": { + "summary": "Create longtext column", + "operationId": "tablesDBCreateLongtextColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a longtext column.\n", + "responses": { + "202": { + "description": "ColumnLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLongtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-longtext-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/longtext\/{key}": { + "patch": { + "summary": "Update longtext column", + "operationId": "tablesDBUpdateLongtextColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a longtext column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLongtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-longtext-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/mediumtext": { + "post": { + "summary": "Create mediumtext column", + "operationId": "tablesDBCreateMediumtextColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a mediumtext column.\n", + "responses": { + "202": { + "description": "ColumnMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnMediumtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-mediumtext-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/mediumtext\/{key}": { + "patch": { + "summary": "Update mediumtext column", + "operationId": "tablesDBUpdateMediumtextColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a mediumtext column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnMediumtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-mediumtext-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "type": "array", + "example": [ + 1, + 2 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "type": "array", + "example": [ + 1, + 2 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "type": "array", + "example": [ + [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ], + [ + 1, + 2 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "type": "array", + "example": [ + [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5, + 6 + ], + [ + 1, + 2 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "description": "Related Table ID.", + "type": "string", + "example": "<RELATED_TABLE_ID>" + }, + "type": { + "description": "Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany.", + "type": "string", + "example": "oneToOne", + "title": "RelationshipType", + "oneOf": [ + { + "type": "string", + "enum": [ + "oneToOne" + ], + "title": "oneToOne" + }, + { + "type": "string", + "enum": [ + "manyToOne" + ], + "title": "manyToOne" + }, + { + "type": "string", + "enum": [ + "manyToMany" + ], + "title": "manyToMany" + }, + { + "type": "string", + "enum": [ + "oneToMany" + ], + "title": "oneToMany" + } + ] + }, + "twoWay": { + "description": "Is Two Way?", + "type": "boolean", + "default": false, + "example": false + }, + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>", + "nullable": true + }, + "twoWayKey": { + "description": "Two Way Column Key.", + "type": "string", + "example": "<TWO_WAY_KEY>", + "nullable": true + }, + "onDelete": { + "description": "Delete constraint. Possible values are: cascade, restrict, setNull.", + "type": "string", + "default": "restrict", + "example": "cascade", + "title": "RelationMutate", + "oneOf": [ + { + "type": "string", + "enum": [ + "cascade" + ], + "title": "cascade" + }, + { + "type": "string", + "enum": [ + "restrict" + ], + "title": "restrict" + }, + { + "type": "string", + "enum": [ + "setNull" + ], + "title": "setNull" + } + ] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.9.0", + "replaceWith": "tablesDB.createTextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "size": { + "description": "Column size for text columns, in number of characters.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "size": { + "description": "Maximum size of the string column.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/text": { + "post": { + "summary": "Create text column", + "operationId": "tablesDBCreateTextColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a text column.\n", + "responses": { + "202": { + "description": "ColumnText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnText" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-text-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/text\/{key}": { + "patch": { + "summary": "Update text column", + "operationId": "tablesDBUpdateTextColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a text column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnText" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-text-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "https:\/\/example.com", + "format": "url", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/varchar": { + "post": { + "summary": "Create varchar column", + "operationId": "tablesDBCreateVarcharColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a varchar column.\n", + "responses": { + "202": { + "description": "ColumnVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnVarchar" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/create-varchar-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Column Key.", + "type": "string", + "example": "<KEY>" + }, + "size": { + "description": "Column size for varchar columns, in number of characters. Maximum size is 16381.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "array": { + "description": "Is column an array?", + "type": "boolean", + "default": false, + "example": false + }, + "encrypt": { + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/varchar\/{key}": { + "patch": { + "summary": "Update varchar column", + "operationId": "tablesDBUpdateVarcharColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a varchar column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnVarchar" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-varchar-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "description": "Is column required?", + "type": "boolean", + "example": false + }, + "default": { + "description": "Default value for column when not provided. Cannot be set when column is required.", + "type": "string", + "example": "Hello World", + "nullable": true + }, + "size": { + "description": "Maximum size of the varchar column.", + "type": "integer", + "example": 1, + "format": "int32", + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/columnBoolean", + "integer": "#\/components\/schemas\/columnInteger", + "double": "#\/components\/schemas\/columnFloat", + "string": "#\/components\/schemas\/columnString", + "datetime": "#\/components\/schemas\/columnDatetime", + "relationship": "#\/components\/schemas\/columnRelationship" + }, + "x-mapping": { + "#\/components\/schemas\/columnBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/columnInteger": { + "type": "integer" + }, + "#\/components\/schemas\/columnFloat": { + "type": "double" + }, + "#\/components\/schemas\/columnEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/columnEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/columnUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/columnIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/columnDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/columnRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/columnString": { + "type": "string" + } + } + } + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read", + "columns.read", + "attributes.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "columns", + "demo": "tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "columns.write", + "attributes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "description": "Delete constraint. Possible values are: cascade, restrict, setNull.", + "type": "string", + "example": "cascade", + "title": "RelationMutate", + "oneOf": [ + { + "type": "string", + "enum": [ + "cascade" + ], + "title": "cascade" + }, + { + "type": "string", + "enum": [ + "restrict" + ], + "title": "restrict" + }, + { + "type": "string", + "enum": [ + "setNull" + ], + "title": "setNull" + } + ], + "nullable": true + }, + "newKey": { + "description": "New Column Key.", + "type": "string", + "example": "<NEW_KEY>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read", + "indexes.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "indexes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Index Key.", + "type": "string", + "example": "<KEY>" + }, + "type": { + "description": "Index type.", + "type": "string", + "example": "key", + "title": "TablesDBIndexType", + "oneOf": [ + { + "type": "string", + "enum": [ + "key" + ], + "title": "key" + }, + { + "type": "string", + "enum": [ + "fulltext" + ], + "title": "fulltext" + }, + { + "type": "string", + "enum": [ + "unique" + ], + "title": "unique" + }, + { + "type": "string", + "enum": [ + "spatial" + ], + "title": "spatial" + } + ] + }, + "columns": { + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "orders": { + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "type": "array", + "default": [], + "items": { + "title": "OrderBy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ] + } + }, + "lengths": { + "description": "Length of index. Maximum of 100", + "type": "array", + "default": [], + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read", + "indexes.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write", + "indexes.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/products\/databases\/tables#create-table).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md", + "public": true + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<ROW_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Row data as JSON object.", + "type": "object", + "default": {}, + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "rows": { + "description": "Array of rows data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "rowId", + "data" + ] + } + } + } + } + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rows": { + "description": "Array of row data as JSON objects. May contain partial rows.", + "type": "array", + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + }, + "required": [ + "rows" + ] + } + } + } + } + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "type": "object", + "default": [], + "example": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + } + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + }, + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/references\/cloud\/server-dart\/tablesDB#createTable).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string", + "example": "<COLUMN>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the column by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "min": { + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "type": "number", + "example": 0, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string", + "example": "<COLUMN>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "description": "Value to increment the column by. The value must be a number.", + "type": "number", + "default": 1, + "example": 1, + "format": "float" + }, + "max": { + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "type": "number", + "example": 100, + "format": "float", + "nullable": true + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + } + } + } + } + } + } + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TEAM_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Team name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "roles": { + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "type": "array", + "default": [ + "owner" + ], + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "New team name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/list-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/create-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "Email of the new team member.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "userId": { + "description": "ID of the user to be added to a team.", + "type": "string", + "default": "", + "example": "<USER_ID>" + }, + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "default": "", + "example": "+12065550100", + "format": "phone" + }, + "roles": { + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 81 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project 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.", + "type": "string", + "default": "", + "example": "https:\/\/example.com", + "format": "url" + }, + "name": { + "description": "Name of the new team member. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/get-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update team membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/update-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 81 characters long.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/delete-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "teams\/update-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "<USER_ID>" + }, + "secret": { + "description": "Secret key.", + "type": "string", + "example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update team preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "teams", + "demo": "teams\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "description": "Prefs key-value JSON object.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "tokens\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "files", + "demo": "tokens\/create-file-token.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "description": "Token expiry date", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "tokens\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "tokens\/update.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "description": "File token expiry date", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "tokens", + "demo": "tokens\/delete.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/userList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator, accessedAt", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email", + "nullable": true + }, + "phone": { + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "type": "string", + "example": "+12065550100", + "format": "phone", + "nullable": true + }, + "password": { + "description": "Plain text user password. Must be at least 8 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + } + } + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-argon-2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using Argon2.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using Bcrypt.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "identities", + "demo": "users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-md-5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using MD5.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-ph-pass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using PHPass.", + "type": "string", + "example": "password", + "format": "password" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using Scrypt.", + "type": "string", + "example": "password", + "format": "password" + }, + "passwordSalt": { + "description": "Optional salt used to hash password.", + "type": "string", + "example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "description": "Optional CPU cost used to hash password.", + "type": "integer", + "example": 8, + "format": "int32" + }, + "passwordMemory": { + "description": "Optional memory cost used to hash password.", + "type": "integer", + "example": 65536, + "format": "int32" + }, + "passwordParallel": { + "description": "Optional parallelization cost used to hash password.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "passwordLength": { + "description": "Optional hash length used to hash password.", + "type": "integer", + "example": 64, + "format": "int32" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + } + } + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using Scrypt Modified.", + "type": "string", + "example": "password", + "format": "password" + }, + "passwordSalt": { + "description": "Salt used to hash password.", + "type": "string", + "example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "description": "Salt separator used to hash password.", + "type": "string", + "example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "description": "Signer key used to hash password.", + "type": "string", + "example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + } + } + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<USER_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "password": { + "description": "User password hashed using SHA.", + "type": "string", + "example": "password", + "format": "password" + }, + "passwordVersion": { + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "type": "string", + "default": "", + "example": "sha1", + "title": "PasswordHash", + "oneOf": [ + { + "type": "string", + "enum": [ + "sha1" + ], + "title": "sha1" + }, + { + "type": "string", + "enum": [ + "sha224" + ], + "title": "sha224" + }, + { + "type": "string", + "enum": [ + "sha256" + ], + "title": "sha256" + }, + { + "type": "string", + "enum": [ + "sha384" + ], + "title": "sha384" + }, + { + "type": "string", + "enum": [ + "sha512\/224" + ], + "title": "sha512\/224" + }, + { + "type": "string", + "enum": [ + "sha512\/256" + ], + "title": "sha512\/256" + }, + { + "type": "string", + "enum": [ + "sha512" + ], + "title": "sha512" + }, + { + "type": "string", + "enum": [ + "sha3-224" + ], + "title": "sha3-224" + }, + { + "type": "string", + "enum": [ + "sha3-256" + ], + "title": "sha3-256" + }, + { + "type": "string", + "enum": [ + "sha3-384" + ], + "title": "sha3-384" + }, + { + "type": "string", + "enum": [ + "sha3-512" + ], + "title": "sha3-512" + } + ] + }, + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + } + }, + "required": [ + "email" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/impersonator": { + "patch": { + "summary": "Update user impersonator capability", + "operationId": "usersUpdateImpersonator", + "tags": [ + "users" + ], + "description": "Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-impersonator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "impersonator": { + "description": "Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.", + "type": "boolean", + "example": false + } + }, + "required": [ + "impersonator" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/create-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "sessionId": { + "description": "Session ID. Use the string 'recent()' to use the most recent session, which is also the default.", + "type": "string", + "default": "recent()", + "example": "recent()" + }, + "duration": { + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "type": "integer", + "default": 900, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "memberships", + "demo": "users\/list-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "users", + "demo": "users\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "description": "Enable or disable MFA.", + "type": "boolean", + "example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "example": "totp", + "title": "AuthenticatorType", + "oneOf": [ + { + "type": "string", + "enum": [ + "totp" + ], + "title": "totp" + } + ] + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/challenges\/{challengeId}": { + "get": { + "summary": "Get MFA challenge", + "operationId": "usersGetMFAChallenge", + "tags": [ + "users" + ], + "description": "Get a custom MFA challenge for a user, including the code to be delivered through your own channel.", + "responses": { + "200": { + "description": "MFA Challenge Secret", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallengeSecret" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "mfa", + "demo": "users\/get-mfa-challenge.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "getMFAChallenge", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "challengeId" + ], + "required": [ + "userId", + "challengeId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaChallengeSecret" + } + ], + "description": "", + "demo": "users\/get-mfa-challenge.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "challengeId", + "description": "ID of the challenge.", + "required": true, + "schema": { + "type": "string", + "example": "<CHALLENGE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "public": false + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "mfa", + "demo": "users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "User name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "description": "New user password. Must be at least 8 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "description": "User phone number.", + "type": "string", + "example": "+12065550100", + "format": "phone" + } + }, + "required": [ + "number" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "description": "Prefs key-value JSON object.", + "type": "object", + "default": {}, + "example": {} + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "users.read", + "sessions.read" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "users.write", + "sessions.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "schema": { + "type": "string", + "x-appwrite": { + "idGenerator": "ID.unique" + }, + "example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/delete-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "users.write", + "sessions.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/delete-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "users.write", + "sessions.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "schema": { + "type": "string", + "example": "<SESSION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "type": "boolean", + "example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/list-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<TARGET_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "providerType": { + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "type": "string", + "example": "email", + "title": "MessagingProviderType", + "oneOf": [ + { + "type": "string", + "enum": [ + "email" + ], + "title": "email" + }, + { + "type": "string", + "enum": [ + "sms" + ], + "title": "sms" + }, + { + "type": "string", + "enum": [ + "push" + ], + "title": "push" + } + ] + }, + "identifier": { + "description": "The target identifier (token, email, phone etc.)", + "type": "string", + "example": "<IDENTIFIER>" + }, + "providerId": { + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "type": "string", + "default": "", + "example": "<PROVIDER_ID>" + }, + "name": { + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "type": "string", + "default": "", + "example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/get-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "description": "The target identifier (token, email, phone etc.)", + "type": "string", + "default": "", + "example": "<IDENTIFIER>" + }, + "providerId": { + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "type": "string", + "default": "", + "example": "<PROVIDER_ID>" + }, + "name": { + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "type": "string", + "default": "", + "example": "<NAME>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "targets", + "demo": "users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TARGET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "length": { + "description": "Token length in characters. The default length is 6 characters", + "type": "integer", + "default": 6, + "example": 4, + "format": "int32" + }, + "expire": { + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "type": "integer", + "default": 900, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "description": "User email verification status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "users\/update-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "description": "User phone verification status.", + "type": "boolean", + "example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + } + } + } + }, + "\/vectorsdb": { + "get": { + "summary": "List databases", + "operationId": "vectorsDBList", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "vectorsDBCreate", + "tags": [ + "vectorsDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DATABASE_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/vectorsdb\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "vectorsDBListTransactions", + "tags": [ + "vectorsDB" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "vectorsDBCreateTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "description": "Seconds before the transaction expires.", + "type": "integer", + "default": 300, + "example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/vectorsdb\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "vectorsDBGetTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "vectorsDBUpdateTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "description": "Commit transaction?", + "type": "boolean", + "default": false, + "example": false + }, + "rollback": { + "description": "Rollback transaction?", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "vectorsDBDeleteTransaction", + "tags": [ + "vectorsDB" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vectorsdb\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "vectorsDBCreateOperations", + "tags": [ + "vectorsDB" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "transactions", + "demo": "vectorsdb\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "description": "Array of staged operations.", + "type": "array", + "default": [], + "example": [ + { + "action": "create", + "databaseId": "<DATABASE_ID>", + "collectionId": "<COLLECTION_ID>", + "documentId": "<DOCUMENT_ID>", + "data": { + "name": "Walter O'Brien" + } + } + ], + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "vectorsDBGet", + "tags": [ + "vectorsDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "vectorsDBUpdate", + "tags": [ + "vectorsDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Database name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "enabled": { + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "vectorsDBDelete", + "tags": [ + "vectorsDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "vectorsdb", + "demo": "vectorsdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vectorsdb\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "vectorsDBListCollections", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "VectorsDB Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vectorsdbCollectionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "example": "<SEARCH>", + "default": "" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collection", + "operationId": "vectorsDBCreateCollection", + "tags": [ + "vectorsDB" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "VectorsDB Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vectorsdbCollection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<COLLECTION_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "dimension": { + "description": "Embedding dimension.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "permissions": { + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "collectionId", + "name", + "dimension" + ] + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "vectorsDBGetCollection", + "tags": [ + "vectorsDB" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "VectorsDB Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vectorsdbCollection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "vectorsDBUpdateCollection", + "tags": [ + "vectorsDB" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "VectorsDB Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vectorsdbCollection" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Collection name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "dimension": { + "description": "Embedding dimensions.", + "type": "integer", + "example": 1, + "format": "int32" + }, + "permissions": { + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documentSecurity": { + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "boolean", + "default": false, + "example": false + }, + "enabled": { + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "type": "boolean", + "default": true, + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "vectorsDBDeleteCollection", + "tags": [ + "vectorsDB" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "collections", + "demo": "vectorsdb\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "vectorsDBListDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 524288 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + }, + { + "name": "ttl", + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 0 + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "vectorsDBCreateDocument", + "tags": [ + "vectorsDB" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "createDocument", + "namespace": "vectorsDB", + "desc": "Create document", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "vectorsdb\/create-document.md", + "public": true + }, + { + "name": "createDocuments", + "namespace": "vectorsDB", + "desc": "Create documents", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "vectorsdb\/create-documents.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<DOCUMENT_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "data": { + "description": "Document data as JSON object.", + "type": "object", + "default": {}, + "example": { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + } + }, + "permissions": { + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "documents": { + "description": "Array of documents data as JSON objects.", + "type": "array", + "default": [], + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documentId", + "data" + ] + } + } + } + } + }, + "put": { + "summary": "Upsert documents", + "operationId": "vectorsDBUpsertDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "vectorsDB", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.\n", + "demo": "vectorsdb\/upsert-documents.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "description": "Array of document data as JSON objects. May contain partial documents.", + "type": "array", + "items": { + "type": "object" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "vectorsDBUpdateDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "vectorsDBDeleteDocuments", + "tags": [ + "vectorsDB" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents\/query": { + "post": { + "summary": "Create query", + "operationId": "vectorsDBCreateQuery", + "tags": [ + "vectorsDB" + ], + "description": "Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/create-query.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 524288 characters long.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID to read uncommitted changes within the transaction.", + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "total": { + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "type": "boolean", + "default": true, + "example": false + }, + "ttl": { + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "vectorsDBGetDocument", + "tags": [ + "vectorsDB" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "transactionId", + "description": "Transaction ID to read uncommitted changes within the transaction.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "vectorsDBUpsertDocument", + "tags": [ + "vectorsDB" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "methods": [ + { + "name": "upsertDocument", + "namespace": "vectorsDB", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions", + "transactionId" + ], + "required": [ + "databaseId", + "collectionId", + "documentId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#documentsDBCreateCollection) API or directly from your database console.", + "demo": "vectorsdb\/upsert-document.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-appwrite": { + "idGenerator": "ID.unique" + }, + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include all required fields of the document to be created or updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "vectorsDBUpdateDocument", + "tags": [ + "vectorsDB" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "description": "Document data as JSON object. Include only fields and value pairs to be updated.", + "type": "object", + "default": [], + "example": {} + }, + "permissions": { + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "type": "array", + "example": [ + "read(\"any\")" + ], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID for staging the operation.", + "type": "string", + "example": "<TRANSACTION_ID>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "vectorsDBDeleteDocument", + "tags": [ + "vectorsDB" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "vectorsdb\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "vectorsdb.documents.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "transactionId", + "description": "Transaction ID for staging the operation.", + "required": false, + "schema": { + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "in": "query" + } + ] + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "vectorsDBListIndexes", + "tags": [ + "vectorsDB" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "vectorsdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.indexes.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "vectorsDBCreateIndex", + "tags": [ + "vectorsDB" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "vectorsdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.indexes.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "Index Key.", + "type": "string", + "example": "<KEY>" + }, + "type": { + "description": "Index type.", + "type": "string", + "example": "hnsw_euclidean", + "title": "VectorsDBIndexType", + "oneOf": [ + { + "type": "string", + "enum": [ + "hnsw_euclidean" + ], + "title": "hnsw_euclidean" + }, + { + "type": "string", + "enum": [ + "hnsw_dot" + ], + "title": "hnsw_dot" + }, + { + "type": "string", + "enum": [ + "hnsw_cosine" + ], + "title": "hnsw_cosine" + }, + { + "type": "string", + "enum": [ + "object" + ], + "title": "object" + }, + { + "type": "string", + "enum": [ + "key" + ], + "title": "key" + }, + { + "type": "string", + "enum": [ + "unique" + ], + "title": "unique" + } + ] + }, + "attributes": { + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "type": "array", + "items": { + "type": "string" + } + }, + "orders": { + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "type": "array", + "default": [], + "items": { + "title": "OrderBy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "asc" + ], + "title": "asc" + }, + { + "type": "string", + "enum": [ + "desc" + ], + "title": "desc" + } + ] + } + }, + "lengths": { + "description": "Length of index. Maximum of 100", + "type": "array", + "default": [], + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/vectorsdb\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "vectorsDBGetIndex", + "tags": [ + "vectorsDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "vectorsdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.indexes.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "vectorsDBDeleteIndex", + "tags": [ + "vectorsDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": "indexes", + "demo": "vectorsdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vectorsdb.indexes.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string", + "example": "<KEY>" + }, + "in": "path" + } + ] + } + }, + "\/webhooks": { + "get": { + "summary": "List webhooks", + "operationId": "webhooksList", + "tags": [ + "webhooks" + ], + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Webhooks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhookList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create webhook", + "operationId": "webhooksCreate", + "tags": [ + "webhooks" + ], + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur.", + "responses": { + "201": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "webhookId": { + "description": "Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "<WEBHOOK_ID>", + "x-appwrite": { + "idGenerator": "ID.unique" + } + }, + "url": { + "description": "Webhook URL.", + "type": "string", + "example": "https:\/\/example.com\/webhook" + }, + "name": { + "description": "Webhook name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "events": { + "description": "Events list. Maximum of 100 events are allowed.", + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "description": "Enable or disable a webhook.", + "type": "boolean", + "default": true, + "example": false + }, + "tls": { + "description": "Certificate verification, false for disabled or true for enabled.", + "type": "boolean", + "default": false, + "example": false + }, + "authUsername": { + "description": "Webhook HTTP user. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "<AUTH_USERNAME>" + }, + "authPassword": { + "description": "Webhook HTTP password. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + }, + "secret": { + "description": "Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.", + "type": "string", + "example": "<SECRET>", + "nullable": true + } + }, + "required": [ + "webhookId", + "url", + "name", + "events" + ] + } + } + } + } + } + }, + "\/webhooks\/{webhookId}": { + "get": { + "summary": "Get webhook", + "operationId": "webhooksGet", + "tags": [ + "webhooks" + ], + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "webhookId", + "description": "Webhook ID.", + "required": true, + "schema": { + "type": "string", + "example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update webhook", + "operationId": "webhooksUpdate", + "tags": [ + "webhooks" + ], + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "webhookId", + "description": "Webhook ID.", + "required": true, + "schema": { + "type": "string", + "example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Webhook name. Max length: 128 chars.", + "type": "string", + "example": "<NAME>" + }, + "url": { + "description": "Webhook URL.", + "type": "string", + "example": "https:\/\/example.com\/webhook" + }, + "events": { + "description": "Events list. Maximum of 100 events are allowed.", + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "description": "Enable or disable a webhook.", + "type": "boolean", + "default": true, + "example": false + }, + "tls": { + "description": "Certificate verification, false for disabled or true for enabled.", + "type": "boolean", + "default": false, + "example": false + }, + "authUsername": { + "description": "Webhook HTTP user. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "<AUTH_USERNAME>" + }, + "authPassword": { + "description": "Webhook HTTP password. Max length: 256 chars.", + "type": "string", + "default": "", + "example": "password", + "format": "password" + } + }, + "required": [ + "name", + "url", + "events" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete webhook", + "operationId": "webhooksDelete", + "tags": [ + "webhooks" + ], + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "webhookId", + "description": "Webhook ID.", + "required": true, + "schema": { + "type": "string", + "example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + } + }, + "\/webhooks\/{webhookId}\/secret": { + "patch": { + "summary": "Update webhook secret key", + "operationId": "webhooksUpdateSecret", + "tags": [ + "webhooks" + ], + "description": "Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "webhooks\/update-secret.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "webhooks.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "webhookId", + "description": "Webhook ID.", + "required": true, + "schema": { + "type": "string", + "example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "secret": { + "description": "Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.", + "type": "string", + "example": "<SECRET>", + "nullable": true + } + } + } + } + } + } + } + } + }, + "tags": [ + { + "name": "ping", + "description": "" + }, + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesDB", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "documentsDB", + "description": "" + }, + { + "name": "vectorsDB", + "description": "" + }, + { + "name": "presences", + "description": "The Presences service allows you to track and manage real-time user presence in your project." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "tokens", + "description": "The Tokens service allows you to create and manage resource tokens for secure file access." + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "webhooks", + "description": "The Webhooks service allows you to manage your project webhooks." + }, + { + "name": "organization", + "description": "The Organization service allows you to manage organization-level projects." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "advisor", + "description": "The Advisor service surfaces actionable reports about your project resources, with CTA descriptors for one-click remediation in the console." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "embeddings", + "description": "" + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant information." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": {} + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "format": "int32", + "example": 5 + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "example": [] + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "format": "int32", + "example": 5 + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "example": [] + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "presenceList": { + "description": "Presences List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of presences that matched your query.", + "format": "int32", + "example": 5 + }, + "presences": { + "type": "array", + "description": "List of presences.", + "items": { + "$ref": "#\/components\/schemas\/presence" + }, + "example": [] + } + }, + "required": [ + "total", + "presences" + ], + "example": { + "total": 5, + "presences": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "format": "int32", + "example": 5 + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "$ref": "#\/components\/schemas\/table" + }, + "example": [] + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections that matched your query.", + "format": "int32", + "example": 5 + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "$ref": "#\/components\/schemas\/collection" + }, + "example": [] + } + }, + "required": [ + "total", + "collections" + ], + "example": { + "total": 5, + "collections": "" + } + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases that matched your query.", + "format": "int32", + "example": 5 + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "$ref": "#\/components\/schemas\/database" + }, + "example": [] + } + }, + "required": [ + "total", + "databases" + ], + "example": { + "total": 5, + "databases": "" + } + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "format": "int32", + "example": 5 + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "example": [] + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "format": "int32", + "example": 5 + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "example": [] + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users that matched your query.", + "format": "int32", + "example": 5 + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "$ref": "#\/components\/schemas\/user" + }, + "example": [] + } + }, + "required": [ + "total", + "users" + ], + "example": { + "total": 5, + "users": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "format": "int32", + "example": 5 + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "example": [] + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "format": "int32", + "example": 5 + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "example": [] + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "format": "int32", + "example": 5 + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "example": [] + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets that matched your query.", + "format": "int32", + "example": 5 + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "$ref": "#\/components\/schemas\/bucket" + }, + "example": [] + } + }, + "required": [ + "total", + "buckets" + ], + "example": { + "total": 5, + "buckets": "" + } + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens that matched your query.", + "format": "int32", + "example": 5 + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "example": [] + } + }, + "required": [ + "total", + "tokens" + ], + "example": { + "total": 5, + "tokens": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "format": "int32", + "example": 5 + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "example": [] + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "format": "int32", + "example": 5 + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "example": [] + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites that matched your query.", + "format": "int32", + "example": 5 + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "$ref": "#\/components\/schemas\/site" + }, + "example": [] + } + }, + "required": [ + "total", + "sites" + ], + "example": { + "total": 5, + "sites": "" + } + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions that matched your query.", + "format": "int32", + "example": 5 + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "$ref": "#\/components\/schemas\/function" + }, + "example": [] + } + }, + "required": [ + "total", + "functions" + ], + "example": { + "total": 5, + "functions": "" + } + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks that matched your query.", + "format": "int32", + "example": 5 + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "$ref": "#\/components\/schemas\/framework" + }, + "example": [] + } + }, + "required": [ + "total", + "frameworks" + ], + "example": { + "total": 5, + "frameworks": "" + } + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes that matched your query.", + "format": "int32", + "example": 5 + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "$ref": "#\/components\/schemas\/runtime" + }, + "example": [] + } + }, + "required": [ + "total", + "runtimes" + ], + "example": { + "total": 5, + "runtimes": "" + } + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments that matched your query.", + "format": "int32", + "example": 5 + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "$ref": "#\/components\/schemas\/deployment" + }, + "example": [] + } + }, + "required": [ + "total", + "deployments" + ], + "example": { + "total": 5, + "deployments": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "format": "int32", + "example": 5 + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "example": [] + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "projectList": { + "description": "Projects List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of projects that matched your query.", + "format": "int32", + "example": 5 + }, + "projects": { + "type": "array", + "description": "List of projects.", + "items": { + "$ref": "#\/components\/schemas\/project" + }, + "example": [] + } + }, + "required": [ + "total", + "projects" + ], + "example": { + "total": 5, + "projects": "" + } + }, + "webhookList": { + "description": "Webhooks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of webhooks that matched your query.", + "format": "int32", + "example": 5 + }, + "webhooks": { + "type": "array", + "description": "List of webhooks.", + "items": { + "$ref": "#\/components\/schemas\/webhook" + }, + "example": [] + } + }, + "required": [ + "total", + "webhooks" + ], + "example": { + "total": 5, + "webhooks": "" + } + }, + "keyList": { + "description": "API Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys that matched your query.", + "format": "int32", + "example": 5 + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { + "$ref": "#\/components\/schemas\/key" + }, + "example": [] + } + }, + "required": [ + "total", + "keys" + ], + "example": { + "total": 5, + "keys": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "format": "int32", + "example": 5 + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "example": [] + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "format": "int32", + "example": 5 + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "example": [] + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "format": "int32", + "example": 5 + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "example": [] + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "format": "int32", + "example": 5 + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "example": [] + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "format": "int32", + "example": 5 + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "example": [] + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables that matched your query.", + "format": "int32", + "example": 5 + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "example": [] + } + }, + "required": [ + "total", + "variables" + ], + "example": { + "total": 5, + "variables": "" + } + }, + "mockNumberList": { + "description": "Mock Numbers List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of mockNumbers that matched your query.", + "format": "int32", + "example": 5 + }, + "mockNumbers": { + "type": "array", + "description": "List of mockNumbers.", + "items": { + "$ref": "#\/components\/schemas\/mockNumber" + }, + "example": [] + } + }, + "required": [ + "total", + "mockNumbers" + ], + "example": { + "total": 5, + "mockNumbers": "" + } + }, + "policyList": { + "description": "Policies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of policies in the given project.", + "format": "int32", + "example": 10 + }, + "policies": { + "type": "array", + "description": "List of policies.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/policyPasswordDictionary" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordHistory" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordStrength" + }, + { + "$ref": "#\/components\/schemas\/policyPasswordPersonalData" + }, + { + "$ref": "#\/components\/schemas\/policySessionAlert" + }, + { + "$ref": "#\/components\/schemas\/policySessionDuration" + }, + { + "$ref": "#\/components\/schemas\/policySessionInvalidation" + }, + { + "$ref": "#\/components\/schemas\/policySessionLimit" + }, + { + "$ref": "#\/components\/schemas\/policyUserLimit" + }, + { + "$ref": "#\/components\/schemas\/policyMembershipPrivacy" + }, + { + "$ref": "#\/components\/schemas\/policyMfaFactors" + } + ], + "discriminator": { + "propertyName": "$id", + "mapping": { + "password-dictionary": "#\/components\/schemas\/policyPasswordDictionary", + "password-history": "#\/components\/schemas\/policyPasswordHistory", + "password-strength": "#\/components\/schemas\/policyPasswordStrength", + "password-personal-data": "#\/components\/schemas\/policyPasswordPersonalData", + "session-alert": "#\/components\/schemas\/policySessionAlert", + "session-duration": "#\/components\/schemas\/policySessionDuration", + "session-invalidation": "#\/components\/schemas\/policySessionInvalidation", + "session-limit": "#\/components\/schemas\/policySessionLimit", + "user-limit": "#\/components\/schemas\/policyUserLimit", + "membership-privacy": "#\/components\/schemas\/policyMembershipPrivacy", + "mfa-factors": "#\/components\/schemas\/policyMfaFactors" + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "policies" + ], + "example": { + "total": 10, + "policies": "" + } + }, + "emailTemplateList": { + "description": "Email Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates that matched your query.", + "format": "int32", + "example": 5 + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "$ref": "#\/components\/schemas\/emailTemplate" + }, + "example": [] + } + }, + "required": [ + "total", + "templates" + ], + "example": { + "total": 5, + "templates": "" + } + }, + "proxyRuleList": { + "description": "Rule List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rules that matched your query.", + "format": "int32", + "example": 5 + }, + "rules": { + "type": "array", + "description": "List of rules.", + "items": { + "$ref": "#\/components\/schemas\/proxyRule" + }, + "example": [] + } + }, + "required": [ + "total", + "rules" + ], + "example": { + "total": 5, + "rules": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "format": "int32", + "example": 5 + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "example": [] + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers that matched your query.", + "format": "int32", + "example": 5 + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "$ref": "#\/components\/schemas\/provider" + }, + "example": [] + } + }, + "required": [ + "total", + "providers" + ], + "example": { + "total": 5, + "providers": "" + } + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages that matched your query.", + "format": "int32", + "example": 5 + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "$ref": "#\/components\/schemas\/message" + }, + "example": [] + } + }, + "required": [ + "total", + "messages" + ], + "example": { + "total": 5, + "messages": "" + } + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics that matched your query.", + "format": "int32", + "example": 5 + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "$ref": "#\/components\/schemas\/topic" + }, + "example": [] + } + }, + "required": [ + "total", + "topics" + ], + "example": { + "total": 5, + "topics": "" + } + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers that matched your query.", + "format": "int32", + "example": 5 + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "$ref": "#\/components\/schemas\/subscriber" + }, + "example": [] + } + }, + "required": [ + "total", + "subscribers" + ], + "example": { + "total": 5, + "subscribers": "" + } + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets that matched your query.", + "format": "int32", + "example": 5 + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "example": [] + } + }, + "required": [ + "total", + "targets" + ], + "example": { + "total": 5, + "targets": "" + } + }, + "transactionList": { + "description": "Transaction List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of transactions that matched your query.", + "format": "int32", + "example": 5 + }, + "transactions": { + "type": "array", + "description": "List of transactions.", + "items": { + "$ref": "#\/components\/schemas\/transaction" + }, + "example": [] + } + }, + "required": [ + "total", + "transactions" + ], + "example": { + "total": 5, + "transactions": "" + } + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications that matched your query.", + "format": "int32", + "example": 5 + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "$ref": "#\/components\/schemas\/specification" + }, + "example": [] + } + }, + "required": [ + "total", + "specifications" + ], + "example": { + "total": 5, + "specifications": "" + } + }, + "vectorsdbCollectionList": { + "description": "VectorsDB Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections that matched your query.", + "format": "int32", + "example": 5 + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "$ref": "#\/components\/schemas\/vectorsdbCollection" + }, + "example": [] + } + }, + "required": [ + "total", + "collections" + ], + "example": { + "total": 5, + "collections": "" + } + }, + "embeddingList": { + "description": "Embedding list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of embeddings that matched your query.", + "format": "int32", + "example": 5 + }, + "embeddings": { + "type": "array", + "description": "List of embeddings.", + "items": { + "$ref": "#\/components\/schemas\/embedding" + }, + "example": [] + } + }, + "required": [ + "total", + "embeddings" + ], + "example": { + "total": 5, + "embeddings": "" + } + }, + "insightList": { + "description": "Insights List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of insights that matched your query.", + "format": "int32", + "example": 5 + }, + "insights": { + "type": "array", + "description": "List of insights.", + "items": { + "$ref": "#\/components\/schemas\/insight" + }, + "example": [] + } + }, + "required": [ + "total", + "insights" + ], + "example": { + "total": 5, + "insights": "" + } + }, + "reportList": { + "description": "Reports List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of reports that matched your query.", + "format": "int32", + "example": 5 + }, + "reports": { + "type": "array", + "description": "List of reports.", + "items": { + "$ref": "#\/components\/schemas\/report" + }, + "example": [] + } + }, + "required": [ + "total", + "reports" + ], + "example": { + "total": 5, + "reports": "" + } + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "example": false + }, + "type": { + "description": "Database type.", + "example": "legacy", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "legacy" + ], + "title": "legacy" + }, + { + "type": "string", + "enum": [ + "tablesdb" + ], + "title": "tablesdb" + }, + { + "type": "string", + "enum": [ + "documentsdb" + ], + "title": "documentsdb" + }, + { + "type": "string", + "enum": [ + "vectorsdb" + ], + "title": "vectorsdb" + } + ] + }, + "status": { + "description": "Database status. Possible values: `provisioning`, `ready` or `failed`", + "example": "ready", + "title": "DatabaseStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "provisioning" + ], + "title": "provisioning" + }, + { + "type": "string", + "enum": [ + "ready" + ], + "title": "ready" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ], + "nullable": true + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy", + "status": "ready" + } + }, + "embedding": { + "description": "Embedding", + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "Embedding model used to generate embeddings.", + "example": "nomic-embed-text" + }, + "dimension": { + "type": "integer", + "description": "Number of dimensions for each embedding vector.", + "format": "int32", + "example": 768 + }, + "embedding": { + "type": "array", + "description": "Embedding vector values. If an error occurs, this will be an empty array.", + "items": { + "type": "number", + "format": "double" + }, + "example": [ + 0.01, + 0.02, + 0.03 + ] + }, + "error": { + "type": "string", + "description": "Error message if embedding generation fails. Empty string if no error.", + "example": "Error message" + } + }, + "required": [ + "model", + "dimension", + "embedding", + "error" + ], + "example": { + "model": "nomic-embed-text", + "dimension": 768, + "embedding": [ + 0.01, + 0.02, + 0.03 + ], + "error": "Error message" + } + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeBigint" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, + { + "$ref": "#\/components\/schemas\/attributeVarchar" + }, + { + "$ref": "#\/components\/schemas\/attributeText" + }, + { + "$ref": "#\/components\/schemas\/attributeMediumtext" + }, + { + "$ref": "#\/components\/schemas\/attributeLongtext" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/attributeBoolean", + "bigint": "#\/components\/schemas\/attributeBigint", + "integer": "#\/components\/schemas\/attributeInteger", + "double": "#\/components\/schemas\/attributeFloat", + "string": "#\/components\/schemas\/attributeString", + "datetime": "#\/components\/schemas\/attributeDatetime", + "relationship": "#\/components\/schemas\/attributeRelationship", + "point": "#\/components\/schemas\/attributePoint", + "linestring": "#\/components\/schemas\/attributeLine", + "polygon": "#\/components\/schemas\/attributePolygon", + "varchar": "#\/components\/schemas\/attributeVarchar", + "text": "#\/components\/schemas\/attributeText", + "mediumtext": "#\/components\/schemas\/attributeMediumtext", + "longtext": "#\/components\/schemas\/attributeLongtext" + }, + "x-mapping": { + "#\/components\/schemas\/attributeBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/attributeBigint": { + "type": "bigint" + }, + "#\/components\/schemas\/attributeInteger": { + "type": "integer" + }, + "#\/components\/schemas\/attributeFloat": { + "type": "double" + }, + "#\/components\/schemas\/attributeEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/attributeEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/attributeUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/attributeIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/attributeDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/attributeRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/attributePoint": { + "type": "point" + }, + "#\/components\/schemas\/attributeLine": { + "type": "linestring" + }, + "#\/components\/schemas\/attributePolygon": { + "type": "polygon" + }, + "#\/components\/schemas\/attributeVarchar": { + "type": "varchar" + }, + "#\/components\/schemas\/attributeText": { + "type": "text" + }, + "#\/components\/schemas\/attributeMediumtext": { + "type": "mediumtext" + }, + "#\/components\/schemas\/attributeLongtext": { + "type": "longtext" + }, + "#\/components\/schemas\/attributeString": { + "type": "string" + } + } + } + }, + "example": [] + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "example": [] + }, + "bytesMax": { + "type": "integer", + "description": "Maximum document size in bytes. Returns 0 when no limit applies.", + "format": "int32", + "example": 65535 + }, + "bytesUsed": { + "type": "integer", + "description": "Currently used document size in bytes based on defined attributes.", + "format": "int32", + "example": 1500 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes", + "bytesMax", + "bytesUsed" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {}, + "bytesMax": 65535, + "bytesUsed": 1500 + } + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "format": "int32", + "example": 5 + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeBigint" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, + { + "$ref": "#\/components\/schemas\/attributeVarchar" + }, + { + "$ref": "#\/components\/schemas\/attributeText" + }, + { + "$ref": "#\/components\/schemas\/attributeMediumtext" + }, + { + "$ref": "#\/components\/schemas\/attributeLongtext" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/attributeBoolean", + "bigint": "#\/components\/schemas\/attributeBigint", + "integer": "#\/components\/schemas\/attributeInteger", + "double": "#\/components\/schemas\/attributeFloat", + "string": "#\/components\/schemas\/attributeString", + "datetime": "#\/components\/schemas\/attributeDatetime", + "relationship": "#\/components\/schemas\/attributeRelationship", + "point": "#\/components\/schemas\/attributePoint", + "linestring": "#\/components\/schemas\/attributeLine", + "polygon": "#\/components\/schemas\/attributePolygon", + "varchar": "#\/components\/schemas\/attributeVarchar", + "text": "#\/components\/schemas\/attributeText", + "mediumtext": "#\/components\/schemas\/attributeMediumtext", + "longtext": "#\/components\/schemas\/attributeLongtext" + }, + "x-mapping": { + "#\/components\/schemas\/attributeBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/attributeBigint": { + "type": "bigint" + }, + "#\/components\/schemas\/attributeInteger": { + "type": "integer" + }, + "#\/components\/schemas\/attributeFloat": { + "type": "double" + }, + "#\/components\/schemas\/attributeEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/attributeEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/attributeUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/attributeIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/attributeDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/attributeRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/attributePoint": { + "type": "point" + }, + "#\/components\/schemas\/attributeLine": { + "type": "linestring" + }, + "#\/components\/schemas\/attributePolygon": { + "type": "polygon" + }, + "#\/components\/schemas\/attributeVarchar": { + "type": "varchar" + }, + "#\/components\/schemas\/attributeText": { + "type": "text" + }, + "#\/components\/schemas\/attributeMediumtext": { + "type": "mediumtext" + }, + "#\/components\/schemas\/attributeLongtext": { + "type": "longtext" + }, + "#\/components\/schemas\/attributeString": { + "type": "string" + } + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "attributes" + ], + "example": { + "total": 5, + "attributes": "" + } + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "format": "int32", + "example": 128 + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "integer" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "format": "int64", + "example": 1, + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "format": "int64", + "example": 10, + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "format": "int32", + "example": 10, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "attributeBigint": { + "description": "AttributeBigInt", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "bigint" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "format": "int64", + "example": 1, + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "format": "int64", + "example": 10, + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "format": "int64", + "example": 10, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "bigint", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "double" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "format": "double", + "example": 1.5, + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "format": "double", + "example": 10.5, + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "format": "double", + "example": 2.5, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "boolean" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "example": [ + "element" + ] + }, + "format": { + "type": "string", + "description": "String format.", + "example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "http:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "datetime" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": [ + 0, + 0 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "attributeVarchar": { + "description": "AttributeVarchar", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "format": "int32", + "example": 128 + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "attributeText": { + "description": "AttributeText", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "attributeMediumtext": { + "description": "AttributeMediumtext", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "attributeLongtext": { + "description": "AttributeLongtext", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "vectorsdbCollection": { + "description": "VectorsDB Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeObject" + }, + { + "$ref": "#\/components\/schemas\/attributeVector" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "object": "#\/components\/schemas\/attributeObject", + "vector": "#\/components\/schemas\/attributeVector" + } + } + }, + "example": [] + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "example": [] + }, + "bytesMax": { + "type": "integer", + "description": "Maximum document size in bytes. Returns 0 when no limit applies.", + "format": "int32", + "example": 65535 + }, + "bytesUsed": { + "type": "integer", + "description": "Currently used document size in bytes based on defined attributes.", + "format": "int32", + "example": 1500 + }, + "dimension": { + "type": "integer", + "description": "Embedding dimension.", + "format": "int32", + "example": 1536 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes", + "bytesMax", + "bytesUsed", + "dimension" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {}, + "bytesMax": 65535, + "bytesUsed": 1500, + "dimension": 1536 + } + }, + "attributeObject": { + "description": "AttributeObject", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "attributeVector": { + "description": "AttributeVector", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "example": "string" + }, + "status": { + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "AttributeStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Vector dimensions.", + "format": "int32", + "example": 1536 + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 1536 + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnBigint" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnVarchar" + }, + { + "$ref": "#\/components\/schemas\/columnText" + }, + { + "$ref": "#\/components\/schemas\/columnMediumtext" + }, + { + "$ref": "#\/components\/schemas\/columnLongtext" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/columnBoolean", + "bigint": "#\/components\/schemas\/columnBigint", + "integer": "#\/components\/schemas\/columnInteger", + "double": "#\/components\/schemas\/columnFloat", + "string": "#\/components\/schemas\/columnString", + "datetime": "#\/components\/schemas\/columnDatetime", + "relationship": "#\/components\/schemas\/columnRelationship", + "point": "#\/components\/schemas\/columnPoint", + "linestring": "#\/components\/schemas\/columnLine", + "polygon": "#\/components\/schemas\/columnPolygon", + "varchar": "#\/components\/schemas\/columnVarchar", + "text": "#\/components\/schemas\/columnText", + "mediumtext": "#\/components\/schemas\/columnMediumtext", + "longtext": "#\/components\/schemas\/columnLongtext" + }, + "x-mapping": { + "#\/components\/schemas\/columnBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/columnBigint": { + "type": "bigint" + }, + "#\/components\/schemas\/columnInteger": { + "type": "integer" + }, + "#\/components\/schemas\/columnFloat": { + "type": "double" + }, + "#\/components\/schemas\/columnEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/columnEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/columnUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/columnIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/columnDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/columnRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/columnPoint": { + "type": "point" + }, + "#\/components\/schemas\/columnLine": { + "type": "linestring" + }, + "#\/components\/schemas\/columnPolygon": { + "type": "polygon" + }, + "#\/components\/schemas\/columnVarchar": { + "type": "varchar" + }, + "#\/components\/schemas\/columnText": { + "type": "text" + }, + "#\/components\/schemas\/columnMediumtext": { + "type": "mediumtext" + }, + "#\/components\/schemas\/columnLongtext": { + "type": "longtext" + }, + "#\/components\/schemas\/columnString": { + "type": "string" + } + } + } + }, + "example": [] + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "example": [] + }, + "bytesMax": { + "type": "integer", + "description": "Maximum row size in bytes. Returns 0 when no limit applies.", + "format": "int32", + "example": 65535 + }, + "bytesUsed": { + "type": "integer", + "description": "Currently used row size in bytes based on defined columns.", + "format": "int32", + "example": 1500 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes", + "bytesMax", + "bytesUsed" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {}, + "bytesMax": 65535, + "bytesUsed": 1500 + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "format": "int32", + "example": 5 + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnBigint" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnVarchar" + }, + { + "$ref": "#\/components\/schemas\/columnText" + }, + { + "$ref": "#\/components\/schemas\/columnMediumtext" + }, + { + "$ref": "#\/components\/schemas\/columnLongtext" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "boolean": "#\/components\/schemas\/columnBoolean", + "bigint": "#\/components\/schemas\/columnBigint", + "integer": "#\/components\/schemas\/columnInteger", + "double": "#\/components\/schemas\/columnFloat", + "string": "#\/components\/schemas\/columnString", + "datetime": "#\/components\/schemas\/columnDatetime", + "relationship": "#\/components\/schemas\/columnRelationship", + "point": "#\/components\/schemas\/columnPoint", + "linestring": "#\/components\/schemas\/columnLine", + "polygon": "#\/components\/schemas\/columnPolygon", + "varchar": "#\/components\/schemas\/columnVarchar", + "text": "#\/components\/schemas\/columnText", + "mediumtext": "#\/components\/schemas\/columnMediumtext", + "longtext": "#\/components\/schemas\/columnLongtext" + }, + "x-mapping": { + "#\/components\/schemas\/columnBoolean": { + "type": "boolean" + }, + "#\/components\/schemas\/columnBigint": { + "type": "bigint" + }, + "#\/components\/schemas\/columnInteger": { + "type": "integer" + }, + "#\/components\/schemas\/columnFloat": { + "type": "double" + }, + "#\/components\/schemas\/columnEmail": { + "type": "string", + "format": "email" + }, + "#\/components\/schemas\/columnEnum": { + "type": "string", + "format": "enum" + }, + "#\/components\/schemas\/columnUrl": { + "type": "string", + "format": "url" + }, + "#\/components\/schemas\/columnIp": { + "type": "string", + "format": "ip" + }, + "#\/components\/schemas\/columnDatetime": { + "type": "datetime" + }, + "#\/components\/schemas\/columnRelationship": { + "type": "relationship" + }, + "#\/components\/schemas\/columnPoint": { + "type": "point" + }, + "#\/components\/schemas\/columnLine": { + "type": "linestring" + }, + "#\/components\/schemas\/columnPolygon": { + "type": "polygon" + }, + "#\/components\/schemas\/columnVarchar": { + "type": "varchar" + }, + "#\/components\/schemas\/columnText": { + "type": "text" + }, + "#\/components\/schemas\/columnMediumtext": { + "type": "mediumtext" + }, + "#\/components\/schemas\/columnLongtext": { + "type": "longtext" + }, + "#\/components\/schemas\/columnString": { + "type": "string" + } + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "format": "int32", + "example": 128 + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "integer" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "format": "int64", + "example": 1, + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "format": "int64", + "example": 10, + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "format": "int32", + "example": 10, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnBigint": { + "description": "ColumnBigInt", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "bigint" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "format": "int64", + "example": 1, + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "format": "int64", + "example": 10, + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "format": "int64", + "example": 10, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "bigint", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "double" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "format": "double", + "example": 1.5, + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "format": "double", + "example": 10.5, + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "format": "double", + "example": 2.5, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "boolean" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "example": [ + "element" + ] + }, + "format": { + "type": "string", + "description": "String format.", + "example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "https:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "datetime" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": [ + 0, + 0 + ], + "items": { + "type": "number", + "format": "double" + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "columnVarchar": { + "description": "ColumnVarchar", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "format": "int32", + "example": 128 + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnText": { + "description": "ColumnText", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "columnMediumtext": { + "description": "ColumnMediumtext", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "columnLongtext": { + "description": "ColumnLongtext", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "example": "string" + }, + "status": { + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "title": "ColumnStatus", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "default", + "encrypt": false + } + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index key.", + "example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "example": "primary" + }, + "status": { + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "available" + ], + "title": "available" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "deleting" + ], + "title": "deleting" + }, + { + "type": "string", + "enum": [ + "stuck" + ], + "title": "stuck" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "example": [], + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "example": [], + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "string", + "description": "Row sequence ID.", + "readOnly": true, + "example": "1" + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": "1", + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "string", + "description": "Document sequence ID.", + "readOnly": true, + "example": "1" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "readOnly": true, + "example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": "1", + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "presence": { + "description": "Presence", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Presence ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Presence creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Presence update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Presence permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "674af8f3e12a5f9ac0be" + }, + "status": { + "type": "string", + "description": "Presence status.", + "example": "online", + "nullable": true + }, + "source": { + "type": "string", + "description": "Presence source.", + "example": "HTTP" + }, + "expiresAt": { + "type": "string", + "description": "Presence expiry date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": true, + "description": "Presence metadata.", + "example": { + "key": "value" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "userId", + "source" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "userId": "674af8f3e12a5f9ac0be", + "status": "online", + "source": "HTTP", + "expiresAt": "2020-10-15T06:38:00.000+00:00", + "metadata": { + "key": "value" + } + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "example": {}, + "allOf": [ + { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "argon2": "#\/components\/schemas\/algoArgon2", + "scrypt": "#\/components\/schemas\/algoScrypt", + "scryptMod": "#\/components\/schemas\/algoScryptModified", + "bcrypt": "#\/components\/schemas\/algoBcrypt", + "phpass": "#\/components\/schemas\/algoPhpass", + "sha": "#\/components\/schemas\/algoSha", + "md5": "#\/components\/schemas\/algoMd5" + } + } + } + ], + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "example": true + }, + "emailCanonical": { + "type": "string", + "description": "Canonical form of the user email address.", + "example": "john@appwrite.io", + "nullable": true + }, + "emailIsFree": { + "type": "boolean", + "description": "Whether the user email is from a free email provider.", + "example": true, + "nullable": true + }, + "emailIsDisposable": { + "type": "boolean", + "description": "Whether the user email is from a disposable email provider.", + "example": false, + "nullable": true + }, + "emailIsCorporate": { + "type": "boolean", + "description": "Whether the user email is from a corporate domain.", + "example": true, + "nullable": true + }, + "emailIsCanonical": { + "type": "boolean", + "description": "Whether the user email is in its canonical form.", + "example": true, + "nullable": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "example": { + "theme": "pink", + "timezone": "UTC" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/preferences" + } + ] + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "impersonator": { + "type": "boolean", + "description": "Whether the user can impersonate other users.", + "example": false, + "nullable": true + }, + "impersonatorUserId": { + "type": "string", + "description": "ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data.", + "example": "5e5ea5c16897e", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "emailCanonical": "john@appwrite.io", + "emailIsFree": true, + "emailIsDisposable": false, + "emailIsCorporate": true, + "emailIsCanonical": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "impersonator": false, + "impersonatorUserId": "5e5ea5c16897e" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "format": "int32", + "example": 8 + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "format": "int32", + "example": 14 + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "format": "int32", + "example": 1 + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "format": "int32", + "example": 64 + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "format": "int32", + "example": 65536 + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "format": "int32", + "example": 4 + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "format": "int32", + "example": 3 + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "example": "Pink.png" + }, + "folder": { + "type": "string", + "description": "Virtual folder containing the file, with a trailing slash. Empty for the bucket root.", + "example": "photos\/2026\/" + }, + "key": { + "type": "string", + "description": "Full virtual path of the file: the folder followed by the file name.", + "example": "photos\/2026\/Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "format": "int32", + "example": 17890 + }, + "sizeActual": { + "type": "integer", + "description": "File actual stored size in bytes after compression and\/or encryption.", + "format": "int32", + "example": 12345 + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "format": "int32", + "example": 17890 + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "format": "int32", + "example": 17890 + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "example": "gzip" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "folder", + "key", + "signature", + "mimeType", + "sizeOriginal", + "sizeActual", + "chunksTotal", + "chunksUploaded", + "encryption", + "compression" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "folder": "photos\/2026\/", + "key": "photos\/2026\/Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "sizeActual": 12345, + "chunksTotal": 17890, + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" + } + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "format": "int32", + "example": 100 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm chosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "example": false + }, + "transformations": { + "type": "boolean", + "description": "Image transformations are enabled.", + "example": false + }, + "totalSize": { + "type": "integer", + "description": "Total size of this bucket in bytes.", + "format": "int32", + "example": 128 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus", + "transformations", + "totalSize" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false, + "transformations": false, + "totalSize": 128 + } + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "format": "int32", + "example": 7 + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "example": { + "theme": "pink", + "timezone": "UTC" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/preferences" + } + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "example": "john@appwrite.io" + }, + "userPhone": { + "type": "string", + "description": "User phone number. Hide this attribute by toggling membership privacy in the Console.", + "example": "+1 555 555 5555" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "example": false + }, + "userAccessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "userPhone", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "userAccessedAt", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "userPhone": "+1 555 555 5555", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "userAccessedAt": "2020-10-15T06:38:00.000+00:00", + "roles": [ + "owner" + ] + } + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "example": "react" + }, + "deploymentRetention": { + "type": "integer", + "description": "How many days to keep the non-active deployments before they will be automatically deleted.", + "format": "int32", + "example": 7 + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "format": "int32", + "example": 300 + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "example": "npm run build" + }, + "startCommand": { + "type": "string", + "description": "Custom command to use when starting site runtime.", + "example": "node custom-server.mjs" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "example": false + }, + "providerBranches": { + "type": "array", + "description": "List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.", + "items": { + "type": "string" + }, + "example": [ + "main", + "feat\/*" + ] + }, + "providerPaths": { + "type": "array", + "description": "List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes.", + "items": { + "type": "string" + }, + "example": [ + "src\/**", + "!docs\/**" + ] + }, + "buildSpecification": { + "type": "string", + "description": "Machine specification for deployment builds.", + "example": "s-1vcpu-512mb" + }, + "runtimeSpecification": { + "type": "string", + "description": "Machine specification for SSR executions.", + "example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentRetention", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "timeout", + "installCommand", + "buildCommand", + "startCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "providerBranches", + "providerPaths", + "buildSpecification", + "runtimeSpecification", + "buildRuntime", + "adapter", + "fallbackFile" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentRetention": 7, + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "startCommand": "node custom-server.mjs", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "providerBranches": [ + "main", + "feat\/*" + ], + "providerPaths": [ + "src\/**", + "!docs\/**" + ], + "buildSpecification": "s-1vcpu-512mb", + "runtimeSpecification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "example": [ + "users" + ] + }, + "name": { + "type": "string", + "description": "Function name.", + "example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "example": "python-3.8" + }, + "deploymentRetention": { + "type": "integer", + "description": "How many days to keep the non-active deployments before they will be automatically deleted.", + "format": "int32", + "example": 7 + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "example": [ + "account.create" + ] + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "format": "int32", + "example": 300 + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "example": false + }, + "providerBranches": { + "type": "array", + "description": "List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.", + "items": { + "type": "string" + }, + "example": [ + "main", + "feat\/*" + ] + }, + "providerPaths": { + "type": "array", + "description": "List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes.", + "items": { + "type": "string" + }, + "example": [ + "src\/**", + "!docs\/**" + ] + }, + "buildSpecification": { + "type": "string", + "description": "Machine specification for deployment builds.", + "example": "s-1vcpu-512mb" + }, + "runtimeSpecification": { + "type": "string", + "description": "Machine specification for executions.", + "example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentRetention", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "providerBranches", + "providerPaths", + "buildSpecification", + "runtimeSpecification" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentRetention": 7, + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "providerBranches": [ + "main", + "feat\/*" + ], + "providerPaths": [ + "src\/**", + "!docs\/**" + ], + "buildSpecification": "s-1vcpu-512mb", + "runtimeSpecification": "s-1vcpu-512mb" + } + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "example": [ + "amd64" + ] + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "$ref": "#\/components\/schemas\/frameworkAdapter" + }, + "example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "example": "index.html", + "nullable": true + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory" + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "format": "int32", + "example": 128 + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "format": "int32", + "example": 128 + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "format": "int32", + "example": 128 + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "example": "5e5ea5c16897e" + }, + "status": { + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", \"canceled\" and \"failed\".", + "example": "ready", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "waiting" + ], + "title": "waiting" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "building" + ], + "title": "building" + }, + { + "type": "string", + "enum": [ + "ready" + ], + "title": "ready" + }, + { + "type": "string", + "enum": [ + "canceled" + ], + "title": "canceled" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "format": "int32", + "example": 128 + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "example": "0.7.x" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranch", + "providerBranchUrl" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "example": [ + "any" + ] + }, + "resourceId": { + "type": "string", + "description": "Function or site ID.", + "example": "5e5ea6g16897e" + }, + "resourceType": { + "description": "Execution resource type.", + "example": "functions", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "functions" + ], + "title": "functions" + }, + { + "type": "string", + "enum": [ + "sites" + ], + "title": "sites" + } + ] + }, + "deploymentId": { + "type": "string", + "description": "Deployment ID used to create the execution.", + "example": "5e5ea5c16897e" + }, + "trigger": { + "description": "The trigger that caused the resource to execute. Possible values can be: `http`, `schedule`, or `event`.", + "example": "http", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "http" + ], + "title": "http" + }, + { + "type": "string", + "enum": [ + "schedule" + ], + "title": "schedule" + }, + { + "type": "string", + "enum": [ + "event" + ], + "title": "event" + } + ] + }, + "status": { + "description": "The status of the resource execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`.", + "example": "processing", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "waiting" + ], + "title": "waiting" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "completed" + ], + "title": "completed" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + }, + { + "type": "string", + "enum": [ + "scheduled" + ], + "title": "scheduled" + } + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "format": "int32", + "example": 200 + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Resource logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "errors": { + "type": "string", + "description": "Resource errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "format": "double", + "example": 0.4 + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "resourceId", + "resourceType", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "project": { + "description": "Project", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Project ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Project creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Project update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Project name.", + "example": "New Project" + }, + "teamId": { + "type": "string", + "description": "Project team ID.", + "example": "1592981250" + }, + "region": { + "type": "string", + "description": "Project region.", + "example": "fra" + }, + "devKeys": { + "type": "array", + "description": "Deprecated since 1.9.5: List of dev keys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "example": [] + }, + "smtpEnabled": { + "type": "boolean", + "description": "Status for custom SMTP", + "example": false + }, + "smtpSenderName": { + "type": "string", + "description": "SMTP sender name", + "example": "John Appwrite" + }, + "smtpSenderEmail": { + "type": "string", + "description": "SMTP sender email", + "example": "john@appwrite.io" + }, + "smtpReplyToName": { + "type": "string", + "description": "SMTP reply to name", + "example": "Support Team" + }, + "smtpReplyToEmail": { + "type": "string", + "description": "SMTP reply to email", + "example": "support@appwrite.io" + }, + "smtpHost": { + "type": "string", + "description": "SMTP server host name", + "example": "mail.appwrite.io" + }, + "smtpPort": { + "type": "integer", + "description": "SMTP server port", + "format": "int32", + "example": 25 + }, + "smtpUsername": { + "type": "string", + "description": "SMTP server username", + "example": "emailuser" + }, + "smtpPassword": { + "type": "string", + "description": "SMTP server password. This property is write-only and always returned empty.", + "format": "password", + "example": "smtp-password" + }, + "smtpSecure": { + "type": "string", + "description": "SMTP server secure protocol", + "example": "tls" + }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "format": "int32", + "example": 1 + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "labels": { + "type": "array", + "description": "Labels for the project.", + "items": { + "type": "string" + }, + "example": [ + "vip" + ] + }, + "status": { + "type": "string", + "description": "Project status.", + "example": "active" + }, + "onboarding": { + "type": "object", + "additionalProperties": true, + "description": "Stage progress (completed or skipped) with timestamps and actor types, keyed by stage id.", + "example": {} + }, + "authMethods": { + "type": "array", + "description": "List of auth methods.", + "items": { + "$ref": "#\/components\/schemas\/projectAuthMethod" + }, + "example": [] + }, + "services": { + "type": "array", + "description": "List of services.", + "items": { + "$ref": "#\/components\/schemas\/projectService" + }, + "example": [] + }, + "protocols": { + "type": "array", + "description": "List of protocols.", + "items": { + "$ref": "#\/components\/schemas\/projectProtocol" + }, + "example": [] + }, + "blocks": { + "type": "array", + "description": "Project blocks information.", + "items": { + "type": "string" + }, + "example": [] + }, + "consoleAccessedAt": { + "type": "string", + "description": "Last time the project was accessed via console.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "wafEnabled": { + "type": "boolean", + "description": "Whether WAF enforcement is enabled for the project.", + "example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "teamId", + "region", + "devKeys", + "smtpEnabled", + "smtpSenderName", + "smtpSenderEmail", + "smtpReplyToName", + "smtpReplyToEmail", + "smtpHost", + "smtpPort", + "smtpUsername", + "smtpPassword", + "smtpSecure", + "pingCount", + "pingedAt", + "labels", + "status", + "onboarding", + "authMethods", + "services", + "protocols", + "blocks", + "consoleAccessedAt", + "wafEnabled" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "teamId": "1592981250", + "region": "fra", + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyToName": "Support Team", + "smtpReplyToEmail": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "smtp-password", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "labels": [ + "vip" + ], + "status": "active", + "onboarding": {}, + "authMethods": {}, + "services": {}, + "protocols": {}, + "blocks": [], + "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00", + "wafEnabled": false + } + }, + "projectAuthMethod": { + "description": "ProjectAuthMethod", + "type": "object", + "properties": { + "$id": { + "description": "Auth method ID.", + "example": "email-password", + "title": "ProjectAuthMethodId", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "email-password" + ], + "title": "email-password" + }, + { + "type": "string", + "enum": [ + "magic-url" + ], + "title": "magic-url" + }, + { + "type": "string", + "enum": [ + "email-otp" + ], + "title": "email-otp" + }, + { + "type": "string", + "enum": [ + "anonymous" + ], + "title": "anonymous" + }, + { + "type": "string", + "enum": [ + "invites" + ], + "title": "invites" + }, + { + "type": "string", + "enum": [ + "jwt" + ], + "title": "jwt" + }, + { + "type": "string", + "enum": [ + "phone" + ], + "title": "phone" + } + ] + }, + "enabled": { + "type": "boolean", + "description": "Auth method status.", + "example": false + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "email-password", + "enabled": false + } + }, + "projectService": { + "description": "ProjectService", + "type": "object", + "properties": { + "$id": { + "description": "Service ID.", + "example": "sites", + "title": "ProjectServiceId", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "account" + ], + "title": "account" + }, + { + "type": "string", + "enum": [ + "avatars" + ], + "title": "avatars" + }, + { + "type": "string", + "enum": [ + "databases" + ], + "title": "databases" + }, + { + "type": "string", + "enum": [ + "tablesdb" + ], + "title": "tablesdb" + }, + { + "type": "string", + "enum": [ + "locale" + ], + "title": "locale" + }, + { + "type": "string", + "enum": [ + "health" + ], + "title": "health" + }, + { + "type": "string", + "enum": [ + "project" + ], + "title": "project" + }, + { + "type": "string", + "enum": [ + "storage" + ], + "title": "storage" + }, + { + "type": "string", + "enum": [ + "teams" + ], + "title": "teams" + }, + { + "type": "string", + "enum": [ + "users" + ], + "title": "users" + }, + { + "type": "string", + "enum": [ + "vcs" + ], + "title": "vcs" + }, + { + "type": "string", + "enum": [ + "sites" + ], + "title": "sites" + }, + { + "type": "string", + "enum": [ + "functions" + ], + "title": "functions" + }, + { + "type": "string", + "enum": [ + "proxy" + ], + "title": "proxy" + }, + { + "type": "string", + "enum": [ + "graphql" + ], + "title": "graphql" + }, + { + "type": "string", + "enum": [ + "migrations" + ], + "title": "migrations" + }, + { + "type": "string", + "enum": [ + "messaging" + ], + "title": "messaging" + }, + { + "type": "string", + "enum": [ + "advisor" + ], + "title": "advisor" + } + ] + }, + "enabled": { + "type": "boolean", + "description": "Service status.", + "example": false + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "sites", + "enabled": false + } + }, + "projectProtocol": { + "description": "ProjectProtocol", + "type": "object", + "properties": { + "$id": { + "description": "Protocol ID.", + "example": "graphql", + "title": "ProjectProtocolId", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "rest" + ], + "title": "rest" + }, + { + "type": "string", + "enum": [ + "graphql" + ], + "title": "graphql" + }, + { + "type": "string", + "enum": [ + "websocket" + ], + "title": "websocket" + } + ] + }, + "enabled": { + "type": "boolean", + "description": "Protocol status.", + "example": false + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "graphql", + "enabled": false + } + }, + "webhook": { + "description": "Webhook", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Webhook ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Webhook creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Webhook update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Webhook name.", + "example": "My Webhook" + }, + "url": { + "type": "string", + "description": "Webhook URL endpoint.", + "example": "https:\/\/example.com\/webhook" + }, + "events": { + "type": "array", + "description": "Webhook trigger events.", + "items": { + "type": "string" + }, + "example": [ + "databases.tables.update", + "databases.collections.update" + ] + }, + "tls": { + "type": "boolean", + "description": "Indicates if SSL \/ TLS certificate verification is enabled.", + "example": true + }, + "authUsername": { + "type": "string", + "description": "HTTP basic authentication username.", + "example": "username" + }, + "authPassword": { + "type": "string", + "description": "HTTP basic authentication password.", + "format": "password", + "example": "webhook-password" + }, + "secret": { + "type": "string", + "description": "Signature key which can be used to validate incoming webhook payloads. Only returned on creation and secret rotation.", + "example": "ad3d581ca230e2b7059c545e5a" + }, + "enabled": { + "type": "boolean", + "description": "Indicates if this webhook is enabled.", + "example": true + }, + "logs": { + "type": "string", + "description": "Webhook error logs from the most recent failure.", + "example": "Failed to connect to remote server." + }, + "attempts": { + "type": "integer", + "description": "Number of consecutive failed webhook attempts.", + "format": "int32", + "example": 10 + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "url", + "events", + "tls", + "authUsername", + "authPassword", + "secret", + "enabled", + "logs", + "attempts" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": [ + "databases.tables.update", + "databases.collections.update" + ], + "tls": true, + "authUsername": "username", + "authPassword": "webhook-password", + "secret": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } + }, + "key": { + "description": "Key", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + }, + "secret": { + "type": "string", + "description": "Secret key.", + "example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "example": [ + "appwrite:flutter" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "scopes", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "ephemeralKey": { + "description": "Ephemeral Key", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "example": [ + "users.read" + ] + }, + "secret": { + "type": "string", + "description": "Secret key.", + "example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "example": [ + "appwrite:flutter" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "scopes", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "example": "Dev API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "example": [ + "appwrite:flutter" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "mockNumber": { + "description": "Mock Number", + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS.", + "example": "+1612842323" + }, + "otp": { + "type": "string", + "description": "Mock OTP for the number. ", + "example": "123456" + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "number", + "otp", + "$createdAt", + "$updatedAt" + ], + "example": { + "number": "+1612842323", + "otp": "123456", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "oAuth2Github": { + "description": "OAuth2GitHub", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "GitHub OAuth2 client ID. For GitHub Apps, use the \"App ID\" when both an App ID and client ID are available.", + "example": "e4d87900000000540733" + }, + "clientSecret": { + "type": "string", + "description": "GitHub OAuth2 client secret.", + "example": "5e07c00000000000000000000000000000198bcc" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "e4d87900000000540733", + "clientSecret": "5e07c00000000000000000000000000000198bcc" + } + }, + "oAuth2Discord": { + "description": "OAuth2Discord", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Discord OAuth2 client ID.", + "example": "950722000000343754" + }, + "clientSecret": { + "type": "string", + "description": "Discord OAuth2 client secret.", + "example": "YmPXnM000000000000000000002zFg5D" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "950722000000343754", + "clientSecret": "YmPXnM000000000000000000002zFg5D" + } + }, + "oAuth2Figma": { + "description": "OAuth2Figma", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Figma OAuth2 client ID.", + "example": "byay5H0000000000VtiI40" + }, + "clientSecret": { + "type": "string", + "description": "Figma OAuth2 client secret.", + "example": "yEpOYn0000000000000000004iIsU5" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "byay5H0000000000VtiI40", + "clientSecret": "yEpOYn0000000000000000004iIsU5" + } + }, + "oAuth2Dropbox": { + "description": "OAuth2Dropbox", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "appKey": { + "type": "string", + "description": "Dropbox OAuth2 app key.", + "example": "jl000000000009t" + }, + "appSecret": { + "type": "string", + "description": "Dropbox OAuth2 app secret.", + "example": "g200000000000vw" + } + }, + "required": [ + "$id", + "enabled", + "appKey", + "appSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "appKey": "jl000000000009t", + "appSecret": "g200000000000vw" + } + }, + "oAuth2Dailymotion": { + "description": "OAuth2Dailymotion", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "apiKey": { + "type": "string", + "description": "Dailymotion OAuth2 API key.", + "example": "07a9000000000000067f" + }, + "apiSecret": { + "type": "string", + "description": "Dailymotion OAuth2 API secret.", + "example": "a399a90000000000000000000000000000d90639" + } + }, + "required": [ + "$id", + "enabled", + "apiKey", + "apiSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "apiKey": "07a9000000000000067f", + "apiSecret": "a399a90000000000000000000000000000d90639" + } + }, + "oAuth2Bitbucket": { + "description": "OAuth2Bitbucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "key": { + "type": "string", + "description": "Bitbucket OAuth2 key.", + "example": "Knt70000000000ByRc" + }, + "secret": { + "type": "string", + "description": "Bitbucket OAuth2 secret.", + "example": "NMfLZJ00000000000000000000TLQdDx" + } + }, + "required": [ + "$id", + "enabled", + "key", + "secret" + ], + "example": { + "$id": "github", + "enabled": false, + "key": "Knt70000000000ByRc", + "secret": "NMfLZJ00000000000000000000TLQdDx" + } + }, + "oAuth2Bitly": { + "description": "OAuth2Bitly", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Bitly OAuth2 client ID.", + "example": "d95151000000000000000000000000000067af9b" + }, + "clientSecret": { + "type": "string", + "description": "Bitly OAuth2 client secret.", + "example": "a13e250000000000000000000000000000d73095" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "d95151000000000000000000000000000067af9b", + "clientSecret": "a13e250000000000000000000000000000d73095" + } + }, + "oAuth2Box": { + "description": "OAuth2Box", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Box OAuth2 client ID.", + "example": "deglcs00000000000000000000x2og6y" + }, + "clientSecret": { + "type": "string", + "description": "Box OAuth2 client secret.", + "example": "OKM1f100000000000000000000eshEif" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "deglcs00000000000000000000x2og6y", + "clientSecret": "OKM1f100000000000000000000eshEif" + } + }, + "oAuth2Autodesk": { + "description": "OAuth2Autodesk", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Autodesk OAuth2 client ID.", + "example": "5zw90v00000000000000000000kVYXN7" + }, + "clientSecret": { + "type": "string", + "description": "Autodesk OAuth2 client secret.", + "example": "7I000000000000MW" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "5zw90v00000000000000000000kVYXN7", + "clientSecret": "7I000000000000MW" + } + }, + "oAuth2Google": { + "description": "OAuth2Google", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Google OAuth2 client ID.", + "example": "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com" + }, + "clientSecret": { + "type": "string", + "description": "Google OAuth2 client secret.", + "example": "GOCSPX-2k8gsR0000000000000000VNahJj" + }, + "prompt": { + "type": "array", + "description": "Google OAuth2 prompt values.", + "items": { + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "consent" + ], + "title": "consent" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "example": [ + "consent" + ] + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "prompt" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", + "clientSecret": "GOCSPX-2k8gsR0000000000000000VNahJj", + "prompt": [ + "consent" + ] + } + }, + "oAuth2Zoom": { + "description": "OAuth2Zoom", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Zoom OAuth2 client ID.", + "example": "QMAC00000000000000w0AQ" + }, + "clientSecret": { + "type": "string", + "description": "Zoom OAuth2 client secret.", + "example": "GAWsG4000000000000000000007U01ON" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "QMAC00000000000000w0AQ", + "clientSecret": "GAWsG4000000000000000000007U01ON" + } + }, + "oAuth2Zoho": { + "description": "OAuth2Zoho", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Zoho OAuth2 client ID.", + "example": "1000.83C178000000000000000000RPNX0B" + }, + "clientSecret": { + "type": "string", + "description": "Zoho OAuth2 client secret.", + "example": "fb5cac000000000000000000000000000000a68f6e" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "1000.83C178000000000000000000RPNX0B", + "clientSecret": "fb5cac000000000000000000000000000000a68f6e" + } + }, + "oAuth2Yandex": { + "description": "OAuth2Yandex", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Yandex OAuth2 client ID.", + "example": "6a8a6a0000000000000000000091483c" + }, + "clientSecret": { + "type": "string", + "description": "Yandex OAuth2 client secret.", + "example": "bbf98500000000000000000000c75a63" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "6a8a6a0000000000000000000091483c", + "clientSecret": "bbf98500000000000000000000c75a63" + } + }, + "oAuth2X": { + "description": "OAuth2X", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "customerKey": { + "type": "string", + "description": "X OAuth2 customer key.", + "example": "slzZV0000000000000NFLaWT" + }, + "secretKey": { + "type": "string", + "description": "X OAuth2 secret key.", + "example": "tkEPkp00000000000000000000000000000000000000FTxbI9" + } + }, + "required": [ + "$id", + "enabled", + "customerKey", + "secretKey" + ], + "example": { + "$id": "github", + "enabled": false, + "customerKey": "slzZV0000000000000NFLaWT", + "secretKey": "tkEPkp00000000000000000000000000000000000000FTxbI9" + } + }, + "oAuth2WordPress": { + "description": "OAuth2WordPress", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "WordPress OAuth2 client ID.", + "example": "130005" + }, + "clientSecret": { + "type": "string", + "description": "WordPress OAuth2 client secret.", + "example": "PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "130005", + "clientSecret": "PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk" + } + }, + "oAuth2Twitch": { + "description": "OAuth2Twitch", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Twitch OAuth2 client ID.", + "example": "vvi0in000000000000000000ikmt9p" + }, + "clientSecret": { + "type": "string", + "description": "Twitch OAuth2 client secret.", + "example": "pmapue000000000000000000zylw3v" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "vvi0in000000000000000000ikmt9p", + "clientSecret": "pmapue000000000000000000zylw3v" + } + }, + "oAuth2Stripe": { + "description": "OAuth2Stripe", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Stripe OAuth2 client ID.", + "example": "ca_UKibXX0000000000000000000006byvR" + }, + "apiSecretKey": { + "type": "string", + "description": "Stripe OAuth2 API secret key.", + "example": "sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "apiSecretKey" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "ca_UKibXX0000000000000000000006byvR", + "apiSecretKey": "sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp" + } + }, + "oAuth2Spotify": { + "description": "OAuth2Spotify", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Spotify OAuth2 client ID.", + "example": "6ec271000000000000000000009beace" + }, + "clientSecret": { + "type": "string", + "description": "Spotify OAuth2 client secret.", + "example": "db068a000000000000000000008b5b9f" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "6ec271000000000000000000009beace", + "clientSecret": "db068a000000000000000000008b5b9f" + } + }, + "oAuth2Slack": { + "description": "OAuth2Slack", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Slack OAuth2 client ID.", + "example": "23000000089.15000000000023" + }, + "clientSecret": { + "type": "string", + "description": "Slack OAuth2 client secret.", + "example": "81656000000000000000000000f3d2fd" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "23000000089.15000000000023", + "clientSecret": "81656000000000000000000000f3d2fd" + } + }, + "oAuth2Podio": { + "description": "OAuth2Podio", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Podio OAuth2 client ID.", + "example": "appwrite-oauth-test-app" + }, + "clientSecret": { + "type": "string", + "description": "Podio OAuth2 client secret.", + "example": "Rn247T0000000000000000000000000000000000000000000000000000W2zWTN" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "appwrite-oauth-test-app", + "clientSecret": "Rn247T0000000000000000000000000000000000000000000000000000W2zWTN" + } + }, + "oAuth2Notion": { + "description": "OAuth2Notion", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "oauthClientId": { + "type": "string", + "description": "Notion OAuth2 client ID.", + "example": "341d8700-0000-0000-0000-000000446ee3" + }, + "oauthClientSecret": { + "type": "string", + "description": "Notion OAuth2 client secret.", + "example": "secret_dLUr4b000000000000000000000000000000lFHAa9" + } + }, + "required": [ + "$id", + "enabled", + "oauthClientId", + "oauthClientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "oauthClientId": "341d8700-0000-0000-0000-000000446ee3", + "oauthClientSecret": "secret_dLUr4b000000000000000000000000000000lFHAa9" + } + }, + "oAuth2Salesforce": { + "description": "OAuth2Salesforce", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "customerKey": { + "type": "string", + "description": "Salesforce OAuth2 consumer key.", + "example": "3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq" + }, + "customerSecret": { + "type": "string", + "description": "Salesforce OAuth2 consumer secret.", + "example": "3w000000000000e2" + } + }, + "required": [ + "$id", + "enabled", + "customerKey", + "customerSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "customerKey": "3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq", + "customerSecret": "3w000000000000e2" + } + }, + "oAuth2Yahoo": { + "description": "OAuth2Yahoo", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Yahoo OAuth2 client ID.", + "example": "dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm" + }, + "clientSecret": { + "type": "string", + "description": "Yahoo OAuth2 client secret.", + "example": "cf978f0000000000000000000000000000c5e2e9" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm", + "clientSecret": "cf978f0000000000000000000000000000c5e2e9" + } + }, + "oAuth2Cloudflare": { + "description": "OAuth2Cloudflare", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Cloudflare OAuth2 client ID.", + "example": "4b866000000000000000000000c9e4e2" + }, + "clientSecret": { + "type": "string", + "description": "Cloudflare OAuth2 client secret.", + "example": "cfoc_5Q6YRl0000000000000000000000000000000000003d214f" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "4b866000000000000000000000c9e4e2", + "clientSecret": "cfoc_5Q6YRl0000000000000000000000000000000000003d214f" + } + }, + "oAuth2HuggingFace": { + "description": "OAuth2HuggingFace", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Hugging Face OAuth2 client ID.", + "example": "2ab9cff9-d711-40ad-a91e-b08a49c42d24" + }, + "clientSecret": { + "type": "string", + "description": "Hugging Face OAuth2 client secret.", + "example": "oauth_app_secret_wcLhRtl000000000000000000000xbNdLt" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "2ab9cff9-d711-40ad-a91e-b08a49c42d24", + "clientSecret": "oauth_app_secret_wcLhRtl000000000000000000000xbNdLt" + } + }, + "oAuth2Linkedin": { + "description": "OAuth2Linkedin", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "LinkedIn OAuth2 client ID.", + "example": "770000000000dv" + }, + "primaryClientSecret": { + "type": "string", + "description": "LinkedIn OAuth2 primary client secret.", + "example": "WPL_AP1.2Bf0000000000000.\/HtlYw==" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "primaryClientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "770000000000dv", + "primaryClientSecret": "WPL_AP1.2Bf0000000000000.\/HtlYw==" + } + }, + "oAuth2Disqus": { + "description": "OAuth2Disqus", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "publicKey": { + "type": "string", + "description": "Disqus OAuth2 public key.", + "example": "cgegH70000000000000000000000000000000000000000000000000000Hr1nYX" + }, + "secretKey": { + "type": "string", + "description": "Disqus OAuth2 secret key.", + "example": "W7Bykj00000000000000000000000000000000000000000000000000003o43w9" + } + }, + "required": [ + "$id", + "enabled", + "publicKey", + "secretKey" + ], + "example": { + "$id": "github", + "enabled": false, + "publicKey": "cgegH70000000000000000000000000000000000000000000000000000Hr1nYX", + "secretKey": "W7Bykj00000000000000000000000000000000000000000000000000003o43w9" + } + }, + "oAuth2Amazon": { + "description": "OAuth2Amazon", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Amazon OAuth2 client ID.", + "example": "amzn1.application-oa2-client.87400c00000000000000000000063d5b2" + }, + "clientSecret": { + "type": "string", + "description": "Amazon OAuth2 client secret.", + "example": "79ffe4000000000000000000000000000000000000000000000000000002de55" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "amzn1.application-oa2-client.87400c00000000000000000000063d5b2", + "clientSecret": "79ffe4000000000000000000000000000000000000000000000000000002de55" + } + }, + "oAuth2Etsy": { + "description": "OAuth2Etsy", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "keyString": { + "type": "string", + "description": "Etsy OAuth2 keystring.", + "example": "nsgzxh0000000000008j85a2" + }, + "sharedSecret": { + "type": "string", + "description": "Etsy OAuth2 shared secret.", + "example": "tp000000ru" + } + }, + "required": [ + "$id", + "enabled", + "keyString", + "sharedSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "keyString": "nsgzxh0000000000008j85a2", + "sharedSecret": "tp000000ru" + } + }, + "oAuth2Facebook": { + "description": "OAuth2Facebook", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "appId": { + "type": "string", + "description": "Facebook OAuth2 app ID.", + "example": "260600000007694" + }, + "appSecret": { + "type": "string", + "description": "Facebook OAuth2 app secret.", + "example": "2d0b2800000000000000000000d38af4" + } + }, + "required": [ + "$id", + "enabled", + "appId", + "appSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "appId": "260600000007694", + "appSecret": "2d0b2800000000000000000000d38af4" + } + }, + "oAuth2Tradeshift": { + "description": "OAuth2Tradeshift", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "oauth2ClientId": { + "type": "string", + "description": "Tradeshift OAuth2 client ID.", + "example": "appwrite-test-org.appwrite-test-app" + }, + "oauth2ClientSecret": { + "type": "string", + "description": "Tradeshift OAuth2 client secret.", + "example": "7cb52700-0000-0000-0000-000000ca5b83" + } + }, + "required": [ + "$id", + "enabled", + "oauth2ClientId", + "oauth2ClientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "oauth2ClientId": "appwrite-test-org.appwrite-test-app", + "oauth2ClientSecret": "7cb52700-0000-0000-0000-000000ca5b83" + } + }, + "oAuth2Paypal": { + "description": "OAuth2Paypal", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "PayPal OAuth2 client ID.", + "example": "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB" + }, + "secretKey": { + "type": "string", + "description": "PayPal OAuth2 secret key.", + "example": "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "secretKey" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", + "secretKey": "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" + } + }, + "oAuth2Gitlab": { + "description": "OAuth2Gitlab", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "applicationId": { + "type": "string", + "description": "GitLab OAuth2 application ID.", + "example": "d41ffe0000000000000000000000000000000000000000000000000000d5e252" + }, + "secret": { + "type": "string", + "description": "GitLab OAuth2 secret.", + "example": "gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38" + }, + "endpoint": { + "type": "string", + "description": "GitLab OAuth2 endpoint URL. Defaults to https:\/\/gitlab.com for self-hosted instances.", + "example": "https:\/\/gitlab.com" + } + }, + "required": [ + "$id", + "enabled", + "applicationId", + "secret", + "endpoint" + ], + "example": { + "$id": "github", + "enabled": false, + "applicationId": "d41ffe0000000000000000000000000000000000000000000000000000d5e252", + "secret": "gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38", + "endpoint": "https:\/\/gitlab.com" + } + }, + "oAuth2Appwrite": { + "description": "OAuth2Appwrite", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Appwrite OAuth2 client ID.", + "example": "6a42000000000000b5a0" + }, + "clientSecret": { + "type": "string", + "description": "Appwrite OAuth2 client secret.", + "example": "b86afd000000000000000000000000000000000000000000000000000ced5f93" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "6a42000000000000b5a0", + "clientSecret": "b86afd000000000000000000000000000000000000000000000000000ced5f93" + } + }, + "oAuth2Authentik": { + "description": "OAuth2Authentik", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Authentik OAuth2 client ID.", + "example": "dTKOPa0000000000000000000000000000e7G8hv" + }, + "clientSecret": { + "type": "string", + "description": "Authentik OAuth2 client secret.", + "example": "ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK" + }, + "endpoint": { + "type": "string", + "description": "Authentik OAuth2 endpoint domain.", + "example": "example.authentik.com" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "endpoint" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "dTKOPa0000000000000000000000000000e7G8hv", + "clientSecret": "ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK", + "endpoint": "example.authentik.com" + } + }, + "oAuth2Auth0": { + "description": "OAuth2Auth0", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Auth0 OAuth2 client ID.", + "example": "OaOkIA000000000000000000005KLSYq" + }, + "clientSecret": { + "type": "string", + "description": "Auth0 OAuth2 client secret.", + "example": "zXz0000-00000000000000000000000000000-00000000000000000000PJafnF" + }, + "endpoint": { + "type": "string", + "description": "Auth0 OAuth2 endpoint domain.", + "example": "example.us.auth0.com" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "endpoint" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "OaOkIA000000000000000000005KLSYq", + "clientSecret": "zXz0000-00000000000000000000000000000-00000000000000000000PJafnF", + "endpoint": "example.us.auth0.com" + } + }, + "oAuth2FusionAuth": { + "description": "OAuth2FusionAuth", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "FusionAuth OAuth2 client ID.", + "example": "b2222c00-0000-0000-0000-000000862097" + }, + "clientSecret": { + "type": "string", + "description": "FusionAuth OAuth2 client secret.", + "example": "Jx4s0C0000000000000000000000000000000wGqLsc" + }, + "endpoint": { + "type": "string", + "description": "FusionAuth OAuth2 endpoint domain.", + "example": "example.fusionauth.io" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "endpoint" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "b2222c00-0000-0000-0000-000000862097", + "clientSecret": "Jx4s0C0000000000000000000000000000000wGqLsc", + "endpoint": "example.fusionauth.io" + } + }, + "oAuth2Keycloak": { + "description": "OAuth2Keycloak", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Keycloak OAuth2 client ID.", + "example": "appwrite-o0000000st-app" + }, + "clientSecret": { + "type": "string", + "description": "Keycloak OAuth2 client secret.", + "example": "jdjrJd00000000000000000000HUsaZO" + }, + "endpoint": { + "type": "string", + "description": "Keycloak OAuth2 endpoint domain.", + "example": "keycloak.example.com" + }, + "realmName": { + "type": "string", + "description": "Keycloak OAuth2 realm name.", + "example": "appwrite-realm" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "endpoint", + "realmName" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "appwrite-o0000000st-app", + "clientSecret": "jdjrJd00000000000000000000HUsaZO", + "endpoint": "keycloak.example.com", + "realmName": "appwrite-realm" + } + }, + "oAuth2Oidc": { + "description": "OAuth2Oidc", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "OpenID Connect OAuth2 client ID.", + "example": "qibI2x0000000000000000000000000006L2YFoG" + }, + "clientSecret": { + "type": "string", + "description": "OpenID Connect OAuth2 client secret.", + "example": "Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV" + }, + "wellKnownURL": { + "type": "string", + "description": "OpenID Connect well-known configuration URL. When set, authorization, token, and user info endpoints can be discovered automatically.", + "example": "https:\/\/myoauth.com\/.well-known\/openid-configuration" + }, + "authorizationURL": { + "type": "string", + "description": "OpenID Connect authorization endpoint URL.", + "example": "https:\/\/myoauth.com\/oauth2\/authorize" + }, + "tokenURL": { + "type": "string", + "description": "OpenID Connect token endpoint URL.", + "example": "https:\/\/myoauth.com\/oauth2\/token" + }, + "userInfoURL": { + "type": "string", + "description": "OpenID Connect user info endpoint URL.", + "example": "https:\/\/myoauth.com\/oauth2\/userinfo" + }, + "prompt": { + "type": "array", + "description": "OpenID Connect prompt values controlling the authentication and consent screens.", + "items": { + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "login" + ], + "title": "login" + }, + { + "type": "string", + "enum": [ + "consent" + ], + "title": "consent" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "example": [ + "consent" + ] + }, + "maxAge": { + "type": "integer", + "description": "Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds.", + "format": "int32", + "example": 3600, + "nullable": true + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "wellKnownURL", + "authorizationURL", + "tokenURL", + "userInfoURL", + "prompt" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "qibI2x0000000000000000000000000006L2YFoG", + "clientSecret": "Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV", + "wellKnownURL": "https:\/\/myoauth.com\/.well-known\/openid-configuration", + "authorizationURL": "https:\/\/myoauth.com\/oauth2\/authorize", + "tokenURL": "https:\/\/myoauth.com\/oauth2\/token", + "userInfoURL": "https:\/\/myoauth.com\/oauth2\/userinfo", + "prompt": [ + "consent" + ], + "maxAge": 3600 + } + }, + "oAuth2Okta": { + "description": "OAuth2Okta", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Okta OAuth2 client ID.", + "example": "0oa00000000000000698" + }, + "clientSecret": { + "type": "string", + "description": "Okta OAuth2 client secret.", + "example": "Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV" + }, + "domain": { + "type": "string", + "description": "Okta OAuth2 domain.", + "example": "trial-6400025.okta.com" + }, + "authorizationServerId": { + "type": "string", + "description": "Okta OAuth2 authorization server ID.", + "example": "aus000000000000000h7z" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret", + "domain", + "authorizationServerId" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "0oa00000000000000698", + "clientSecret": "Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV", + "domain": "trial-6400025.okta.com", + "authorizationServerId": "aus000000000000000h7z" + } + }, + "oAuth2Kick": { + "description": "OAuth2Kick", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Kick OAuth2 client ID.", + "example": "01KQ7C00000000000001MFHS32" + }, + "clientSecret": { + "type": "string", + "description": "Kick OAuth2 client secret.", + "example": "34ac5600000000000000000000000000000000000000000000000000e830c8b" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "01KQ7C00000000000001MFHS32", + "clientSecret": "34ac5600000000000000000000000000000000000000000000000000e830c8b" + } + }, + "oAuth2Apple": { + "description": "OAuth2Apple", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "apple" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "serviceId": { + "type": "string", + "description": "Apple OAuth2 service ID.", + "example": "ip.appwrite.app.web" + }, + "keyId": { + "type": "string", + "description": "Apple OAuth2 key ID.", + "example": "P4000000N8" + }, + "teamId": { + "type": "string", + "description": "Apple OAuth2 team ID.", + "example": "D4000000R6" + }, + "p8File": { + "type": "string", + "description": "Apple OAuth2 .p8 private key file contents. The secret key wrapped by the PEM markers is 200 characters long.", + "example": "-----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----" + } + }, + "required": [ + "$id", + "enabled", + "serviceId", + "keyId", + "teamId", + "p8File" + ], + "example": { + "$id": "apple", + "enabled": false, + "serviceId": "ip.appwrite.app.web", + "keyId": "P4000000N8", + "teamId": "D4000000R6", + "p8File": "-----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----" + } + }, + "oAuth2Microsoft": { + "description": "OAuth2Microsoft", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "applicationId": { + "type": "string", + "description": "Microsoft OAuth2 application ID.", + "example": "00001111-aaaa-2222-bbbb-3333cccc4444" + }, + "applicationSecret": { + "type": "string", + "description": "Microsoft OAuth2 application secret.", + "example": "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u" + }, + "tenant": { + "type": "string", + "description": "Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID.", + "example": "common" + } + }, + "required": [ + "$id", + "enabled", + "applicationId", + "applicationSecret", + "tenant" + ], + "example": { + "$id": "github", + "enabled": false, + "applicationId": "00001111-aaaa-2222-bbbb-3333cccc4444", + "applicationSecret": "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", + "tenant": "common" + } + }, + "oAuth2Resend": { + "description": "OAuth2Resend", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "OAuth2 provider ID.", + "example": "github" + }, + "enabled": { + "type": "boolean", + "description": "OAuth2 provider is active and can be used to create sessions.", + "example": false + }, + "clientId": { + "type": "string", + "description": "Resend OAuth2 client ID.", + "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479" + }, + "clientSecret": { + "type": "string", + "description": "Resend OAuth2 client secret.", + "example": "9c1e4b00000000000000000000000000000000000000000000000000a72d5f4" + } + }, + "required": [ + "$id", + "enabled", + "clientId", + "clientSecret" + ], + "example": { + "$id": "github", + "enabled": false, + "clientId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", + "clientSecret": "9c1e4b00000000000000000000000000000000000000000000000000a72d5f4" + } + }, + "oAuth2ProviderList": { + "description": "OAuth2 Providers List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of OAuth2 providers in the given project.", + "format": "int32", + "example": 5 + }, + "providers": { + "type": "array", + "description": "List of OAuth2 providers.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/oAuth2Github" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Discord" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Figma" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Dropbox" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Dailymotion" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Bitbucket" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Bitly" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Box" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Autodesk" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Google" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Zoom" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Zoho" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Yandex" + }, + { + "$ref": "#\/components\/schemas\/oAuth2X" + }, + { + "$ref": "#\/components\/schemas\/oAuth2WordPress" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Twitch" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Stripe" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Spotify" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Slack" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Podio" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Notion" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Salesforce" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Yahoo" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Linkedin" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Disqus" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Amazon" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Etsy" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Facebook" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Tradeshift" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Paypal" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Gitlab" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Appwrite" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Authentik" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Auth0" + }, + { + "$ref": "#\/components\/schemas\/oAuth2FusionAuth" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Keycloak" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Oidc" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Apple" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Okta" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Kick" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Microsoft" + }, + { + "$ref": "#\/components\/schemas\/oAuth2HuggingFace" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Resend" + }, + { + "$ref": "#\/components\/schemas\/oAuth2Cloudflare" + } + ], + "discriminator": { + "propertyName": "$id", + "mapping": { + "github": "#\/components\/schemas\/oAuth2Github", + "discord": "#\/components\/schemas\/oAuth2Discord", + "figma": "#\/components\/schemas\/oAuth2Figma", + "dropbox": "#\/components\/schemas\/oAuth2Dropbox", + "dailymotion": "#\/components\/schemas\/oAuth2Dailymotion", + "bitbucket": "#\/components\/schemas\/oAuth2Bitbucket", + "bitly": "#\/components\/schemas\/oAuth2Bitly", + "box": "#\/components\/schemas\/oAuth2Box", + "autodesk": "#\/components\/schemas\/oAuth2Autodesk", + "google": "#\/components\/schemas\/oAuth2Google", + "zoom": "#\/components\/schemas\/oAuth2Zoom", + "zoho": "#\/components\/schemas\/oAuth2Zoho", + "yandex": "#\/components\/schemas\/oAuth2Yandex", + "x": "#\/components\/schemas\/oAuth2X", + "wordpress": "#\/components\/schemas\/oAuth2WordPress", + "twitch": "#\/components\/schemas\/oAuth2Twitch", + "stripe": "#\/components\/schemas\/oAuth2Stripe", + "spotify": "#\/components\/schemas\/oAuth2Spotify", + "slack": "#\/components\/schemas\/oAuth2Slack", + "podio": "#\/components\/schemas\/oAuth2Podio", + "notion": "#\/components\/schemas\/oAuth2Notion", + "salesforce": "#\/components\/schemas\/oAuth2Salesforce", + "yahoo": "#\/components\/schemas\/oAuth2Yahoo", + "linkedin": "#\/components\/schemas\/oAuth2Linkedin", + "disqus": "#\/components\/schemas\/oAuth2Disqus", + "amazon": "#\/components\/schemas\/oAuth2Amazon", + "etsy": "#\/components\/schemas\/oAuth2Etsy", + "facebook": "#\/components\/schemas\/oAuth2Facebook", + "tradeshift": "#\/components\/schemas\/oAuth2Tradeshift", + "tradeshiftBox": "#\/components\/schemas\/oAuth2Tradeshift", + "paypal": "#\/components\/schemas\/oAuth2Paypal", + "paypalSandbox": "#\/components\/schemas\/oAuth2Paypal", + "gitlab": "#\/components\/schemas\/oAuth2Gitlab", + "appwrite": "#\/components\/schemas\/oAuth2Appwrite", + "authentik": "#\/components\/schemas\/oAuth2Authentik", + "auth0": "#\/components\/schemas\/oAuth2Auth0", + "fusionauth": "#\/components\/schemas\/oAuth2FusionAuth", + "keycloak": "#\/components\/schemas\/oAuth2Keycloak", + "oidc": "#\/components\/schemas\/oAuth2Oidc", + "apple": "#\/components\/schemas\/oAuth2Apple", + "okta": "#\/components\/schemas\/oAuth2Okta", + "kick": "#\/components\/schemas\/oAuth2Kick", + "microsoft": "#\/components\/schemas\/oAuth2Microsoft", + "huggingface": "#\/components\/schemas\/oAuth2HuggingFace", + "resend": "#\/components\/schemas\/oAuth2Resend", + "cloudflare": "#\/components\/schemas\/oAuth2Cloudflare" + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "providers" + ], + "example": { + "total": 5, + "providers": "" + } + }, + "policyPasswordDictionary": { + "description": "Policy Password Dictionary", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "enabled": { + "type": "boolean", + "description": "Whether password dictionary policy is enabled.", + "example": true + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "password-dictionary", + "enabled": true + } + }, + "policyPasswordHistory": { + "description": "Policy Password History", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "total": { + "type": "integer", + "description": "Password history length. A value of 0 means the policy is disabled.", + "format": "int32", + "example": 5 + } + }, + "required": [ + "$id", + "total" + ], + "example": { + "$id": "password-dictionary", + "total": 5 + } + }, + "policyPasswordStrength": { + "description": "Policy Password Strength", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "min": { + "type": "integer", + "description": "Minimum password length required for user passwords.", + "format": "int32", + "example": 12 + }, + "uppercase": { + "type": "boolean", + "description": "Whether passwords must include at least one uppercase letter.", + "example": true + }, + "lowercase": { + "type": "boolean", + "description": "Whether passwords must include at least one lowercase letter.", + "example": true + }, + "number": { + "type": "boolean", + "description": "Whether passwords must include at least one number.", + "example": true + }, + "symbols": { + "type": "boolean", + "description": "Whether passwords must include at least one symbol.", + "example": true + } + }, + "required": [ + "$id", + "min", + "uppercase", + "lowercase", + "number", + "symbols" + ], + "example": { + "$id": "password-dictionary", + "min": 12, + "uppercase": true, + "lowercase": true, + "number": true, + "symbols": true + } + }, + "policyPasswordPersonalData": { + "description": "Policy Password Personal Data", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "enabled": { + "type": "boolean", + "description": "Whether password personal data policy is enabled.", + "example": true + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "password-dictionary", + "enabled": true + } + }, + "policySessionAlert": { + "description": "Policy Session Alert", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "enabled": { + "type": "boolean", + "description": "Whether session alert policy is enabled.", + "example": true + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "password-dictionary", + "enabled": true + } + }, + "policySessionDuration": { + "description": "Policy Session Duration", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "duration": { + "type": "integer", + "description": "Session duration in seconds.", + "format": "int32", + "example": 3600 + } + }, + "required": [ + "$id", + "duration" + ], + "example": { + "$id": "password-dictionary", + "duration": 3600 + } + }, + "policySessionInvalidation": { + "description": "Policy Session Invalidation", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "enabled": { + "type": "boolean", + "description": "Whether session invalidation policy is enabled.", + "example": true + } + }, + "required": [ + "$id", + "enabled" + ], + "example": { + "$id": "password-dictionary", + "enabled": true + } + }, + "policySessionLimit": { + "description": "Policy Session Limit", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "total": { + "type": "integer", + "description": "Maximum number of sessions allowed per user. A value of 0 means the policy is disabled.", + "format": "int32", + "example": 10 + } + }, + "required": [ + "$id", + "total" + ], + "example": { + "$id": "password-dictionary", + "total": 10 + } + }, + "policyUserLimit": { + "description": "Policy User Limit", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "total": { + "type": "integer", + "description": "Maximum number of users allowed in the project. A value of 0 means the policy is disabled.", + "format": "int32", + "example": 100 + } + }, + "required": [ + "$id", + "total" + ], + "example": { + "$id": "password-dictionary", + "total": 100 + } + }, + "policyMembershipPrivacy": { + "description": "Policy Membership Privacy", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "userId": { + "type": "boolean", + "description": "Whether user ID is visible in memberships.", + "example": true + }, + "userEmail": { + "type": "boolean", + "description": "Whether user email is visible in memberships.", + "example": true + }, + "userPhone": { + "type": "boolean", + "description": "Whether user phone is visible in memberships.", + "example": true + }, + "userName": { + "type": "boolean", + "description": "Whether user name is visible in memberships.", + "example": true + }, + "userMFA": { + "type": "boolean", + "description": "Whether user MFA status is visible in memberships.", + "example": true + }, + "userAccessedAt": { + "type": "boolean", + "description": "Whether user last access time is visible in memberships.", + "example": true + } + }, + "required": [ + "$id", + "userId", + "userEmail", + "userPhone", + "userName", + "userMFA", + "userAccessedAt" + ], + "example": { + "$id": "password-dictionary", + "userId": true, + "userEmail": true, + "userPhone": true, + "userName": true, + "userMFA": true, + "userAccessedAt": true + } + }, + "policyMfaFactors": { + "description": "Policy MFA Factors", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Policy ID.", + "example": "password-dictionary" + }, + "totp": { + "type": "boolean", + "description": "Whether TOTP can be used to complete an MFA challenge.", + "example": true + }, + "email": { + "type": "boolean", + "description": "Whether email can be used to complete an MFA challenge.", + "example": true + }, + "phone": { + "type": "boolean", + "description": "Whether phone (SMS) can be used to complete an MFA challenge.", + "example": true + }, + "custom": { + "type": "boolean", + "description": "Whether the custom factor can be used to complete an MFA challenge.", + "example": true + } + }, + "required": [ + "$id", + "totp", + "email", + "phone", + "custom" + ], + "example": { + "$id": "password-dictionary", + "totp": true, + "email": true, + "phone": true, + "custom": true + } + }, + "platformWeb": { + "description": "Platform Web", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "hostname": { + "type": "string", + "description": "Web app hostname. Empty string for other platforms.", + "example": "app.example.com" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "hostname", + "key" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "hostname": "app.example.com" + } + }, + "platformApple": { + "description": "Platform Apple", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "bundleIdentifier": { + "type": "string", + "description": "Apple bundle identifier.", + "example": "com.company.appname" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "bundleIdentifier" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "bundleIdentifier": "com.company.appname" + } + }, + "platformAndroid": { + "description": "Platform Android", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "applicationId": { + "type": "string", + "description": "Android application ID.", + "example": "com.company.appname" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "applicationId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "applicationId": "com.company.appname" + } + }, + "platformWindows": { + "description": "Platform Windows", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "packageIdentifierName": { + "type": "string", + "description": "Windows package identifier name.", + "example": "com.company.appname" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "packageIdentifierName" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "packageIdentifierName": "com.company.appname" + } + }, + "platformLinux": { + "description": "Platform Linux", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "example": "My Web App" + }, + "type": { + "description": "Platform type. Possible values are: windows, apple, android, linux, web.", + "example": "web", + "title": "PlatformType", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "windows" + ], + "title": "windows" + }, + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "android" + ], + "title": "android" + }, + { + "type": "string", + "enum": [ + "linux" + ], + "title": "linux" + }, + { + "type": "string", + "enum": [ + "web" + ], + "title": "web" + } + ] + }, + "packageName": { + "type": "string", + "description": "Linux package name.", + "example": "com.company.appname" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "packageName" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "packageName": "com.company.appname" + } + }, + "platformList": { + "description": "Platforms List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of platforms in the given project.", + "format": "int32", + "example": 5 + }, + "platforms": { + "type": "array", + "description": "List of platforms.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/platformWeb" + }, + { + "$ref": "#\/components\/schemas\/platformApple" + }, + { + "$ref": "#\/components\/schemas\/platformAndroid" + }, + { + "$ref": "#\/components\/schemas\/platformWindows" + }, + { + "$ref": "#\/components\/schemas\/platformLinux" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "web": "#\/components\/schemas\/platformWeb", + "apple": "#\/components\/schemas\/platformApple", + "android": "#\/components\/schemas\/platformAndroid", + "windows": "#\/components\/schemas\/platformWindows", + "linux": "#\/components\/schemas\/platformLinux" + } + } + }, + "example": [] + } + }, + "required": [ + "total", + "platforms" + ], + "example": { + "total": 5, + "platforms": "" + } + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "format": "int32", + "example": 2 + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "format": "double", + "example": 0 + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "format": "int32", + "example": 512 + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "format": "double", + "example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } + }, + "proxyRule": { + "description": "Rule", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Rule ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Rule creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Rule update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "domain": { + "type": "string", + "description": "Domain name.", + "example": "appwrite.company.com" + }, + "type": { + "type": "string", + "description": "Action definition for the rule. Possible values are \"api\", \"deployment\", or \"redirect\"", + "example": "deployment" + }, + "trigger": { + "type": "string", + "description": "Defines how the rule was created. Possible values are \"manual\" or \"deployment\"", + "example": "manual" + }, + "redirectUrl": { + "type": "string", + "description": "URL to redirect to. Used if type is \"redirect\"", + "example": "https:\/\/appwrite.io\/docs" + }, + "redirectStatusCode": { + "type": "integer", + "description": "Status code to apply during redirect. Used if type is \"redirect\"", + "format": "int32", + "example": 301 + }, + "deploymentId": { + "type": "string", + "description": "ID of deployment. Used if type is \"deployment\"", + "example": "n3u9feiwmf" + }, + "deploymentResourceType": { + "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", + "example": "function", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "function" + ], + "title": "function" + }, + { + "type": "string", + "enum": [ + "site" + ], + "title": "site" + } + ], + "nullable": true + }, + "deploymentResourceId": { + "type": "string", + "description": "ID of deployment's resource (site or function ID). Used if type is \"deployment\"", + "example": "n3u9feiwmf" + }, + "deploymentVcsProviderBranch": { + "type": "string", + "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", + "example": "main" + }, + "status": { + "description": "Domain verification status. Possible values are \"unverified\", \"verifying\", \"verified\"", + "example": "verified", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "unverified" + ], + "title": "unverified" + }, + { + "type": "string", + "enum": [ + "verifying" + ], + "title": "verifying" + }, + { + "type": "string", + "enum": [ + "verified" + ], + "title": "verified" + } + ] + }, + "logs": { + "type": "string", + "description": "Logs from rule verification or certificate generation. Certificate generation logs are prioritized if both are available.", + "example": "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record." + }, + "renewAt": { + "type": "string", + "description": "Certificate auto-renewal date in ISO 8601 format.", + "example": "datetime" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "domain", + "type", + "trigger", + "redirectUrl", + "redirectStatusCode", + "deploymentId", + "deploymentResourceId", + "deploymentVcsProviderBranch", + "status", + "logs", + "renewAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "main", + "status": "verified", + "logs": "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", + "renewAt": "datetime" + } + }, + "emailTemplate": { + "description": "EmailTemplate", + "type": "object", + "properties": { + "templateId": { + "type": "string", + "description": "Template type", + "example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "example": "Click on the link to verify your account." + }, + "senderName": { + "type": "string", + "description": "Name of the sender", + "example": "My User" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "example": "mail@appwrite.io" + }, + "replyToEmail": { + "type": "string", + "description": "Reply to email address", + "example": "emails@appwrite.io" + }, + "replyToName": { + "type": "string", + "description": "Reply to name", + "example": "Support Team" + }, + "subject": { + "type": "string", + "description": "Email subject", + "example": "Please verify your email address" + } + }, + "required": [ + "templateId", + "locale", + "message", + "senderName", + "senderEmail", + "replyToEmail", + "replyToName", + "subject" + ], + "example": { + "templateId": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyToEmail": "emails@appwrite.io", + "replyToName": "Support Team", + "subject": "Please verify your email address" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaChallengeSecret": { + "description": "MFA Challenge Secret", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "code": { + "type": "string", + "description": "Challenge code to be delivered to the end user through a custom channel.", + "example": "446372" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire", + "code" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00", + "code": "446372" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "example": "[SHARED_SECRET]" + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "example": "otpauth:\/\/totp\/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite" + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": "[SHARED_SECRET]", + "uri": "otpauth:\/\/totp\/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite" + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "example": true + }, + "custom": { + "type": "boolean", + "description": "Can custom factor be used for MFA challenge for this account.", + "example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode", + "custom" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true, + "custom": true + } + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "example": "sms" + }, + "credentials": { + "type": "object", + "additionalProperties": true, + "description": "Provider credentials.", + "example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "additionalProperties": true, + "description": "Provider options.", + "example": { + "from": "sender-email@mydomain" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "format": "int32", + "example": 1 + }, + "data": { + "type": "object", + "additionalProperties": true, + "description": "Data of the message.", + "example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "description": "Status of delivery.", + "example": "processing", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "draft" + ], + "title": "draft" + }, + { + "type": "string", + "enum": [ + "processing" + ], + "title": "processing" + }, + { + "type": "string", + "enum": [ + "scheduled" + ], + "title": "scheduled" + }, + { + "type": "string", + "enum": [ + "sent" + ], + "title": "sent" + }, + { + "type": "string", + "enum": [ + "failed" + ], + "title": "failed" + } + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "processing" + } + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "format": "int32", + "example": 100 + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "format": "int32", + "example": 100 + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "format": "int32", + "example": 100 + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "example": [ + "users" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } + }, + "transaction": { + "description": "Transaction", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Transaction ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Transaction creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Transaction update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Current status of the transaction. One of: pending, committing, committed, rolled_back, failed.", + "example": "pending" + }, + "operations": { + "type": "integer", + "description": "Number of operations in the transaction.", + "format": "int32", + "example": 5 + }, + "expiresAt": { + "type": "string", + "description": "Expiration time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "operations", + "expiresAt" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "operations": 5, + "expiresAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "allOf": [ + { + "$ref": "#\/components\/schemas\/target" + } + ] + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + }, + "insight": { + "description": "Insight", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Insight ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Insight creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Insight update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "reportId": { + "type": "string", + "description": "Parent report ID. Insights always belong to a report.", + "example": "5e5ea5c16897e" + }, + "type": { + "type": "string", + "description": "Insight type. One of databaseIndex (legacy), tablesDBIndex, documentsDBIndex, vectorsDBIndex, databasePerformance, sitePerformance, siteAccessibility, siteSeo, functionPerformance. The index types are engine-specific so each CTA can pair the right service+method (databases.createIndex, tablesDB.createIndex, documentsDB.createIndex, or vectorsDB.createIndex).", + "example": "tablesDBIndex" + }, + "severity": { + "type": "string", + "description": "Insight severity. One of info, warning, critical.", + "example": "warning" + }, + "status": { + "type": "string", + "description": "Insight status. One of active, dismissed.", + "example": "active" + }, + "resourceType": { + "type": "string", + "description": "Type of the resource the insight is about. Plural noun, e.g. databases, sites, functions.", + "example": "databases" + }, + "resourceId": { + "type": "string", + "description": "ID of the resource the insight is about.", + "example": "main" + }, + "parentResourceType": { + "type": "string", + "description": "Plural noun for the parent resource that contains the insight's resource, e.g. an insight about a column index on a table \u2192 resourceType=indexes, parentResourceType=tables. Empty when the resource has no parent.", + "example": "tables" + }, + "parentResourceId": { + "type": "string", + "description": "ID of the parent resource. Empty when the resource has no parent.", + "example": "orders" + }, + "title": { + "type": "string", + "description": "Insight title.", + "example": "Missing index on collection orders" + }, + "summary": { + "type": "string", + "description": "Short markdown summary describing the insight.", + "example": "Queries against `orders.status` are scanning the full collection." + }, + "ctas": { + "type": "array", + "description": "List of call-to-action buttons attached to this insight.", + "items": { + "$ref": "#\/components\/schemas\/insightCTA" + }, + "example": [] + }, + "analyzedAt": { + "type": "string", + "description": "Time the insight was analyzed in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "dismissedAt": { + "type": "string", + "description": "Time the insight was dismissed in ISO 8601 format. Empty when not dismissed.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "dismissedBy": { + "type": "string", + "description": "User ID that dismissed the insight. Empty when not dismissed.", + "example": "5e5ea5c16897e", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "reportId", + "type", + "severity", + "status", + "resourceType", + "resourceId", + "parentResourceType", + "parentResourceId", + "title", + "summary", + "ctas" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "reportId": "5e5ea5c16897e", + "type": "tablesDBIndex", + "severity": "warning", + "status": "active", + "resourceType": "databases", + "resourceId": "main", + "parentResourceType": "tables", + "parentResourceId": "orders", + "title": "Missing index on collection orders", + "summary": "Queries against `orders.status` are scanning the full collection.", + "ctas": [], + "analyzedAt": "2020-10-15T06:38:00.000+00:00", + "dismissedAt": "2020-10-15T06:38:00.000+00:00", + "dismissedBy": "5e5ea5c16897e" + } + }, + "insightCTA": { + "description": "InsightCTA", + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "Human-readable label for the CTA, used in UI.", + "example": "Create missing index" + }, + "service": { + "type": "string", + "description": "Public API service (SDK namespace) the client should invoke. Must match the engine that owns the resource \u2014 for index suggestions: databases (legacy), tablesDB, documentsDB, or vectorsDB.", + "example": "tablesDB" + }, + "method": { + "type": "string", + "description": "Public API method on the chosen service the client should invoke when this CTA is triggered.", + "example": "createIndex" + }, + "params": { + "type": "object", + "additionalProperties": true, + "description": "Parameter map the client should pass to the service method when this CTA is triggered. Keys match the target API's parameter names (e.g. databaseId\/tableId\/columns for tablesDB, databaseId\/collectionId\/attributes for the legacy Databases API).", + "example": { + "databaseId": "main", + "tableId": "orders", + "key": "_idx_status", + "type": "key", + "columns": [ + "status" + ] + } + } + }, + "required": [ + "label", + "service", + "method", + "params" + ], + "example": { + "label": "Create missing index", + "service": "tablesDB", + "method": "createIndex", + "params": { + "databaseId": "main", + "tableId": "orders", + "key": "_idx_status", + "type": "key", + "columns": [ + "status" + ] + } + } + }, + "report": { + "description": "Report", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Report ID.", + "example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Report creation date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Report update date in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00" + }, + "appId": { + "type": "string", + "description": "ID of the third-party app that submitted the report.", + "example": "5e5ea5c16897e" + }, + "type": { + "type": "string", + "description": "Analyzer that produced this report. e.g. lighthouse, audit, databaseAnalyzer.", + "example": "lighthouse" + }, + "title": { + "type": "string", + "description": "Short, human-readable title for the report.", + "example": "Lighthouse audit for https:\/\/appwrite.io\/" + }, + "summary": { + "type": "string", + "description": "Markdown summary describing the report.", + "example": "Performance score 78. 4 opportunities found." + }, + "targetType": { + "type": "string", + "description": "Plural noun describing what the report analyzes, e.g. databases, sites, urls.", + "example": "urls" + }, + "target": { + "type": "string", + "description": "Free-form target identifier (URL for lighthouse, resource ID for db).", + "example": "https:\/\/appwrite.io\/" + }, + "categories": { + "type": "array", + "description": "Categories covered by the report, e.g. performance, accessibility.", + "items": { + "type": "string" + }, + "example": [ + "performance", + "accessibility" + ] + }, + "insights": { + "type": "array", + "description": "Insights nested under this report.", + "items": { + "$ref": "#\/components\/schemas\/insight" + }, + "example": [] + }, + "analyzedAt": { + "type": "string", + "description": "Time the report was analyzed in ISO 8601 format.", + "example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "appId", + "type", + "title", + "summary", + "targetType", + "target", + "categories", + "insights" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "appId": "5e5ea5c16897e", + "type": "lighthouse", + "title": "Lighthouse audit for https:\/\/appwrite.io\/", + "summary": "Performance score 78. 4 opportunities found.", + "targetType": "urls", + "target": "https:\/\/appwrite.io\/", + "categories": [ + "performance", + "accessibility" + ], + "insights": [], + "analyzedAt": "2020-10-15T06:38:00.000+00:00" + } + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "ProjectPath": { + "type": "apiKey", + "name": "project", + "description": "Your project ID", + "in": "query", + "x-appwrite": { + "location": "path", + "param": "project_id", + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "Organization": { + "type": "apiKey", + "name": "X-Appwrite-Organization", + "description": "Your organization ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_ORGANIZATION_ID>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "The OAuth access token to authenticate with" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "ForwardedUserAgent": { + "type": "apiKey", + "name": "X-Forwarded-User-Agent", + "description": "The user agent string of the client that made the request", + "in": "header" + }, + "DevKey": { + "type": "apiKey", + "name": "X-Appwrite-Dev-Key", + "description": "Your secret dev API key", + "in": "header" + }, + "Cookie": { + "type": "apiKey", + "name": "Cookie", + "description": "The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes.", + "in": "header" + }, + "ImpersonateUserId": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Id", + "description": "Impersonate a user by ID", + "in": "header", + "x-appwrite": { + "optional": true + } + }, + "ImpersonateUserEmail": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Email", + "description": "Impersonate a user by email", + "in": "header", + "x-appwrite": { + "optional": true + } + }, + "ImpersonateUserPhone": { + "type": "apiKey", + "name": "X-Appwrite-Impersonate-User-Phone", + "description": "Impersonate a user by phone", + "in": "header", + "x-appwrite": { + "optional": true + } + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file